kubernetes-sigs / prow

Prow is a Kubernetes based CI/CD system developed to serve the Kubernetes community. This repository contains Prow source code and Hugo sources for Prow documentation site.
https://docs.prow.k8s.io
Apache License 2.0
112 stars 90 forks source link

Expose job envrionments in prow.yaml #3 #185

Open ileixe opened 3 months ago

ileixe commented 3 months ago

Hi, congratulations on the independence of repo.

I'd like to ask feature request about our main painpoint to use prow: Environment variables are not available when prow job is defined.

Let me give specific example,

presubmits:
  - name: lint
    agent: tekton-pipeline
    tekton_pipeline_run_spec:
      v1beta1:
        pipelineRef:
          resolver: git
          params:
          # You need to change this revision when you update lint.yaml
          - name: revision
            value: a6ea90d4a7122bf1f43519ddfc86678cc35de30f # Here's what we need to specify PULL_PULL_SHA
          - name: pathInRepo
            value: tekton/lint.yaml
          - name: repo
            value: your-repo

As you can see, we need to bump up the revision whenever the referring yaml is updated even the repo itself is the same one that prow.yaml triggered. If we can use environment variables here, we can just depend on latest (and which is correct) yaml in PR.

Now, we're committing twice whenever the config itself is updated, and it's not only very annoying but also non-intuitive where newcomers always make mistake.

It's from tekton-pipeline agent, but underlying problem exists in the same way where user requires PULL_PULL_SHA when they define prow.yaml.

Can we expose such variables when converting prow.yaml to ProwJob?

Thanks.

BenTheElder commented 2 months ago

Kubernetes does not use tekton pipelines currently, I don't know how much bandwidth there is for working on this controller.