DEVEX-1653: add rt_mode to build-php-v1 orchestrator#137
Conversation
When rt_mode=true (caller triggers on rt-* refs), the orchestrator: - skips mathieudutour's dry-run + final tag-and-release jobs - adds a compute-rt-tag job that calls encodium/actions' _compute-rt-tag composite to push the rt rc tag and create the GH pre-release atomically up front - routes build at matrix-time to consume that tag Non-rt callers see no behavior change (rt_mode defaults to false). The shared output 'tag' now resolves from whichever path ran. Skipped jobs return empty-string outputs in GitHub Actions, so the '||' guard picks the active path's tag without further gating. Caller responsibilities (per DEVEX-1653): - gate the rt-build job on startsWith(github.ref, 'refs/heads/rt-') - grant 'permissions: contents: write' to that job - pass a token with contents:write via secrets.gh_token DEVEX-1653
PR SummaryMedium Risk Overview When
Reviewed by Cursor Bugbot for commit 7a67e2e. Bugbot is set up for automated code reviews on this repo. Configure here. |
DEVEX-1653: add rt_mode to build-php-v1 orchestrator (transitive-skip fix) Adds the rt_mode boolean input plus rt-path jobs (compute-rt-tag, gated build execution) to enable Template A callers to route through the _compute-rt-tag composite in encodium/actions. Fixes the transitive-skip cascade discovered when merging Batch 1 Template A PRs immediately post-#137: tag-and-release has `needs: [build]`, and build's own needs include compute-rt-tag (skipped on main-path). GitHub Actions' default `success()` gate on job-if propagates that transitive skipped-status through the needs chain, silently skipping tag-and-release even when build itself succeeded — resulting in empty image_tag output → downstream integration-deploy helm apply crashing on malformed YAML (`image: ghcr.io/…:` with nothing after the colon). Fix: gate tag-and-release with `if: !cancelled() && !inputs.rt_mode`. !cancelled() explicitly overrides the implicit success() gate on the transitive skipped need, restoring the intended semantics: run whenever the workflow wasn't cancelled AND we're on the non-rt path. Verified against license_api/rp_api/catalog_api/vin_decoder_service post-merge canary before Batches 3/4 landed. Refs DEVEX-1653, #137 (original), #140 (revert).
Description
Adds an
rt_mode: booleaninput to the sharedbuild-php-v1orchestrator. Whentrue(caller triggers onrt-*refs), the orchestrator routes throughencodium/actions'_compute-rt-tagcomposite to push the rt rc tag and create the GH pre-release atomically up front;buildthen consumes that tag. Whenfalse(default) behavior is identical to today.Related PRs:
Jira Issue: https://revolutionparts.atlassian.net/browse/DEVEX-1653
Background
Release Train v2 (DEVEX-1579) ships images tagged
vX.Y.Z-rc.<YYYY-MM-DD>.<iter>from per-trainrt-<YYYY-MM-DD>branches. The pilot (listings-url-service#89) proved the inline pattern works, but copying ~80 lines of rt-build logic into every consuming app'sBuild.yamlwould mean 4 near-identical inline jobs to maintain (internal_api, rp_api, listings-url-service, license_api).By teaching
build-php-v1about rt mode, Phase 3 per-repo PRs become a few lines: a secondrt-buildjob that calls the orchestrator withrt_mode: trueand a differentimagesJSON (noextra_tag: latestfor rt builds). Tag-emission logic and GH Release creation stay in one place — the composite action.The non-rt path is preserved verbatim. The two paths are mutually exclusive at job level (
if: ${{ !inputs.rt_mode }}vsif: ${{ inputs.rt_mode }});buildwaits on both withalways() && (success of either)and selects the active tag via||.Scope of this PR (and what's deferred):
build-php-v1.yaml: extended.build-php-laravel.yaml: intentionally not extended here. The Laravel worker hardcodes:latest/:webserver-latest/:cli-latestacross 6 build jobs — safely supporting rt mode there requires anomit_latest_taginput plumbed through the worker. That's a separate, larger PR. Among Phase 3 apps onlyreturns-apiconsumes the Laravel orchestrator; it can use an inline rt-build path (matching the pilot) in the interim.accounts-apicallsphp-laravel-build-push.yamldirectly (not the Laravel orchestrator) andcatalog_apiis fully inline — both will use inline rt-build paths in Phase 3.Caller responsibilities
For an rt-build job calling this orchestrator with
rt_mode: true:if: startsWith(github.ref, 'refs/heads/rt-')permissions: { contents: write }on the calling job (propagates intocompute-rt-tag)contents:writeviasecrets.gh_token(the pilot usesREPO_WRITE_PAT)imagesJSON withoutextra_tag: latest— rt builds shouldn't move:latestTesting Information
calculate-tag→build→tag-and-releasechain runs identically; the only addition (compute-rt-tag) is gated onrt_mode == trueand stays skipped.rt-99train against the foundational composite action prior to this PR. This PR is a packaging refactor — same composite, same emitted tag, called from one place instead of inlined per-repo.rt_mode; the default (false) preserves their current behavior.Phase 3 follow-up PRs (one per consuming repo) will exercise rt_mode end-to-end before any per-repo merge.