-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
8
-
False
-
None
-
True
-
-
-
(temp)Backlog from 260 and 259, Pipelines Sprint Crookshank 10, Pipelines Sprint Crookshank 11, Pipelines Sprint Crookshank 12
Description of problem:
e.g. concurrency_limit = 2 is set and repo has 6 PRs, only 5 PRs are getting done and one PR is left into Pending state and getting this error message in logs
failed to update pipelineRun to in_progress: cannot get secret from repository: an empty namespace may not be set when a resource name is provided
because reconciler.secretNS has empty value before queue_pipelinerun is called.
Note: I've seen this issue in gitea E2E test only.
Prerequisites:
1) You have pipelines-as-code repository cloned locally
2) You have deployed PAC locally. if not then run `make dev` make command in pipelines-as-code directory.
3) you have setup E2E testing of PAC using gitea if not then see docs.
Steps to reproduce:
1) Create global repository using below config:
apiVersion: pipelinesascode.tekton.dev/v1alpha1
kind: Repository
metadata:
name: pipelines-as-code
namespace: pipelines-as-code
spec:
concurrency_limit: 2
params:
- name: custom
value: "value"
2) add below test func in gitea_test.go file locally:
func TestGiteaGlobalRepoConcurrencyLimit(t *testing.T) { numPipelines := 6 yamlFiles := map[string]string{} for i := 0; i < numPipelines; i++ { yamlFiles[fmt.Sprintf(".tekton/pr%d.yaml", i)] = "testdata/pipelinerun.yaml" } topts := &tgitea.TestOpts{ TargetEvent: triggertype.PullRequest.String(), YAMLFiles: yamlFiles, CheckForNumberStatus: numPipelines, CheckForStatus: "success", } _, f := tgitea.TestPR(t, topts) defer f() }
3) run the test using below command:
go test -tags=e2e ./test/ -v -run ^TestGiteaGlobalRepoConcurrencyLimit$
as concurrency_limit is 2 in global repository, you will see that only five pipelineruns succeeding and one is being remained in queued state.