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

improve how new branches are created #266

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

krancour
Copy link
Member

As a safeguard, Kargo render has long refused to write rendered config to a branch that doesn't already appear to be managed via Kargo Render. The signal that a branch is managed by Kargo Render has always been the existence of branch metadata in .kargo-render/metadata.yaml.

This means that when creating new, orphaned, stage-specific branches, we have always written blank metadata to the new branch.

The trouble with this approach is that Kargo proper (rather than Kargo Render) will, at times, be responsible for creation of stage-specific branches -- and when doing so, it doesn't (and shouldn't) particularly care about writing Kargo Render metadata into that new branch.

This PR changes some internal Kargo Render logic so that if we check out an existing branch that doesn't already appear to be managed via Kargo Render, we won't refuse to write to it as long as it's 100% empty. The corollary to this is that when Kargo Render creates new branches, it no longer needs to write blank metadata to them.

So, overall, this is actually quite a simplification.

Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Copy link

netlify bot commented Mar 25, 2024

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

Name Link
🔨 Latest commit fb2228d
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-render-akuity-io/deploys/660192589dcda20008e4324c
😎 Deploy Preview https://deploy-preview-266.bookkeeper.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.

@@ -17,7 +17,7 @@ easiest option for experimenting locally with Kargo Render!
Example usage:

```shell
docker run -it ghcr.io/akuity/kargo-render:v0.1.0-rc.36 \
docker run -it ghcr.io/akuity/kargo-render:v0.1.0-rc.37 \
Copy link
Member Author

Choose a reason for hiding this comment

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

I intend to cut this release immediately after this PR is merged.

Copy link

codecov bot commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 18.18182% with 27 lines in your changes are missing coverage. Please review.

Project coverage is 27.57%. Comparing base (bbd4546) to head (fb2228d).

Files Patch % Lines
service.go 0.00% 17 Missing ⚠️
branches.go 0.00% 6 Missing ⚠️
pkg/git/git.go 60.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #266      +/-   ##
==========================================
- Coverage   27.60%   27.57%   -0.04%     
==========================================
  Files          22       22              
  Lines        2079     2096      +17     
==========================================
+ Hits          574      578       +4     
- Misses       1428     1440      +12     
- Partials       77       78       +1     

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

@krancour krancour merged commit 89fd5f9 into akuity:main Mar 25, 2024
9 of 11 checks passed
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