Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add earlier validation of pipeline result references #3499

Closed
ghost opened this issue Nov 5, 2020 · 5 comments · Fixed by #3711
Closed

Add earlier validation of pipeline result references #3499

ghost opened this issue Nov 5, 2020 · 5 comments · Fixed by #3711
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@ghost
Copy link

ghost commented Nov 5, 2020

Feature request

At the moment we fail a PipelineRun with InvalidTaskResultReference when we're scheduling the next TaskRuns to execute. This can happen after some tasks in the pipeline have already executed, which takes time. It should be possible to inspect all referenced Tasks before a PipelineRun starts and confirm that any references to Task Results from variables in the Pipeline are not misspelled or otherwise invalid. This would result in a shorter time to failure and a shorter time to the user realizing their mistake.

Use case

When a user submits a PipelineRun they could receive an earlier error message if any variables in the Pipeline refer to results that simply don't exist on the tasks being referenced.

More Details

We'll need to decide if we're happy to pay whatever cost there is holding back the PipelineRun's start of execution until the reconciler has fetched and checked every referenced Task and its results.

Turns out we already fetch all the tasks as part of each PipelineRun reconcile. So it should just be a case of validating the relationships between them on the first reconcile.

@ghost ghost added kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. labels Nov 5, 2020
@bobcatfish
Copy link
Collaborator

Was discussing with @jerop today and I think it's totally worth it! We could probably add it in such away that it only happens once per Run

@vdemeester vdemeester added this to the Pipelines v0.20 milestone Nov 30, 2020
@vdemeester vdemeester removed the priority/backlog Higher priority than priority/awaiting-more-evidence. label Nov 30, 2020
@pritidesai
Copy link
Member

Just to be clear, this validation is also needed for a task result reference in a PipelineTask in addition to pipeline results.

We have tasks section validation making sure referenced task exist but not validating the result reference is defined in the task's result section.

@ghost
Copy link
Author

ghost commented Jan 20, 2021

Another use-case for reading all the Tasks in a Pipeline at startup time: It would be useful to check that a workspace marked "optional" at the pipeline level is indeed also "optional" in all the Tasks that want to consume that workspace. Because if not that should probably be a validation error.

@ghost ghost self-assigned this Jan 20, 2021
@souleb
Copy link
Contributor

souleb commented Jan 21, 2021

can work on that

@ghost
Copy link
Author

ghost commented Jan 21, 2021

Hey @souleb, thanks for jumping in. I'm halfway through implementing but will unassign myself and ping you if I'm not able to finish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants