akuity / kargo

Application lifecycle orchestration
https://kargo.akuity.io/
Apache License 2.0
1.39k stars 114 forks source link

feat: make promotions work in multi-pipeline feature branch #2232

Closed krancour closed 2 days ago

krancour commented 3 days ago

Notes:

  1. A Promotion continues to reference only a single piece of Freight.
  2. The Promotion reconciler builds a collection of FreightReferences by taking the latest from history and adding/updating the reference to the piece of Freight that is actively being promoted.
  3. It is this collection of FreightReferences that gets passed to all the promotion mechanisms now.
  4. We continue to not attempt auto-promotions for Stages that request Freight from multiple origins.

This works end-to-end!

Known issues:

  1. Verifications fail for Stages with more than one current Freight. 😢 This is because the values we're setting on the kargo.akuity.io/freight label of an AnalysisRun is now too long.

  2. If n > 1 pieces of Freight from different origins contain artifacts from the same repository, we're not really doing anything yet to disambiguate which of the two a promotion mechanism references. You end up with the artifact from whichever of the n origins is alphabetically first.

These are are fixable, but it would be my preference to address them in a follow-up.

codecov[bot] commented 2 days ago

Codecov Report

Attention: Patch coverage is 82.45614% with 20 lines in your changes missing coverage. Please review.

Please upload report for BASE (multi-pipelines@1b40d4c). Learn more about missing BASE report.

Files Patch % Lines
internal/controller/promotions/promotions.go 0.00% 16 Missing :warning:
internal/controller/promotion/git.go 85.71% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## multi-pipelines #2232 +/- ## ================================================== Coverage ? 46.01% ================================================== Files ? 242 Lines ? 16756 Branches ? 0 ================================================== Hits ? 7710 Misses ? 8665 Partials ? 381 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.