Skip to content

Conversation

BadLiveware
Copy link

@BadLiveware BadLiveware commented Sep 18, 2025

This adds build environment metadata for how the targetRevision was resolved, e.g. was it a range, and if so what was the original targetRevision, what was the resolved tag.
This is useful for targeting a tag range, e.g. v*, and passing the resolved tag into the chart as a parameter to override image tags.

Also makes change detection take build metadata into account, if it is referenced, when deciding on whether to sync or not. This is necessary to cause a sync if the underlying revision(e.g. git commit SHA from a tag range v*) is the same while the intermediate resolved revision does change, e.g. a new tag(v1.0.1) is pushed to point to the same commit as the previous(v1.0.0).

Closes #20768

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Title of the PR
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

Copy link

bunnyshell bot commented Sep 18, 2025

🔴 Preview Environment stopped on Bunnyshell

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔵 /bns:start to start the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

@BadLiveware BadLiveware force-pushed the master branch 4 times, most recently from 090a8d5 to d5b99ab Compare September 18, 2025 21:58
Copy link

codecov bot commented Sep 19, 2025

Codecov Report

❌ Patch coverage is 69.10828% with 97 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@74a3275). Learn more about missing BASE report.

Files with missing lines Patch % Lines
reposerver/repository/repository.go 59.36% 72 Missing and 17 partials ⚠️
util/git/client.go 89.65% 2 Missing and 1 partial ⚠️
util/oci/client.go 86.95% 2 Missing and 1 partial ⚠️
cmd/argocd/commands/app.go 0.00% 1 Missing ⚠️
util/versions/tags.go 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #24634   +/-   ##
=========================================
  Coverage          ?   60.73%           
=========================================
  Files             ?      405           
  Lines             ?    66316           
  Branches          ?        0           
=========================================
  Hits              ?    40276           
  Misses            ?    22774           
  Partials          ?     3266           

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

@BadLiveware BadLiveware force-pushed the master branch 9 times, most recently from cf0d4ae to 4197551 Compare September 24, 2025 18:21
- Introduced `Test_newEnv_RevisionMetadata_AllResolutionTypes` to validate various resolution types and their corresponding environment variables.
- Added `Test_newEnv_RevisionMetadata_EmptyAndNil` to ensure correct behavior when metadata is nil or empty.
- Enhanced existing tests to verify the presence and correctness of environment variables based on revision metadata.

Signed-off-by: Fredrik Larsson <[email protected]>
- Introduced `buildMetadataHasChanged` method to determine if build metadata environment variables have changed between revisions, ensuring refreshes are only triggered when necessary.
- Added `appParametersWouldChange` method to check for differences in application source parameters during environment substitution.
- Updated the revision update logic to incorporate checks for build metadata changes alongside file changes, improving the efficiency of the refresh process.

Signed-off-by: Fredrik Larsson <[email protected]>
Signed-off-by: Fredrik Larsson <[email protected]>
Signed-off-by: Fredrik Larsson <[email protected]>
Signed-off-by: Fredrik Larsson <[email protected]>
Signed-off-by: Fredrik Larsson <[email protected]>
Signed-off-by: Fredrik Larsson <[email protected]>
Signed-off-by: Fredrik Larsson <[email protected]>
Signed-off-by: Fredrik Larsson <[email protected]>
Signed-off-by: Fredrik Larsson <[email protected]>
Signed-off-by: Fredrik Larsson <[email protected]>
Signed-off-by: Fredrik Larsson <[email protected]>
@BadLiveware BadLiveware force-pushed the master branch 3 times, most recently from ae853d6 to 40bf961 Compare September 24, 2025 22:40
Signed-off-by: Fredrik Larsson <[email protected]>
@BadLiveware BadLiveware marked this pull request as ready for review September 25, 2025 07:41
@BadLiveware BadLiveware requested review from a team as code owners September 25, 2025 07:41
@BadLiveware
Copy link
Author

One test (different every time) in one pipelines, either unit test with -race or one of the e2e pipelines, seems to fail randomly. I dont know if this is common or if it is related to this. If someone familiar with the pipelines can tell me if the tests are somewhat flaky or I need to debug more would be appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build environment variable for the resolved target revision
1 participant