feat(appset): add Refresh RPC and UI action (#27798)#27932
Conversation
Expose ApplicationSet refresh via POST /api/v1/applicationsets/{name}/refresh
which patches argocd.argoproj.io/application-set-refresh. Adds Refresh
actions to AppSet list tile, table row, detail toolbar, and resource panel.
Signed-off-by: Asif Draxi <asifdraxi@gmail.com>
🔴 Preview Environment stopped on BunnyshellSee: Environment Details | Pipeline Logs Available commands (reply to this comment):
|
Pass refreshApplicationSet through ApplicationTiles and ApplicationsTable so TypeScript lint passes when AppSets appear on /applications. Signed-off-by: Asif Draxi <asifdraxi@gmail.com>
Empty commit to re-run flaky race unit test job. Signed-off-by: Asif Draxi <asifdraxi@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #27932 +/- ##
=========================================
Coverage ? 64.40%
=========================================
Files ? 422
Lines ? 57859
Branches ? 0
=========================================
Hits ? 37262
Misses ? 17093
Partials ? 3504 ☔ View full report in Codecov by Sentry. |
nitishfy
left a comment
There was a problem hiding this comment.
can you share the screenshot of the UI?
|
/bns:deploy |
|
Thanks for the review @nitishfy — UI screenshots from local testing on this branch ( ApplicationSets list — tiles view (Refresh on tile) ApplicationSets list — table view (Refresh action) ApplicationSet details — toolbar Refresh ApplicationSet details — action menu (Refresh visible in toolbar) Refresh triggers |
d9f76a0 to
fc514e8
Compare
ppapapetrou76
left a comment
There was a problem hiding this comment.
Can you please add a test for the retry mechanism and the waitSync after refresh?
Add conflict-retry, exhausted-retry, waitSync, and post-refresh waitSync tests requested in argoproj#27932 review feedback.
|
Addressed review feedback in 5629819: Tests added (
All new tests pass locally ( Re @ppapapetrou76's backoff suggestion on the retry loop — kept the existing fixed-interval retry for now since it matches the Application refresh pattern; happy to revisit if you'd prefer exponential backoff. |
Add conflict-retry, exhausted-retry, waitSync, and post-refresh waitSync tests requested in argoproj#27932 review feedback. Signed-off-by: Asif Draxi <asifdraxi@gmail.com>
Align server refreshAppSet with webhook.refreshApplicationSet by using retry.RetryOnConflict(retry.DefaultBackoff) instead of a tight 10-attempt loop. Adjust exhausted-retry test for the new error shape. Signed-off-by: Asif Draxi <asifdraxi@gmail.com>
5629819 to
22b937f
Compare
|
Follow-up in Backoff (review feedback): DCO: Added missing Tests pass locally for the refresh/waitSync suite. |
|
Follow-up on review feedback — all addressed and the open thread is resolved:
@ppapapetrou76 @nitishfy — ready for another look when you have a moment. Thanks! |
ppapapetrou76
left a comment
There was a problem hiding this comment.
I'm not a UI expert so this PR needs a review from someone more familiar than I am
| func (s *Server) Refresh(ctx context.Context, q *applicationset.ApplicationSetGetQuery) (*v1alpha1.ApplicationSet, error) { | ||
| namespace := s.appsetNamespaceOrDefault(q.AppsetNamespace) | ||
|
|
||
| appset, err := s.getAppSetEnforceRBAC(ctx, rbac.ActionUpdate, namespace, q.Name) |
There was a problem hiding this comment.
The analogous Application hard-refresh uses rbac.ActionGet. Using ActionUpdate for a refresh-only action means read-only users or operators with get/sync privileges but not update will be blocked from triggering a refresh — which seems unintentional.
| return updated, nil | ||
| } | ||
|
|
||
| func (s *Server) refreshAppSet(ctx context.Context, appset *v1alpha1.ApplicationSet) (*v1alpha1.ApplicationSet, error) { |
There was a problem hiding this comment.
i believe there is already a refreshApplicationSet() inside webhook.go that uses RetryOnConflict as well
Could we re-use that one instead of re-implementing it here?
Maybe we can extract a shared helper method for each caller




Summary
Fixes #27798.
RefreshRPC on ApplicationSet service (POST /api/v1/applicationsets/{name}/refresh)argocd.argoproj.io/application-set-refresh: "true"(controller already handles this)appsetNamespacefor namespaced ApplicationSetsTest plan
go test ./server/applicationset/...— includesTestRefreshAppSet(default ns, named ns, forbidden ns, not found)cd ui && pnpm test— 165 tests pass (incl. ApplicationSet refresh helpers)make start-local→ Git-directory AppSet → Refresh from UI → verify annotation + reconcile (maintainer QA)