fix: default argocd verification hits application specific endpoint for health check#987
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 9 minutes and 38 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Updates ArgoCD agent verification generation so the default health check targets a specific application endpoint (instead of the applications collection endpoint), using the job’s dispatch context to derive the application name.
Changes:
- Extend the agent verification interfaces (
AgentVerifier,types.Verifiable) to acceptdispatchCtx. - Update jobdispatch reconciliation flow to pass
job.DispatchContextinto agent verification resolution. - Update ArgoCD verification builder and tests to render the application template and hit
/api/v1/applications/{appName}.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/workspace-engine/svc/controllers/jobdispatch/reconcile_test.go | Updates mock verifier signature to accept dispatch context. |
| apps/workspace-engine/svc/controllers/jobdispatch/reconcile.go | Passes dispatch context into AgentVerifications call. |
| apps/workspace-engine/svc/controllers/jobdispatch/dispatcher.go | Updates AgentVerifier interface to include dispatchCtx. |
| apps/workspace-engine/pkg/jobagents/types/types.go | Updates types.Verifiable interface to include dispatchCtx. |
| apps/workspace-engine/pkg/jobagents/registry.go | Forwards dispatch context into Verifications(...). |
| apps/workspace-engine/pkg/jobagents/argo/argocd_verification.go | Renders app template to compute app name; uses application-specific ArgoCD endpoint for health checks. |
| apps/workspace-engine/pkg/jobagents/argo/argoapp_test.go | Updates verification tests to use new signature and dispatch context-derived config. |
Comments suppressed due to low confidence (1)
apps/workspace-engine/pkg/jobagents/argo/argoapp_test.go:288
- This test doesn’t assert the new behavior introduced by the PR: that the verification uses the application-specific ArgoCD endpoint. Add an assertion against the generated HTTP metric provider URL (e.g., extract
specs[0].Provideras anHTTPMetricProviderand verify it contains/api/v1/applications/test-app).
specs, err := a.Verifications(config, job.DispatchContext)
require.NoError(t, err)
require.Len(t, specs, 1)
assert.Equal(t, "argocd-application-health", specs[0].Name)
assert.Equal(t, int32(60), specs[0].IntervalSeconds)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Aditya Choudhari <48932219+adityachoudhari26@users.noreply.github.com>
fixes #986