CI Lint: Allow simulating different pipeline conditions
Background
This closed ticket described what I would like to achieve, but ended up only implementing the MVP for the default branch and not providing further options for other types of pipelines: #337282 (closed)
Problem to solve
CI lint does not catch issues with pipelines that differ from the default branch style pipeline. For example, job A might not be present in a MR pipeline but job B needs it. If both A and B are present in the default branch pipeline, CI lint is happy. But when the MR pipeline is run, the pipeline config will be invalid because B needs the non-existent A.
The user will only notice the failure after the MR pipeline is already running and failing. This leads to a slow feedback loop. This is especially bad if the problem is in a child-pipeline and it takes a while to get there.
Proposal
Allow the user specify different conditions for CI lint to simulate scenarios beyond the default branch.
For my use case, even having the option to pass ENV parameters to the CI lint API would be useful. I could then run CI lint against conditions that are something like:
CI_PIPELINE_SOURCE=schedule
MY_CUSTOM_VARIABLE=something
The above example would be enough to lint a scheduled pipeline with the variable MY_CUSTOM_VARIABLE. This is a typical scenario in our organization where things break because CI lint fails to catch an issue.
Intended users
Anyone working with CI pipelines.