Skip to content

Conversation

@zachaller
Copy link
Contributor

@zachaller zachaller commented Dec 1, 2025

Remove No-Op Commit Handling from Promoter

Summary

This PR removes no-op commit handling from the promoter, delegating duplicate detection to the hydrator.

Why

The hydrator is the right place to detect duplicates because it's the system that knows the contents of what's being promoted.

The promoter only sees commit SHAs and metadata - it doesn't know what's inside the manifests. The hydrator, on the other hand:

  • Renders the manifests (helm template, kustomize build, etc.)
  • Knows what's currently on the staging branch
  • Can compare the two and decide whether a new commit is needed

By handling this at the hydrator level, we avoid creating unnecessary commits in the first place, rather than having the promoter detect and work around them after the fact.

Changes

  • Removed IsPullRequestRequired() and PromoteEnvironmentWithMerge() from git operations
  • Removed TrailerNoOp constant and related handling
  • Simplified PR creation logic
  • Added docs/custom-hydrator.md documenting the hydrator contract and git notes for duplicate detection

Depends on:

argoproj/argo-cd#25056

@codecov-commenter
Copy link

Bundle Report

Bundle size has no change ✅

Signed-off-by: Zach Aller <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Dec 2, 2025

Codecov Report

❌ Patch coverage is 80.30303% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.17%. Comparing base (58e6406) to head (bbe5312).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/git/git.go 65.62% 8 Missing and 3 partials ⚠️
...rnal/controller/changetransferpolicy_controller.go 77.77% 3 Missing and 3 partials ⚠️
...nternal/controller/timedcommitstatus_controller.go 0.00% 5 Missing ⚠️
...nternal/controller/promotionstrategy_controller.go 93.22% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #746      +/-   ##
==========================================
+ Coverage   56.19%   57.17%   +0.98%     
==========================================
  Files          37       36       -1     
  Lines        4004     4012       +8     
==========================================
+ Hits         2250     2294      +44     
+ Misses       1459     1442      -17     
+ Partials      295      276      -19     

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

Signed-off-by: Zach Aller <[email protected]>
@zachaller zachaller marked this pull request as ready for review December 2, 2025 00:57
@zachaller zachaller marked this pull request as draft December 2, 2025 14:55
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
@zachaller zachaller marked this pull request as ready for review December 4, 2025 00:58
Signed-off-by: Zach Aller <[email protected]>
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.

2 participants