-
Notifications
You must be signed in to change notification settings - Fork 107
CLOUDP-175080: Deletion protection for project resources (final) #1100
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
Conversation
fafed93 to
75dd43c
Compare
igor-karpukhin
left a comment
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.
Massive work here! Good job! 👍
| if akoMWindow.DayOfWeek != atlasMWindow.DayOfWeek { | ||
| return false | ||
| } | ||
|
|
||
| if akoMWindow.HourOfDay != *atlasMWindow.HourOfDay { | ||
| return false | ||
| } | ||
|
|
||
| if akoMWindow.StartASAP != *atlasMWindow.StartASAP { | ||
| return false | ||
| } | ||
|
|
||
| if akoMWindow.AutoDefer != *atlasMWindow.AutoDeferOnceEnabled { | ||
| return false | ||
| } | ||
|
|
||
| return true |
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 not this instead?
| if akoMWindow.DayOfWeek != atlasMWindow.DayOfWeek { | |
| return false | |
| } | |
| if akoMWindow.HourOfDay != *atlasMWindow.HourOfDay { | |
| return false | |
| } | |
| if akoMWindow.StartASAP != *atlasMWindow.StartASAP { | |
| return false | |
| } | |
| if akoMWindow.AutoDefer != *atlasMWindow.AutoDeferOnceEnabled { | |
| return false | |
| } | |
| return true | |
| return akoMWindow.DayOfWeek == atlasMWindow.DayOfWeek && | |
| akoMWindow.HourOfDay == *atlasMWindow.HourOfDay && | |
| akoMWindow.StartASAP == *atlasMWindow.StartASAP && | |
| akoMWindow.AutoDefer == *atlasMWindow.AutoDeferOnceEnabled |
For me it is easier to read as it separates the pointer value fixes above from the actual equals check.
| atlasAssignedTeamsInfo := make([]assignedTeamInfo, 0, atlasAssignedTeams.TotalCount) | ||
| for _, atlasAssignedTeam := range atlasAssignedTeams.Results { | ||
| if atlasAssignedTeam != nil { | ||
| atlasAssignedTeamsInfo = append( | ||
| atlasAssignedTeamsInfo, | ||
| assignedTeamInfo{ | ||
| ID: atlasAssignedTeam.TeamID, | ||
| Roles: atlasAssignedTeam.RoleNames, | ||
| }, | ||
| ) | ||
| } | ||
| } |
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.
nitpick
This seems to be a format conversion. Moving to its own function could made this more readable.
| atlasAssignedTeamsInfo := make([]assignedTeamInfo, 0, atlasAssignedTeams.TotalCount) | |
| for _, atlasAssignedTeam := range atlasAssignedTeams.Results { | |
| if atlasAssignedTeam != nil { | |
| atlasAssignedTeamsInfo = append( | |
| atlasAssignedTeamsInfo, | |
| assignedTeamInfo{ | |
| ID: atlasAssignedTeam.TeamID, | |
| Roles: atlasAssignedTeam.RoleNames, | |
| }, | |
| ) | |
| } | |
| } | |
| atlasAssignedTeamsInfo := atlasAssignedTeamsToInfos(atlasAssignedTeams.Results) |
josvazg
left a comment
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
All my comments are non blocking nitpicks
All Submissions:
closes #XXXXin your comment to auto-close the issue that your PR fixes (if there is one).