-
Notifications
You must be signed in to change notification settings - Fork 166
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
feat: add ability to control semantics for Freight being made available to a Stage #3257
base: main
Are you sure you want to change the base?
feat: add ability to control semantics for Freight being made available to a Stage #3257
Conversation
✅ Deploy Preview for docs-kargo-io ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…n all upstream Stages Signed-off-by: Aidan Rowe <aidan@canva.com>
c6645f0
to
bfa3654
Compare
FYI @krancour |
@aidan-canva sorry for the delay. At a glance, this looks fantastic. I'll dig deeper on Monday and maybe have @hiddeco look as well. |
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.
For that reason, perhaps its better suited to sit closer to
FreightSources
where theRequiredSoakTime
is configured.
After reviewing your code, I think this is a good observation, and I would feel more comfortable with it sitting at the same level as RequiredSoakTime
. This would make the setting count for the list item (just like the soak time requirement), which I feel is better.
Other than this and my question/suggestion below, this looks like a straight forward implementation and a job well done. 🌷
VerifiedIn: req.Sources.Stages, | ||
ApprovedFor: s.Name, | ||
VerifiedIn: req.Sources.Stages, | ||
RequireAllVerifiedIn: req.AvailabilityStrategy == FreightAvailabilityStrategyAllUpstream, |
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.
Is there a specific reason you made the RequireAllVerifiedIn
a boolean instead of just passing on the strategy?
const ( | ||
FreightAvailabilityStrategyAllUpstream FreightAvailabilityStrategy = "AllUpstream" | ||
FreightAvailabilityStrategyAnyUpstream FreightAvailabilityStrategy = "AnyUpstream" | ||
) |
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.
Wonder if brevity might be an improvement here, but open to discussion.
const ( | |
FreightAvailabilityStrategyAllUpstream FreightAvailabilityStrategy = "AllUpstream" | |
FreightAvailabilityStrategyAnyUpstream FreightAvailabilityStrategy = "AnyUpstream" | |
) | |
const ( | |
FreightAvailabilityStrategyAll FreightAvailabilityStrategy = "All" | |
FreightAvailabilityStrategyOneOf FreightAvailabilityStrategy = "OneOf" | |
) |
Closes #3207
Adds concept of 'availability strategy' to a Freight Request to allow users to control the semantics used to determine if (verified) Freight is made available to a stage.
Default behavior is to make a Freight available if 'any' of the upstream Stages have verified it. This is backwards compatible with the current state of behavior. Users can explicitly configure
UpstreamAny
(default behavior) orUpstreamAll
(enums) as possible values.UpstreamAll
will only make Freight available if all of the configure upstream Stages have verified it. An enum was chosen over a boolean as it is possible other option could be implemented in the future (ie, promote when a majority of upstream have verified the Freight).This condition is applied on-top of existing Freight Request controls, such as the recently added minimum bake time control. For that reason, perhaps its better suited to sit closer to
FreightSources
where theRequiredSoakTime
is configured.