akuity / kargo-render

Tool and library for managing rendered, environment-specific branches
Apache License 2.0
42 stars 17 forks source link

fix: preserve files correctly when rendering to a local directory #268

Closed krancour closed 6 months ago

krancour commented 6 months ago

When we write to a stage-specific branch, we gut its existing contents entirely and render into the empty directory. The long-time exception to that has been that we do not delete any files or directories explicitly named in the Kargo Render config as preservedPaths.

Only if writing to a local directory instead of a remote branch, all files that were meant to be preserved are going missing. The reason is that we have been rendering into a brand new, empty directory, when really, we should have been copying whatever was to be preserved from the target branch.

Note that since I worked on a new test case that involved a temporary directory, I have also taken the liberty of fixing a few outstanding temp directory-related nits.

netlify[bot] commented 6 months ago

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

Name Link
Latest commit b70c46a32c0b7875206586e71b5cf4096e872bf9
Latest deploy log https://app.netlify.com/sites/docs-kargo-render-akuity-io/deploys/6601cefa450f040007138c1c
Deploy Preview https://deploy-preview-268.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.

codecov[bot] commented 6 months ago

Codecov Report

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

Project coverage is 27.72%. Comparing base (89fd5f9) to head (b70c46a).

Files Patch % Lines
branches.go 62.50% 2 Missing and 1 partial :warning:
service.go 0.00% 2 Missing :warning:
rendering.go 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #268 +/- ## ========================================== + Coverage 27.57% 27.72% +0.14% ========================================== Files 22 22 Lines 2096 2103 +7 ========================================== + Hits 578 583 +5 - Misses 1440 1441 +1 - Partials 78 79 +1 ```

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