Skip to content

Conversation

dlemfh
Copy link
Contributor

@dlemfh dlemfh commented May 22, 2025

Solution to half of #22898, submitting as guided by @agaudreault, thanks!! 🤗

Description

This PR sets ?validate=false for the PUT application request that is made when user clicks rollback in UI.

When validate is true (the default), a full rebuild of kustomize build may be triggered because of cache invalidation.

Since the intention of the PUT application request is just to switch off auto-sync, there is no need to re-validate the app spec and trigger a kustomize build.

This behavior is consistent with the fact that the frontend already adds ?validate=false to PUT requests triggered via the ENABLE AUTO-SYNC and DISABLE AUTO-SYNC buttons in the application details UI:

await updateApp(updatedApp, {validate: false});

Testing

We've been using this cherry picked build in production, and can confirm works well as intended!

Please let me know if you prefer some test code be accompanied as well.


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).

…st during rollback via ui

Signed-off-by: 이드로 (Jethro Lee) <dlemfh96@gmail.com>
@dlemfh dlemfh requested a review from a team as a code owner May 22, 2025 13:58
Copy link

bunnyshell bot commented May 22, 2025

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

@@ -1205,7 +1205,7 @@ Are you sure you want to disable auto-sync and rollback application '${this.prop
if (needDisableRollback) {
const update = JSON.parse(JSON.stringify(application)) as appModels.Application;
update.spec.syncPolicy.automated = null;
await services.applications.update(update);
await services.applications.update(update, {validate: false});
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding a comment explaining why skipping validation is desired here.

@agaudreault agaudreault merged commit eb794b7 into argoproj:master Jun 4, 2025
27 checks passed
@dlemfh dlemfh deleted the improve-rollback branch June 10, 2025 01:29
dsuhinin pushed a commit to dsuhinin/argo-cd that referenced this pull request Jun 16, 2025
…llback via ui (argoproj#22898) (argoproj#23101)

Signed-off-by: 이드로 (Jethro Lee) <dlemfh96@gmail.com>
Signed-off-by: dsuhinin <suhinin.dmitriy@gmail.com>
dsuhinin pushed a commit to dsuhinin/argo-cd that referenced this pull request Jun 16, 2025
…llback via ui (argoproj#22898) (argoproj#23101)

Signed-off-by: 이드로 (Jethro Lee) <dlemfh96@gmail.com>
Signed-off-by: dsuhinin <suhinin.dmitriy@gmail.com>
enneitex pushed a commit to enneitex/argo-cd that referenced this pull request Aug 24, 2025
…llback via ui (argoproj#22898) (argoproj#23101)

Signed-off-by: 이드로 (Jethro Lee) <dlemfh96@gmail.com>
Signed-off-by: enneitex <etienne.divet@gmail.com>
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.

3 participants