-
Notifications
You must be signed in to change notification settings - Fork 167
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
Prevent manually created Freight from being auto-promoted #3225
Comments
Thanks @aayushsrivastava. I understand your issue and completely agree there's room for improvement here. I'm not sure about the proposed implementation:
Freight that are eligible for autopromotion to any Stage are the newest ones "available" to it. Availability is based a variety of factors. If that logic were updated to additionally factor in a switch that indicates something is not auto-promotable, the problem is that once you flip that switch, that logic will no longer prevent it from flowing into the Stages that you didn't want to have it. So I definitely would like to do something about the issue you've raised, but think we need to iterate a bit more on exactly how to achieve it. We're certainly open to any other ideas you may have. Note some small bit of overlap with #3016 It might be possible to solve both problems in tandem. Or it may not. I'm linking to it just so that we don't lose sight of the potential for it. |
Yeah, I realize now that flipping the switch upon manual promotion to
Maybe we treat the manually created Freight differently for the left-most stage (the one requesting it "directly" from a Warehouse). Manually created Freight will not be "available" to any Stage to start with. Manually created Freight is "available" to a later stage since it is manually approved (I am guessing manual approval and verification upstream are two of the factors that make a Freight "available"). PS: I haven't read the source code yet so my understanding of "availability" in this thread may be incomplete due to lossiness of English. |
I think that's an idea worth exploring. |
Hi, all. As a workaround I tried to use 2 warehouses - one with FreightCreationPolicy = 'Auto' that directly promoted to Dev stage and another with FreightCreationPolicy = 'Manual', that allow me to manually create Freight on demand. But in this case promotion steps doesn't work correctly because of ambiguous image detection between warehouses. I know there is argument Wouldn't it be an good option to have a FreightCreationPolicy per Warehouse subscription, and not for the whole Warehouse? It allows users to have multiply Freight streams for the same source, but for different purposes (for auto-promotion and for manual creation as example). |
Checklist
kargo version
, if applicable.Proposed Feature
When a user manually creates a Freight from "Freight Assembly", it should not be auto-promoted to the left-most Stage. Instead, the user should explicitly promote it to a Stage and then it can auto-promote downstream from there.
Disclaimer: Maybe I am using the features wrong and there are alternative ways of achieving this behavior, please point me in the right direction if that's the case.
Motivation
Consider this simple example where we are developing a pet store. The Warehouse has the following definition:
The CI increments the minor version for any new change and Kargo auto-promotes it to the
dev
stage.There is an issue in production for which the fix is available in version
v0.2.1
. Kargo doesn't automatically create a new Freight for this version, which is okay.When the user manually creates a Freight for a hotfix, this Freight is auto-promoted to
dev
.This is not ideal because the user would have to manually restore the
dev
tov0.3.0
. Normally, the user would simply manually approve this Freight forstaging
, promote it there, and then promote it toprod
.Suggested Implementation
We can introduce a flag in the Freight called
isAutoPromotable
. Stages will ignore any Freight with this flag set to false for auto-promotions.Freight created from manual freight assembly will initially have this flag set to false. When the user explicitly promotes the Freight to any Stage, we can flip the flag to true so that the Freight can automatically flow downstream after the first manual promotion.
The text was updated successfully, but these errors were encountered: