pipelines-as-code icon indicating copy to clipboard operation
pipelines-as-code copied to clipboard

Resolve PaC params as default

Open LvanLeeuwen opened this issue 2 years ago • 3 comments

We have added some of the default Pipelines-as-code parameters to the parameter list of the PipelineRun like this:

params:
  - name: REPO_NAME
    value: "{{ repo_name }}"
  - name: REPO_URL
    value: "{{ repo_url }}"
  - name: REVISION
    value: "{{ revision }}"
  - name: BRANCH
    value: "{{ source_branch }}"
  - name: PULL_REQUEST_NUMBER
    value: "{{ pull_request_number }}"

Adding these values as a default in the Pipeline spec and omitting it in the PipelineRun doesn't seem to resolve the params. Pipeline.yaml:

params:
  - name: REPO_NAME
    default: "{{ repo_name }}"
  - name: REVISION
  - name: BRANCH
  - name: PULL_REQUEST_NUMBER

PipelineRun.yaml:

params:
  - name: REPO_URL
    value: "{{ repo_url }}"
  - name: REVISION
    value: "{{ revision }}"
  - name: BRANCH
    value: "{{ source_branch }}"
  - name: PULL_REQUEST_NUMBER
    value: "{{ pull_request_number }}"

For example when using a github-set-status task I get the following error: http.client.InvalidURL: URL can't contain control characters. '/repos/< organisation>/{{ repo_name }}/statuses/< sha>' (found at least ' ')

Would it be possible to enable using pipelines-as-code parameters as default values in the pipeline spec?

LvanLeeuwen avatar Aug 30 '23 06:08 LvanLeeuwen

yeah, we don't resolve params on remote resources..

I am not against adding it.. (as well having remote tasks from remote pipeline annotations).

any chance you can fill in a RFE on red hat access so we can prioritize this?

chmouel avatar Aug 30 '23 07:08 chmouel

yeah, we don't resolve params on remote resources..

I am not against adding it.. (as well having remote tasks from remote pipeline annotations).

any chance you can fill in a RFE on red hat access so we can prioritize this?

Hi @chmouel, I'll be happy to pick that up. Could you explain what an RFE entails, and how the process works of filling one in on Red Hat Access works?

Waterstraal avatar Aug 30 '23 07:08 Waterstraal

@chmouel I created an RFE: https://access.redhat.com/support/cases/#/case/03620521

Waterstraal avatar Sep 22 '23 08:09 Waterstraal

This has been solved in #1985 cc: @chmouel

zakisk avatar Mar 26 '25 10:03 zakisk

yes!

chmouel avatar Mar 26 '25 15:03 chmouel