Skip to content

feat: syncing to a different revision requires override privilege#22858

Merged
agaudreault merged 24 commits intoargoproj:masterfrom
schraax:fix/diverging-revision-treated-as-override2
Oct 7, 2025
Merged

feat: syncing to a different revision requires override privilege#22858
agaudreault merged 24 commits intoargoproj:masterfrom
schraax:fix/diverging-revision-treated-as-override2

Conversation

@schraax
Copy link
Contributor

@schraax schraax commented May 3, 2025

Currently, it is possible to sync an application to any commit disregarding the revision definied in the application. Similar to syncing to arbitrary local manifests, this should be considered as 'override', because it is a deviation from gitops principle.

Reasoning:
ArgoCD and GitOps offer a way to compare application state against a 'desired' state. The desired state is defined in the Application object. The application object can be protected against editing via RBAC, but this protection is rendered useless by the possibility to sync to any revision.

Fixes: #21696,#22857

This is implemented with a toggle, so it will nnot break any existing behavior.
Hint: Once the feature is toggle on, users wanting to sync to different revisions need to be granted 'override' rights on the application.

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 Toolchain Guide
  • 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).

Currenttly, it is possible to sync an application to any commit disregarding the revision definied in the application. Similar to syncing to local manifests, this should be considered as 'override'.

Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
@schraax schraax requested review from a team as code owners May 3, 2025 21:20
@bunnyshell
Copy link

bunnyshell bot commented May 3, 2025

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
@codecov
Copy link

codecov bot commented May 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.81%. Comparing base (7430650) to head (e01aa9c).
⚠️ Report is 365 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #22858      +/-   ##
==========================================
+ Coverage   60.71%   60.81%   +0.09%     
==========================================
  Files         350      350              
  Lines       60392    60430      +38     
==========================================
+ Hits        36669    36749      +80     
+ Misses      20797    20766      -31     
+ Partials     2926     2915      -11     

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

schraax added 3 commits May 4, 2025 11:49
…erage

Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
@pjiang-dev
Copy link
Contributor

Few typos, but LGTM

Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
Copy link
Member

@blakepettersson blakepettersson left a comment

Choose a reason for hiding this comment

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

I think this generally LGTM at a glance, but would need to take a deeper look at the change itself when I have some more time.

schraax added 3 commits May 18, 2025 21:05
Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
@schraax schraax force-pushed the fix/diverging-revision-treated-as-override2 branch from 4ae4258 to e11c57a Compare May 19, 2025 19:48
@niclaslock
Copy link

niclaslock commented Jun 3, 2025

We also require this feature.
@blakepettersson any chance this will be released soon?

@agaudreault agaudreault added this to the v3.2 milestone Jun 17, 2025
@schraax schraax requested a review from agaudreault June 17, 2025 20:27
schraax added 2 commits July 3, 2025 21:55
Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
@schraax
Copy link
Contributor Author

schraax commented Jul 3, 2025

pretty please, can we get this reviewed and merged. I will gladly adapt to any recommendations, but I think we should really implement this change soon, as the current behavior is contrary to gitops...

Copy link
Contributor

@ppapapetrou76 ppapapetrou76 left a comment

Choose a reason for hiding this comment

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

Overall LGTM but there are few things we need to consider IMHO

schraax added 4 commits July 10, 2025 19:15
split into multiple tests, as recommended.
add error case unparseable value

Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
@schraax schraax force-pushed the fix/diverging-revision-treated-as-override2 branch from 361ee7d to 567bb8b Compare July 12, 2025 20:33
schraax added 2 commits July 12, 2025 22:42
Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
@schraax schraax changed the title fix: syncing to a different revision should be considered override, rework fix: syncing to a different revision should require override privilege Jul 13, 2025
@schraax
Copy link
Contributor Author

schraax commented Jul 13, 2025

i have renamed the flag, in order to make the intent clearer.

Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
@blakepettersson
Copy link
Member

@schraax I think this LGTM, but you'd need to fix the conflicts

Signed-off-by: Andreas Schramm <andreas.jabs@gmail.com>
@schraax
Copy link
Contributor Author

schraax commented Sep 27, 2025

ok, i have removed the conflict. I have fulfilled any and all requests, and will continue to do so, but please, lets get this merged.

@schraax schraax requested a review from a team as a code owner October 3, 2025 15:50
@schraax
Copy link
Contributor Author

schraax commented Oct 3, 2025

@agaudreault , @blakepettersson : please, lets get this merged with 3.2.
it fixes 2 bugs, which break our usecase (separating sync and edit roles).
@agaudreault: from your requested changes i have deduced that the intention was not clear.
I have since renamed the flag, and added documentation to make clear the default behaviour is exactly like you suggested.

Copy link
Member

@agaudreault agaudreault left a comment

Choose a reason for hiding this comment

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

small nitpicks, but LGTM.

@agaudreault agaudreault added the for-release-blog-3-3 PR that should be highlighted in the Release Blog label Oct 6, 2025
@agaudreault agaudreault changed the title fix: syncing to a different revision should require override privilege feat: syncing to a different revision requires override privilege Oct 6, 2025
@agaudreault agaudreault merged commit 026d10e into argoproj:master Oct 7, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

for-release-blog-3-3 PR that should be highlighted in the Release Blog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to restrict sync settings further

6 participants