Skip to content

Conversation

@dshmelev
Copy link
Contributor

Hi folks 👋

This PR fixes an inconsistency in ProgressiveSync.

Currently, performProgressiveSyncs updates the application status via updateApplicationSetApplicationStatusProgress, and then calls setAppSetApplicationStatus. However, since performProgressiveSyncs receives applicationSetInfo by value, the updated status is not visible to syncValidApplications, which uses a different (stale) copy.

This leads to incorrect behavior where sync decisions are made based on outdated status information.

Fix: Change performProgressiveSyncs and syncValidApplications to accept *argov1alpha1.ApplicationSet so that they share the same state, and changes to application statuses are properly propagated.

Let me know what you think — happy to adjust if needed!

Issue: #22558
Discussion: https://cloud-native.slack.com/archives/C01U45M2SVB/p1746622854063139

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

@dshmelev dshmelev requested a review from a team as a code owner May 13, 2025 11:23
@bunnyshell
Copy link

bunnyshell bot commented May 13, 2025

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

… performProgressiveSyncs

Signed-off-by: Dmitry Shmelev <[email protected]>
@codecov
Copy link

codecov bot commented May 13, 2025

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.00%. Comparing base (610523b) to head (c5136a5).
⚠️ Report is 495 commits behind head on master.

Files with missing lines Patch % Lines
...cationset/controllers/applicationset_controller.go 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #22951      +/-   ##
==========================================
- Coverage   60.03%   60.00%   -0.04%     
==========================================
  Files         344      344              
  Lines       57781    57787       +6     
==========================================
- Hits        34689    34673      -16     
- Misses      20333    20350      +17     
- Partials     2759     2764       +5     

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

@rumstead
Copy link
Member

Can we add a unit test that demonstrates the change? Eg, before your changes, it shows that status is not persisted on the applicationset that is passed down, and afterwards it is.

@dshmelev
Copy link
Contributor Author

dshmelev commented May 16, 2025

Can we add a unit test that demonstrates the change? Eg, before your changes, it shows that status is not persisted on the applicationset that is passed down, and afterwards it is.

@rumstead Let's clarify first. What should we do when the ApplicationStatus changes from Waiting to Pending?
Do we want to trigger the Sync in the same Reconcile loop, or start a new one by ApplicationStatus changes?

Upd: This is the second solution: dshmelev@83e1c4a

@rumstead
Copy link
Member

Can we add a unit test that demonstrates the change? Eg, before your changes, it shows that status is not persisted on the applicationset that is passed down, and afterwards it is.

@rumstead Let's clarify first. What should we do when the ApplicationStatus changes from Waiting to Pending? Do we want to trigger the Sync in the same Reconcile loop, or start a new one by ApplicationStatus changes?

Upd: This is the second solution: dshmelev@83e1c4a

Should we handle it the same way that we do for applications? Add a condition for when progressive syncs are enabled?

@dshmelev
Copy link
Contributor Author

@rumstead Hi,
new PR is ready: #23043
Thank you

@dshmelev dshmelev closed this May 19, 2025
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