fix(argocd): add CICD DomainTypes to application collect/extract subtasks - #9080
Open
sanscfs wants to merge 1 commit into
Open
fix(argocd): add CICD DomainTypes to application collect/extract subtasks#9080sanscfs wants to merge 1 commit into
sanscfs wants to merge 1 commit into
Conversation
…asks collectApplications and extractApplications had no DomainTypes, while the convertApplications / *SyncOperations subtasks carry DomainTypes [CICD]. Blueprint plan generation (MakePipelinePlanSubtasks) only includes a subtask whose DomainTypes intersect the scope config's entities (typically ["CICD"]). With no DomainTypes, the application subtasks were never generated into the blueprint plan, so _tool_argocd_applications.dest_namespace was never populated and detectEnvironment() classified every ArgoCD deployment as TESTING instead of PRODUCTION. Add DomainTypes: [CICD] so the application collect/extract subtasks are generated alongside the sync-operation ones, letting dest_namespace populate natively. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In the ArgoCD plugin,
collectApplicationsandextractApplicationshave noDomainTypes, whereasconvertApplicationsand the*SyncOperationssubtaskscarry
DomainTypes: [CICD].Blueprint plan generation (
MakePipelinePlanSubtasksinbackend/helpers/pluginhelper/api/pipeline_plan.go) only includes a subtaskwhose
DomainTypesintersect the scope config'sentities(typically["CICD"]). With noDomainTypes, the application collect/extract subtasks arenever generated into the blueprint plan, so
_tool_argocd_applications.dest_namespaceis never populated.detectEnvironment()(insync_operation_convertor.go) only emitsPRODUCTIONwhen theproduction_pattern/env_name_patternmatches theapplication name, namespace, or
DestNamespace. BecauseDestNamespacestaysempty, every ArgoCD deployment falls back to
TESTING— which empties theproduction-only DORA boards.
Fix
Add
DomainTypes: []string{plugin.DOMAIN_TYPE_CICD}to thecollectApplicationsandextractApplicationssubtask metadata so they aregenerated into the blueprint plan alongside the sync-operation subtasks.
dest_namespacethen populates natively anddetectEnvironment()emitsPRODUCTIONwithout any out-of-band workaround.Verification
go build ./plugins/argocd/...succeeds.gofmtclean on both files.EnabledByDefault; only the missingDomainTypesfield was preventing their inclusion.Note: existing deployments already classified as
TESTINGwill be corrected onthe next blueprint run once the plugin is rebuilt with this change.