tektoncd / tektoncd/pipelines-as-code

`auto-configure` setting does not create a namespace and Repository CRD

Open
#1,152 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug priority/low
Dominant language
Go
Stars
214
Forks
144
Avg merge
2d 11h
Merged PRs (30d)
27

Description

Hi, folks!

I set the value for auto-configure-new-github-repo to True

apiVersion: v1
data:
  application-name: Pipelines as Code CI
  auto-configure-new-github-repo: "true"
  auto-configure-repo-namespace-template: "{{repo_name}}-pipeline"
  bitbucket-cloud-additional-source-ip: ""
  bitbucket-cloud-check-source-ip: "true"
  default-max-keep-runs: ""
  error-detection-from-container-logs: "false"
  error-detection-max-number-of-lines: "50"
  error-detection-simple-regexp: |
    ^(?P<filename>[^:]*):(?P<line>[0-9]+):(?P<column>[0-9]+):([ ]*)?(?P<error>.*)
  error-log-snippet: "true"
  hub-catalog-name: tekton
  hub-url: https://api.hub.tekton.dev/v1
  max-keep-run-upper-limit: ""
  remote-tasks: "true"
  secret-auto-create: "true"
  secret-github-app-scope-extra-repos: "Stringls/artie"
  secret-github-app-token-scoped: "true"
  tekton-dashboard-url: ""
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/part-of: pipelines-as-code
    app.kubernetes.io/version: v0.15.5
  name: pipelines-as-code
  namespace: pipelines-as-code

But when I try to add a new repository to my CI workflow it fails because of no namespace created

cannot find a namespace match for https://github.com/Stringls/test-repo

Logs of the controller

{"level":"info","ts":1676371985.5279555,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676371985.5282037,"caller":"settings/config.go:150","msg":"CONFIG: auto configure repo namespace template set to {{repo_name}}-pipelines"}
{"level":"info","ts":1676371985.5285232,"caller":"settings/config.go:150","msg":"CONFIG: auto configure repo namespace template set to {{repo_name}}-pipelines"}
{"level":"info","ts":1676371985.5287163,"caller":"settings/config.go:150","msg":"CONFIG: auto configure repo namespace template set to {{repo_name}}-pipelines"}
{"level":"info","ts":1676371985.5289354,"caller":"settings/config.go:150","msg":"CONFIG: auto configure repo namespace template set to {{repo_name}}-pipelines"}
{"level":"info","ts":1676371985.5291998,"caller":"settings/config.go:150","msg":"CONFIG: auto configure repo namespace template set to {{repo_name}}-pipelines"}
{"level":"info","ts":1676371985.5294359,"caller":"settings/config.go:150","msg":"CONFIG: auto configure repo namespace template set to {{repo_name}}-pipelines"}
{"level":"info","ts":1676371985.5296552,"caller":"settings/config.go:150","msg":"CONFIG: auto configure repo namespace template set to {{repo_name}}-pipelines"}
{"level":"info","ts":1676371998.6787953,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"severity":"INFO","timestamp":"2023-02-14T10:53:18.840178376Z","logger":"pipelinesascode","caller":"github/parse_payload.go:323","message":"issue_comment: pipelinerun recheck on Stringls/test-repo#1 has been requested","commit":"6134468","provider":"github","event-id":"c9dac9f0-ac55-11ed-9511-8b0f26e8d8a9"}
{"severity":"WARNING","timestamp":"2023-02-14T10:53:19.822759568Z","logger":"pipelinesascode","caller":"events/emit.go:49","message":"cannot find a namespace match for https://github.com/Stringls/test-repo","commit":"6134468","provider":"github","event-id":"c9dac9f0-ac55-11ed-9511-8b0f26e8d8a9","event-sha":"11d4a0861e3ee870e41f6b98728fc1e547f7f489","event-type":"pull_request"}
{"level":"info","ts":1676372328.199323,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"severity":"INFO","timestamp":"2023-02-14T10:58:48.407716956Z","logger":"pipelinesascode","caller":"github/parse_payload.go:323","message":"issue_comment: pipelinerun recheck on Stringls/test-repo#1 has been requested","commit":"6134468","provider":"github","event-id":"8e51e4d0-ac56-11ed-9549-b8bebda641c4"}
{"severity":"WARNING","timestamp":"2023-02-14T10:58:49.610422466Z","logger":"pipelinesascode","caller":"events/emit.go:49","message":"cannot find a namespace match for https://github.com/Stringls/test-repo","commit":"6134468","provider":"github","event-id":"8e51e4d0-ac56-11ed-9549-b8bebda641c4","event-sha":"11d4a0861e3ee870e41f6b98728fc1e547f7f489","event-type":"pull_request"}
{"level":"info","ts":1676372393.743666,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7437074,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7442343,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7466435,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7474515,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7479708,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7482412,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7484522,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7487464,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7489028,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7494297,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7494602,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7498295,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7499232,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.750522,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.750867,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7513514,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.751612,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7517872,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.750968,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7522094,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.752581,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7528944,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"level":"info","ts":1676372393.7548778,"caller":"settings/config.go:150","msg":"CONFIG: auto configure repo namespace template set to {{repo_name}}-pipeline"}
{"level":"info","ts":1676372399.0063024,"caller":"params/run.go:67","msg":"added or modifies events are coming"}
{"severity":"INFO","timestamp":"2023-02-14T10:59:59.187973535Z","logger":"pipelinesascode","caller":"github/parse_payload.go:323","message":"issue_comment: pipelinerun recheck on Stringls/test-repo#1 has been requested","commit":"6134468","provider":"github","event-id":"b8893c80-ac56-11ed-8403-2c5418ce102a"}
{"severity":"WARNING","timestamp":"2023-02-14T11:00:00.232242023Z","logger":"pipelinesascode","caller":"events/emit.go:49","message":"cannot find a namespace match for https://github.com/Stringls/test-repo","commit":"6134468","provider":"github","event-id":"b8893c80-ac56-11ed-8403-2c5418ce102a","event-sha":"11d4a0861e3ee870e41f6b98728fc1e547f7f489","event-type":"pull_request"}

What I am doing wrong?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the repository-event flow from github/parse_payload.go through events/emit.go, and inspect the configuration handling in settings/config.go; params/run.go shows the repeated event messages. Reproduce the pull request case with auto-configure enabled and verify that the repository receives a matching namespace and Repository CRD instead of the namespace-match warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, go, kubernetes
Domain
backend, ci-cd, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.