tektoncd / pipeline

A cloud-native Pipeline resource.
https://tekton.dev
Apache License 2.0
8.35k stars 1.76k forks source link

Error message when PipelineRun is missing parameters required by Pipeline is nonsensical #8062

Open jvmdc opened 2 weeks ago

jvmdc commented 2 weeks ago

Expected Behavior

When not providing the required parameters, an error message occurs: PipelineRun <namespace name>/<pipeline run name> parameters is missing some parameters required by Pipeline <namespace name>/<pipeline name>'s parameters: pipelineRun missing parameters

This would align the error message with other error messages in the same file.

Actual Behavior

When not providing the required parameters, an error message occurs: PipelineRun<namespace name> parameters is missing some parameters required by Pipeline <pipeline run name>'s parameters: pipelineRun missing parameters

Steps to Reproduce the Problem

  1. Fail to provide the required parameters for a pipeline
  2. See that the error message is weird

Additional Info

https://github.com/tektoncd/pipeline/blob/main/pkg/reconciler/pipelinerun/pipelinerun.go#L492-L493 <- Source of the nonsensical message.

jvmdc commented 2 weeks ago

Fixing it should be quite simple. The aforementioned lines should be changed to something like:

            "PipelineRun %s/%s parameters is missing some parameters required by Pipeline %s/%s's parameters: %s",
            pr.Namespace, pr.Name, pr.Namespace, pipelineMeta.Name, err)

I do not have the time available at the moment to read the contribution guidelines and set up tools etc., so hoping someone else has :)

vdemeester commented 2 weeks ago

@jvmdc so one "challenge" to this is, there might not be a named Pipeline in the namespace, as one could use inline spec, or resolvers.

jvmdc commented 2 weeks ago

Isn't that also an issue in the other errors in the file then?

vdemeester commented 2 weeks ago

Isn't that also an issue in the other errors in the file then?

Well, for example, this PipelineRun does not refer any Pipeline as everything is inlined.

jvmdc commented 2 weeks ago

Isn't that also an issue in the other errors in the file then?

Well, for example, this PipelineRun does not refer any Pipeline as everything is inlined.

Sure, I get that - But shouldn't that also be a challenge for the other errors in the file linked such as https://github.com/tektoncd/pipeline/blob/main/pkg/reconciler/pipelinerun/pipelinerun.go#L502-L503?

samagana commented 1 week ago

/assign @samagana