ci: add new "targeted" runtype, to only build a specific step and its dependencies
Created by: jhchabran
I had this at the back of mind for a while, I quickly hacked it in between things.
It's rather inconvenient when debugging a specific step to generate irrelevant steps which are consuming jobs for nothing.
This PR adds a new run type, targeted
which generates a full pipeline then peels off any step that isn't a dependency (direct or indirect) of the targeted step.
The targeting works by seeking a substring match in the step labels, with dashes replacing spaces. Any ambiguity will be refused by the pipeline generator and will lead to an error.
I have also added an optional argument description to the matcher, to make it clearer for the users how to use the targeted builds.
targeted
may not be the most useful one, don't hesitate to suggest a better one.
Test plan
- Local runs
- Unit tests
- Triggered builds:
- sg ci build targeted:
build server
- sg ci build targeted
puppeteer-tests-finalize
-
sg ci build targeted
puppeteer
ambiguous, expected to fail.
- sg ci build targeted: