-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLOUDP-228587: Migrate Maintenance Window #1880
base: main
Are you sure you want to change the base?
Conversation
type MaintenanceWindow struct { | ||
*project.MaintenanceWindow | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the wrapping if we are not adding more fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly I was just following the layout of previous translation layers - however I was considering including the projectID in this struct rather than having to pass it down every time. Does that sound like a good idea?
func NewMaintenanceWindow(spec *project.MaintenanceWindow) *MaintenanceWindow { | ||
if spec == nil { | ||
return nil | ||
} | ||
// No slices so no normalization needed | ||
return &MaintenanceWindow{MaintenanceWindow: spec} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the wrapping we would also not need this.
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestRoundtrip_MaintenanceWindow(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI gofuzz supports integration with dvyukovgo-fuzz which in turns means we might be able to make our fuzz tests official go fuzz tests, with the language support that this brings.
No need to change for this one, but maybe we could explore it going forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
About the wrapping, it is not a blocker, but also not sure of the benefit of wrapping such type in this particular case.
All Submissions:
closes #XXXX
in your comment to auto-close the issue that your PR fixes (if there is one).