Example setup:
# pipeline.a.yml
steps:
- key: a
command: # does something with side effects
# pipeline.b.yml
monorepo:
produces: b.tar.gz
steps:
- key: b
depends_on: a
command: # creates b.tar.gz
# pipeline.c.yml
monorepo:
expects: b.tar.gz
steps:
- key: c
depends_on: b
command: # uses b.tar.gz, and relies on side-effects of `a` happening first
If b has no matches and is skipped, currently we:
- Create the artifact step
- Add a dependency to any steps that depended on the skipped step (in this case
c), for the artifact step (so that b.tar.gz is guaranteed to exist before step c runs).
This is fine logic, however depending on the nature of the different steps, some builds may have ordering concerns between a and c. Such builds might be relying on the transitive nature of depends_on (as they should be able to) so that their pipeline is simple. In our specific example, a = node_modules, b = typescript, and c = some tests.
Just running c after the replacement of b isn't enough. Instead, it has to run after all of b's depends_ons, if they're still in the build.
Result: if b is skipped, c's depends_on should be [artifact step + (depends on of b) + (depends on of c)].filter(still in build), for a result of: [artifact step, a]