feat: consolidate Promotion construction in defaulting webhook#6215
Merged
Conversation
✅ Deploy Preview for docs-kargo-io canceled.
|
API server endpoints and the Stage controller now submit minimal Promotions (Stage + Freight); the defaulting webhook unconditionally populates the name, steps, and vars from the referenced Stage's PromotionTemplate. As a result, kubectl-driven Promotion creation now behaves the same as creation via the UI or CLI. Closes akuity#5126. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
3b4600d to
6152c3a
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6215 +/- ##
==========================================
- Coverage 58.49% 58.47% -0.03%
==========================================
Files 501 500 -1
Lines 42194 42188 -6
==========================================
- Hits 24682 24669 -13
- Misses 16020 16024 +4
- Partials 1492 1495 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fuskovic
approved these changes
May 6, 2026
fuskovic
left a comment
Member
There was a problem hiding this comment.
All my findings are NITs. Didn't find anything critical/blocking.
The Default webhook now rejects Promotions whose referenced Stage
defines no promotion steps. The long-stage-name test case used a bare
StageSpec{}, so it tripped that guard and returned early before
reaching the label-shortening logic it exercises. Give its fixture
Stage a PromotionTemplate with one step so the test verifies what it
intends to.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5126
API server endpoints and the Stage controller now submit minimal Promotions (Stage + Freight); the defaulting webhook unconditionally populates the name, steps, and vars from the referenced Stage's PromotionTemplate. As a result, kubectl-driven Promotion creation now behaves the same as creation via the UI or CLI.
This accomplished entirely by moving around existing logic. There's pretty much nothing new here.