{"record":{"id":"1f8ff3d45417fb4e","repo":"argoproj/argo-workflows","slug":"key-unsupported-cannot-set-key-on-git-artifact","errorCode":null,"errorMessage":"key unsupported: cannot set key on git artifact","messagePattern":"key unsupported: cannot set key on git artifact","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/apis/workflow/v1alpha1/workflow_types.go","lineNumber":2988,"sourceCode":"\tSingleBranch bool `json:\"singleBranch,omitempty\" protobuf:\"varint,10,opt,name=singleBranch\"`\n\n\t// Branch is the branch to fetch when `SingleBranch` is enabled\n\tBranch string `json:\"branch,omitempty\" protobuf:\"bytes,11,opt,name=branch\"`\n\n\t// InsecureSkipTLS disables server certificate verification resulting in insecure HTTPS connections\n\tInsecureSkipTLS bool `json:\"insecureSkipTLS,omitempty\" protobuf:\"varint,12,opt,name=insecureSkipTLS\"`\n}\n\nfunc (g *GitArtifact) HasLocation() bool {\n\treturn g != nil && g.Repo != \"\"\n}\n\nfunc (g *GitArtifact) GetKey() (string, error) {\n\treturn \"\", fmt.Errorf(\"key unsupported: git artifact does not have a key\")\n}\n\nfunc (g *GitArtifact) SetKey(string) error {\n\treturn fmt.Errorf(\"key unsupported: cannot set key on git artifact\")\n}\n\nfunc (g *GitArtifact) GetDepth() int {\n\tif g == nil || g.Depth == nil {\n\t\treturn 0\n\t}\n\treturn int(*g.Depth)\n}\n\n// ArtifactoryAuth describes the secret selectors required for authenticating to artifactory\ntype ArtifactoryAuth struct {\n\t// UsernameSecret is the secret selector to the repository username\n\tUsernameSecret *apiv1.SecretKeySelector `json:\"usernameSecret,omitempty\" protobuf:\"bytes,1,opt,name=usernameSecret\"`\n\n\t// PasswordSecret is the secret selector to the repository password\n\tPasswordSecret *apiv1.SecretKeySelector `json:\"passwordSecret,omitempty\" protobuf:\"bytes,2,opt,name=passwordSecret\"`\n}\n","sourceCodeStart":2970,"sourceCodeEnd":3006,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/pkg/apis/workflow/v1alpha1/workflow_types.go#L2970-L3006","documentation":"Returned when validating a git artifact whose spec sets a key field. GitArtifact has no key concept, so declaring one is a spec error — distinct from GetKey, this fires when the user supplied a key in the workflow spec.","triggerScenarios":"Thrown at pkg/apis/workflow/v1alpha1/workflow_types.go:2988 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the key field from the git artifact in the spec"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}