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(controller): add functions to EL for finding artifacts in promo's freight collection #2925

Merged
merged 11 commits into from
Nov 15, 2024

Conversation

krancour
Copy link
Member

@krancour krancour commented Nov 14, 2024

Before:

steps:
- uses: git-clone
  config:
    repoURL: ${{ vars.gitRepo }}
    checkout:
    - fromFreight: true                  # Magic!!!
      fromOrigin:                        # Verbose
        kind: Warehouse
        name: base-manifests
      path: ./base
    - fromFreight: true                  # Magic!!!
      fromOrigin:                        # Verbose
        kind: Warehouse
        name: overlay
      path: ./overlay
# ...

After:

steps:
- uses: git-clone
  config:
    repoURL: ${{ vars.gitRepo }}
    checkout:
    - commit: ${{ commitFrom(vars.gitRepo, warehouse('base-manifests')).ID }} # Clear and succinct
      path: ./base
    - commit: ${{ commitFrom(vars.gitRepo, warehouse('overlay')).ID }} # Clear and succinct
      path: ./overlay
# ...

Cases not requiring origin disambiguation are even more straightforward:

steps:
- uses: git-clone
  config:
    repoURL: ${{ vars.gitRepo }}
    checkout:
    - commit: ${{ commitFrom(vars.gitRepo).ID }} # Clear and succinct
      path: ./src

Similar functions are defined for accessing images and charts from the Promo's Freight collection.

See doc updates for more usage details and examples.

1b80bf0 is the core of this PR.

Most other commits focus on a single promotion step each:

  • Update schema with new fields that will be more natural replacements for a handful of existing fields that were workaround for EL not previously existing.
  • Update step implementation and tests accordingly.
  • Update step docs: Document new fields, deprecate others, update examples

A large chunk of this PR is new tests on schemas that I touched.

Short term this makes schemas slightly more complex and introduces additional conditionals into step implementations, but once we're able to fully remove the more "magical" fields and the logic that supports them, the schemas and step implementations will both be simplified beyond the state they were in prior to this PR. i.e. We get to delete lots of stuff in 1.2.

This branch of my examples is updated to take full advantage of these improvements: https://github.com/krancour/kargo-examples/tree/for-v1.1.0

Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
@krancour krancour requested review from a team as code owners November 14, 2024 06:02
@krancour krancour marked this pull request as draft November 14, 2024 06:03
Copy link

netlify bot commented Nov 14, 2024

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit 1ed28d2
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-io/deploys/67367fa7d2697e000856af0b
😎 Deploy Preview https://deploy-preview-2925.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.

@krancour krancour self-assigned this Nov 14, 2024
@krancour krancour added this to the v1.1.0 milestone Nov 14, 2024
@krancour krancour changed the title Krancour/el freight feat(controller): add functions to EL for finding artifacts in promo's freight collection Nov 14, 2024
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 87.59124% with 34 lines in your changes missing coverage. Please review.

Project coverage is 50.20%. Comparing base (aa66473) to head (1ed28d2).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/expressions/json_templates.go 52.17% 4 Missing and 7 partials ⚠️
internal/directives/argocd_updater.go 85.18% 6 Missing and 2 partials ⚠️
internal/directives/promotions.go 93.02% 5 Missing and 1 partial ⚠️
internal/directives/kustomize_image_setter.go 85.71% 5 Missing ⚠️
internal/directives/git_cloner.go 50.00% 2 Missing ⚠️
internal/directives/helm_chart_updater.go 96.42% 1 Missing ⚠️
internal/directives/helm_image_updater.go 97.61% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2925      +/-   ##
==========================================
+ Coverage   49.97%   50.20%   +0.22%     
==========================================
  Files         276      276              
  Lines       24811    24916     +105     
==========================================
+ Hits        12400    12509     +109     
+ Misses      11724    11718       -6     
- Partials      687      689       +2     

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

@krancour krancour marked this pull request as ready for review November 14, 2024 20:18
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
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.

This is really awesome, excellent job @krancour 🙇 🔥

@krancour krancour added this pull request to the merge queue Nov 15, 2024
Merged via the queue into akuity:main with commit 52906db Nov 15, 2024
17 checks passed
@krancour krancour deleted the krancour/el-freight branch November 15, 2024 16:35
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.

None yet

2 participants