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(api/controller): Promotion directive steps #2539

Merged
merged 9 commits into from
Sep 18, 2024

Conversation

hiddeco
Copy link
Contributor

@hiddeco hiddeco commented Sep 16, 2024

This introduces a PromotionTemplate within Stage resources, allowing someone to define a sequence of steps (directives) that should be run to promote Freight to a Stage using a Promotion.

---
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
  name: example
spec:
  promotionTemplate:
    spec:
      steps:
      - step: <directive>
      - step: <directive>

When this field is defined for a Stage, any previous "Promotion mechanisms" are ignored for newly created Promotions.


Note: While this pull request makes the feature work from end to end, it still has quite some rough edges, including (nonfunctioning) work directory persistence, result and queue behavior, Stage health checks, etc.

Copy link

netlify bot commented Sep 16, 2024

Deploy Preview for docs-kargo-akuity-io ready!

Name Link
🔨 Latest commit abf22ae
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-akuity-io/deploys/66eb3f0f6c83380008a43089
😎 Deploy Preview https://deploy-preview-2539.kargo.akuity.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.

@hiddeco hiddeco force-pushed the promotion-directives-api branch 2 times, most recently from ee539bf to fb1dff1 Compare September 17, 2024 11:14
Copy link

codecov bot commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 47.61905% with 55 lines in your changes missing coverage. Please review.

Project coverage is 49.54%. Comparing base (fbd3953) to head (abf22ae).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
internal/controller/promotions/promotions.go 27.27% 24 Missing ⚠️
internal/directives/simple_engine.go 77.77% 5 Missing and 5 partials ⚠️
api/v1alpha1/stage_types.go 0.00% 8 Missing ⚠️
api/v1alpha1/promotion_types.go 0.00% 7 Missing ⚠️
internal/directives/git_clone_directive.go 0.00% 3 Missing ⚠️
internal/kargo/kargo.go 0.00% 1 Missing and 1 partial ⚠️
internal/controller/stages/stages.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2539      +/-   ##
==========================================
- Coverage   49.60%   49.54%   -0.07%     
==========================================
  Files         275      276       +1     
  Lines       19690    19761      +71     
==========================================
+ Hits         9767     9790      +23     
- Misses       9318     9363      +45     
- Partials      605      608       +3     

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

@hiddeco hiddeco force-pushed the promotion-directives-api branch 2 times, most recently from aa359a2 to b534e5d Compare September 17, 2024 21:35
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
@hiddeco hiddeco force-pushed the promotion-directives-api branch from b534e5d to e427378 Compare September 18, 2024 14:01
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
@hiddeco hiddeco force-pushed the promotion-directives-api branch from 907bdd5 to 99bdb1f Compare September 18, 2024 20:51
@hiddeco hiddeco force-pushed the promotion-directives-api branch from 99bdb1f to abf22ae Compare September 18, 2024 20:58
@hiddeco hiddeco marked this pull request as ready for review September 18, 2024 20:59
@hiddeco hiddeco requested a review from a team as a code owner September 18, 2024 20:59
@hiddeco hiddeco added this to the v0.9.0 milestone Sep 18, 2024
Copy link
Member

@krancour krancour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to PromotionContext

@hiddeco hiddeco added this pull request to the merge queue Sep 18, 2024
Merged via the queue into akuity:main with commit bbec37d Sep 18, 2024
14 of 17 checks passed
@hiddeco hiddeco deleted the promotion-directives-api branch September 18, 2024 21:34
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.

2 participants