refactor: extract job agents package out of controller package#951
refactor: extract job agents package out of controller package#951adityachoudhari26 merged 2 commits intomainfrom
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 17 minutes and 45 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 (12)
📝 WalkthroughWalkthroughImport paths for job agent packages are consolidated, moving from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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
This PR refactors the workspace-engine job dispatching “job agents” out of the svc/controllers/... tree into a reusable pkg/jobagents package, and updates controllers/tests to import the new package paths.
Changes:
- Moved job agent code under
apps/workspace-engine/pkg/jobagentsand updated controller imports accordingly. - Introduced a shared
pkg/jobagents/typescapability interface set (Dispatchable/Plannable/Verifiable + PlanResult). - Added/ported agent implementations and accompanying unit tests (ArgoCD, Argo Workflows, GitHub Actions, Terraform Cloud, TestRunner).
Reviewed changes
Copilot reviewed 13 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| apps/workspace-engine/svc/controllers/jobdispatch/setters.go | Updates jobdispatch controller imports to new pkg/jobagents/... paths. |
| apps/workspace-engine/svc/controllers/jobdispatch/getters_postgres.go | Switches jobagents import to pkg/jobagents. |
| apps/workspace-engine/svc/controllers/jobdispatch/controller.go | Wires controller to agents from pkg/jobagents/* instead of controller-local packages. |
| apps/workspace-engine/svc/controllers/deploymentplanresult/getters_postgres.go | Updates imports for jobagents and specific agents. |
| apps/workspace-engine/svc/controllers/deploymentplanresult/controller.go | Switches jobagents import to new package location. |
| apps/workspace-engine/svc/controllers/deploymentplanresult/controller_test.go | Updates test imports to new pkg/jobagents and pkg/jobagents/types. |
| apps/workspace-engine/pkg/jobagents/types/types.go | Adds shared agent capability interfaces and PlanResult. |
| apps/workspace-engine/pkg/jobagents/testrunner/testrunner.go | Updates types import to pkg/jobagents/types. |
| apps/workspace-engine/pkg/jobagents/testrunner/testrunner_test.go | Adds unit tests for TestRunner dispatch/plan behavior and concurrency. |
| apps/workspace-engine/pkg/jobagents/terraformcloud/workspace.go | Adds Terraform Cloud workspace templating/upsert + variable sync + webhook config helpers. |
| apps/workspace-engine/pkg/jobagents/terraformcloud/tfe.go | Updates types import to pkg/jobagents/types. |
| apps/workspace-engine/pkg/jobagents/terraformcloud/tfe_test.go | Adds unit tests for Terraform Cloud config parsing and option builders. |
| apps/workspace-engine/pkg/jobagents/terraformcloud/config.go | Adds Terraform Cloud agent config parsing + client creation helper. |
| apps/workspace-engine/pkg/jobagents/registry.go | Updates types import to pkg/jobagents/types. |
| apps/workspace-engine/pkg/jobagents/github/workflow_dispatcher.go | Adds GitHub App auth + workflow dispatch implementation. |
| apps/workspace-engine/pkg/jobagents/github/githubaction.go | Adds GitHub Actions job agent that dispatches workflows asynchronously. |
| apps/workspace-engine/pkg/jobagents/github/githubaction_test.go | Adds unit tests for GitHub agent dispatch + config parsing + concurrency. |
| apps/workspace-engine/pkg/jobagents/github/config.go | Adds GitHub agent config parsing helpers. |
| apps/workspace-engine/pkg/jobagents/argoworkflows/workflow.go | Updates types import to pkg/jobagents/types. |
| apps/workspace-engine/pkg/jobagents/argoworkflows/workflow_test.go | Updates import path for argoworkflows package. |
| apps/workspace-engine/pkg/jobagents/argoworkflows/workflow_submitter.go | Adds Argo Workflows submitter with retry + idempotency check. |
| apps/workspace-engine/pkg/jobagents/argo/argocd.go | Updates types import to pkg/jobagents/types. |
| apps/workspace-engine/pkg/jobagents/argo/argocd_verification.go | Adds ArgoCD verification metric spec builder. |
| apps/workspace-engine/pkg/jobagents/argo/argocd_plan.go | Updates types import to pkg/jobagents/types. |
| apps/workspace-engine/pkg/jobagents/argo/argoapp_test.go | Adds comprehensive ArgoCD agent tests including dispatch, verifications, and plan/diff. |
| apps/workspace-engine/pkg/jobagents/argo/application_upserter.go | Adds ArgoCD API upserter/deleter/manifest getter implementations with retry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Resolves #946
Summary by CodeRabbit