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: (cluster) Promotion tasks #3121

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft

Conversation

hiddeco
Copy link
Contributor

@hiddeco hiddeco commented Dec 11, 2024

This is very much a work in progress, and will supersede #3022.

Copy link

netlify bot commented Dec 11, 2024

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit 9d08e30
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-io/deploys/675c33a07fbb580008efae4c
😎 Deploy Preview https://deploy-preview-3121.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.

@hiddeco hiddeco added this to the v1.2.0 milestone Dec 11, 2024
@hiddeco hiddeco self-assigned this Dec 11, 2024
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 85.44601% with 31 lines in your changes missing coverage. Please review.

Project coverage is 51.48%. Comparing base (ac539e5) to head (9d08e30).

Files with missing lines Patch % Lines
internal/directives/output_composer.go 33.33% 16 Missing ⚠️
api/v1alpha1/promotion_types.go 0.00% 8 Missing ⚠️
internal/directives/promotions.go 66.66% 2 Missing and 1 partial ⚠️
internal/kargo/promotion_builder.go 97.88% 2 Missing and 1 partial ⚠️
internal/controller/promotions/promotions.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3121      +/-   ##
==========================================
+ Coverage   51.26%   51.48%   +0.22%     
==========================================
  Files         283      285       +2     
  Lines       25563    25731     +168     
==========================================
+ Hits        13104    13248     +144     
- Misses      11762    11786      +24     
  Partials      697      697              

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

Signed-off-by: Hidde Beydals <[email protected]>
Signed-off-by: Hidde Beydals <[email protected]>
Signed-off-by: Hidde Beydals <[email protected]>
- `PromotionTemplate` steps can contain either a reference to `uses` OR
  to a `task`.
- `PromotionTask` steps can not contain a reference to another `task`,
  but must contain a `uses` reference.
- `Promotion` steps can not contain a reference to a `task` (as we
  expect a `Promotion` to contain deflated tasks), but must contain
  a `uses` reference.
- Small other tweaks, to e.g. ensure we limit the max lenght of fields
  that contain name references to Kubernetes objects.

Signed-off-by: Hidde Beydals <[email protected]>
Signed-off-by: Hidde Beydals <[email protected]>
This includes validation rules to ensure a `PromotionTask` step can
not have `inputs` defined, but `Promotion` and `PromotionTemplate`
steps can (unless they reference a `task` themselves).

Signed-off-by: Hidde Beydals <[email protected]>
Signed-off-by: Hidde Beydals <[email protected]>
Signed-off-by: Hidde Beydals <[email protected]>
The builder is capable of inflating steps from a (Cluster)PromotionTask
into the Promotion it constructs.

To support this, a helper method has been added to the `PromotionStep`
in the (public) API to generate an alias for the step if none is
configured.

Signed-off-by: Hidde Beydals <[email protected]>
Signed-off-by: Hidde Beydals <[email protected]>
Signed-off-by: Hidde Beydals <[email protected]>
@hiddeco hiddeco force-pushed the promotion-tasks branch 2 times, most recently from eda8391 to f789867 Compare December 13, 2024 11:15
@hiddeco hiddeco force-pushed the promotion-tasks branch 2 times, most recently from 10671e1 to 7f0be4c Compare December 13, 2024 13:12
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.

1 participant