Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

aidan-canva
Copy link

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) or UpstreamAll (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 the RequiredSoakTime is configured.

@aidan-canva aidan-canva requested a review from a team as a code owner January 13, 2025 10:18
Copy link

netlify bot commented Jan 13, 2025

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit 5602db2
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-io/deploys/67ac7afee8319800088f5a90
😎 Deploy Preview https://deploy-preview-3257.docs.kargo.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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>
@aidan-canva aidan-canva force-pushed the feat-freight-availability-all-semantic branch from c6645f0 to bfa3654 Compare January 13, 2025 10:21
@aidan-canva
Copy link
Author

FYI @krancour

@krancour
Copy link
Member

@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.

Copy link
Contributor

@hiddeco hiddeco left a 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 the RequiredSoakTime 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. 🌷

api/v1alpha1/stage_helpers.go Outdated Show resolved Hide resolved
api/v1alpha1/stage_types.go Outdated Show resolved Hide resolved
@aidan-canva aidan-canva requested a review from hiddeco January 29, 2025 07:32
Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.56%. Comparing base (d1441f1) to head (df648b4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3257      +/-   ##
==========================================
+ Coverage   52.50%   52.56%   +0.06%     
==========================================
  Files         291      291              
  Lines       26625    26659      +34     
==========================================
+ Hits        13979    14013      +34     
  Misses      11882    11882              
  Partials      764      764              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hiddeco hiddeco requested a review from krancour February 3, 2025 11:55
@krancour
Copy link
Member

krancour commented Feb 3, 2025

Few comments, but mostly looks very good.

@aidan-canva
Copy link
Author

Thanks for the feedback @krancour 👍 I've addressed all of the comments and its ready for another review.

@aidan-canva aidan-canva requested a review from krancour February 5, 2025 08:07
@aidan-canva aidan-canva force-pushed the feat-freight-availability-all-semantic branch from 2de2fcf to 4352167 Compare February 12, 2025 10:20
@aidan-canva aidan-canva requested a review from a team as a code owner February 12, 2025 10:20
@aidan-canva aidan-canva force-pushed the feat-freight-availability-all-semantic branch 2 times, most recently from 5cd0980 to 2de2fcf Compare February 12, 2025 10:24
Signed-off-by: Aidan Rowe <aidan@canva.com>
Signed-off-by: Aidan Rowe <aidan@canva.com>
…ability

Signed-off-by: Aidan Rowe <aidan@canva.com>
Signed-off-by: Aidan Rowe <aidan@canva.com>
@aidan-canva aidan-canva force-pushed the feat-freight-availability-all-semantic branch 3 times, most recently from 442d4fc to 5602db2 Compare February 12, 2025 10:42
@aidan-canva
Copy link
Author

@krancour @hiddeco just a friendly probe - any blockers on getting this merged? I'll get the last DCO commit signed/commits squashed if I can get the go ahead.

@hiddeco
Copy link
Contributor

hiddeco commented Feb 12, 2025

We are on a company offsite this week, hence the slight delay. If we do not get to it this week, next week we will be back at full capacity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: opt-in to "all" semantics when determining freight's availability to a given stage
3 participants