Uploaded image for project: 'OpenShift Pipelines'
  1. OpenShift Pipelines
  2. SRVKP-6847

Openshift Pipelines Operator - PipelinesAsCode Dynamic Variables are not resolved anymore after Upgrade to 1.15.x

XMLWordPrintable

    • Pipelines Sprint Crookshank 22

      #Issue :

      Customer is facing issues with the PAC, After upgrading to Red Hat OpenShift Pipelines Operator to v1.15.2, GitLab webhook stopped working.

      As checked, We found pipelines-as-code-controller pod was throwing below error message and was not able to resolve the variable repo_url.

      2024-11-19T17:04:49.672252478Z {"level":"info","ts":1732035889.6721857,"caller":"configutil/config.go:50","msg":"updating value for field ErrorDetectionSimpleRegexp: from '^(?P<filename>[^:]*):(?P<line>[0-9]+):(?P<column>[0-9]+)?([ ]*)?(?P<error>.*)' to '^(?P<filename>[^:]*):(?P<line>[0-9]+):(?P<column>[0-9]+):([ ]*)?(?P<error>.*)'"}
      2024-11-20T07:32:55.304937048Z {"level":"error","ts":"2024-11-20T07:32:55.304Z","logger":"pipelinesascode","caller":"events/emit.go:46","msg":"an error occurred: error while parsing the yaml file .tekton/npm-install-build-push.yml: yaml: invalid map key: map[interface {}]interface {}{\"repo_url\":interface {}(nil)}","provider":"gitlab","event-id":"","event-sha":"9386af7f1deb57da511a5d7d6d03ff53074fd8a2","event-type":"Push","namespace":"mycic","stacktrace":"github.com/openshift-pipelines/pipelines-as-code/pkg/events.(*EventEmitter).EmitMessage\n\t/go/src/github.com/openshift-pipelines/pipelines-as-code/pkg/events/emit.go:46\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/pipelineascode.(*PacRun).Run\n\t/go/src/github.com/openshift-pipelines/pipelines-as-code/pkg/pipelineascode/pipelineascode.go:65\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/adapter.(*sinker).processEvent\n\t/go/src/github.com/openshift-pipelines/pipelines-as-code/pkg/adapter/sinker.go:60\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/adapter.(*listener).Start.listener.handleEvent.func2.1\n\t/go/src/github.com/openshift-pipelines/pipelines-as-code/pkg/adapter/adapter.go:194"}
      

      Setting variables like below with double quotes resolved the issue with resolving the repo url and pipeline was triggered correctly earlier it was set to value: body.

          - name: repo_url
            value: "{{ repo_url }}"
      

      However, now they have a new issue, where the "{{ body }}" is unknown:

      {"level":"error","ts":"2024-11-20T16:17:21.800Z","logger":"pipelinesascode","caller":"events/emit.go:46","msg":"prun:  tekton validation error: yaml: line 16: did no
      t find expected key","provider":"gitlab","event-id":"","event-sha":"b6baa7f356e993f32b46b21146b70310353795e6","event-type":"Push","namespace":"mycic","stacktrace":"g
      ithub.com/openshift-pipelines/pipelines-as-code/pkg/events.(*EventEmitter).EmitMessage\n\t/go/src/github.com/openshift-pipelines/pipelines-as-code/pkg/events/emit.go
      :46\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/pipelineascode.(*PacRun).getPipelineRunsFromRepo\n\t/go/src/github.com/openshift-pipelines/pipelines-as-cod
      e/pkg/pipelineascode/match.go:211\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/pipelineascode.(*PacRun).matchRepoPR\n\t/go/src/github.com/openshift-pipeline
      s/pipelines-as-code/pkg/pipelineascode/match.go:37\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/pipelineascode.(*PacRun).Run\n\t/go/src/github.com/openshift
      -pipelines/pipelines-as-code/pkg/pipelineascode/pipelineascode.go:57\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/adapter.(*sinker).processEvent\n\t/go/src/
      github.com/openshift-pipelines/pipelines-as-code/pkg/adapter/sinker.go:60\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/adapter.(*listener).Start.listener.ha
      ndleEvent.func2.1\n\t/go/src/github.com/openshift-pipelines/pipelines-as-code/pkg/adapter/adapter.go:194"}
      

      They even tried with notation like value: {{ body }} , value: body * and *value: "{{ body }}", value: "body"

      Is there any changes done in parsing behavior with the Red Hat OpenShift Pipelines 1.15 ? and dynamic variable assignment ?

      Slack conversation: https://redhat-internal.slack.com/archives/CSPS1077U/p1732208310219559

       

       

       

        1. Solution:*

      it works in Pipelines as Code but the way taken to achieve this was wrong, need to update Pipelines as Code documentation.

              rh-ee-zashaikh Zaki Shaikh
              rhn-support-dkarde Dipak Karde
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: