DVPS-353: give RAML publish jobs explicit needs
Problem
The publish jobs sat in the deploy stage without needs:, so GitLab treated the entire build stage as their prerequisite. Once DVPS-351 made an empty build fail with exit 1, that became cross-line blocking: if one line produced nothing while another built packages fine, those packages could not be published. Before DVPS-351 the failing build reported success, so the problem could not surface.
What changes
Each publish job now depends on its own build job only:
| Publish job | needs | Template |
|---|---|---|
publish-801-nuget |
build-801-raml |
multi-target |
publish-705-nuget |
build-705-raml |
multi-target |
publish-447-nuget / -rc
|
build-447-raml / -rc
|
before-cid |
publish-801-npm / -rc
|
build-801-raml |
browser-ui |
publish-705-npm / -rc
|
build-705-raml |
browser-ui |
publish-447-nuget / -rc
|
build-447-raml / -rc
|
browser-ui |
needs: goes on the concrete jobs rather than .publish-447-nuget-base, because each publish variant pairs with the build variant selected by the same rules — putting it on the base would point both variants at a single build. The npm -rc jobs inherit needs through extends, confirmed in the merged YAML returned by CI lint.
The rule pairs stay consistent, so optional: true is not needed: a publish variant is only ever in the pipeline when its build variant is too.
Narrowing artifacts is safe — with needs: a job receives artifacts only from the listed jobs, and every publish job reads exactly one out_* folder produced by its own build: out_raml2 for 801, out_raml3 for 705, out_raml2_447 for the browser-ui 447 line. The npm jobs keep their dependencies, now a subset of needs.
Verified with a before/after pair on identical input
A throwaway branch of thor/schemas/r1.raml pinned Rma.Refunds to a version present on .705 but absent on .801, so it entered the 801 build list only, and deliberately broke SmartPick, so it entered both lists and failed in both. That produces the asymmetry the fix is about: 801 builds a package, 705 builds nothing.
| master template (no needs) — 967021 | this branch — 967020 | |
|---|---|---|
build-801-raml |
exit 2, package built | exit 2, package built |
build-705-raml |
exit 1 | exit 1 |
publish-801-nuget |
skipped | manual, reachable |
publish-705-nuget |
skipped | skipped |
The 801 package was unpublishable before this change and is publishable after it. publish-705-nuget stays skipped in both, which is correct — its own build produced nothing.
CI lint reports valid: true with no warnings for all three templates.
Refs: DVPS-353