Skip to content

ci: extract CircleCI workflow routing into a script#21579

Open
ajsutton wants to merge 1 commit into
developfrom
aj/refactor/circleci-extract-routing-script
Open

ci: extract CircleCI workflow routing into a script#21579
ajsutton wants to merge 1 commit into
developfrom
aj/refactor/circleci-extract-routing-script

Conversation

@ajsutton

@ajsutton ajsutton commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Moves the inline bash from the prepare-continuation-config "Compute workflow conditions" step in config.yml into a standalone compute-workflow-conditions.sh. Pure mechanical extraction — no routing behavior changes.

The decision-tree and schedule-trigger tests now read the extracted script instead of yq-extracting the inline command from config.yml.

Because test-decision-tree.sh now runs the real routing script (which calls finalize), it uses an isolated, exported OUTPUT file instead of the pipeline's shared /tmp/pipeline-parameters.json — otherwise the last scenario's c-run_* flags (e.g. c-run_close_issue) would be left in that file and inherited by the later collect-params/compute steps. workflow-helpers.sh honors the OUTPUT override.

This is step 1 of a two-step split; the declarative refactor (separating routing data from logic) is stacked on top.

Stacked on #21575.

Test plan

  • mise exec -- bash .circleci/scripts/test-decision-tree.sh — 19/19 scenarios pass (runs the extracted script directly); verified it leaves /tmp/pipeline-parameters.json untouched
  • mise exec -- shellcheck .circleci/scripts/*.sh
  • mise exec -- bun build .circleci/scripts/test-schedule-triggers.js --outfile=/tmp/x.js
  • offline run of bun .circleci/scripts/test-schedule-triggers.js (live API portion needs CIRCLE_API_TOKEN)

@ajsutton ajsutton requested a review from a team as a code owner June 26, 2026 04:31
@ajsutton ajsutton force-pushed the aj/refactor/circleci-extract-routing-script branch 2 times, most recently from 09ace01 to e493fce Compare June 26, 2026 05:24
@ajsutton ajsutton force-pushed the aj/fix/circleci-schedule-trigger-check branch from e242dd4 to 7b9aae5 Compare July 6, 2026 20:29
@ajsutton ajsutton force-pushed the aj/refactor/circleci-extract-routing-script branch from e493fce to d3ee186 Compare July 6, 2026 20:29
Base automatically changed from aj/fix/circleci-schedule-trigger-check to develop July 6, 2026 22:18
Move the inline bash from the prepare-continuation-config "Compute
workflow conditions" step in config.yml into a standalone
compute-workflow-conditions.sh, with no behavioral change. The
decision-tree and schedule-trigger tests now read the extracted script
instead of the config.yml inline command.

test-decision-tree.sh runs the real routing script and so must not write
the pipeline's shared /tmp/pipeline-parameters.json: finalize would leave
c-run_* flags (e.g. c-run_close_issue from the last scenario) that the
later collect-params/compute steps inherit. It now uses an isolated,
exported OUTPUT file; workflow-helpers.sh honors that override.
@ajsutton ajsutton force-pushed the aj/refactor/circleci-extract-routing-script branch from d3ee186 to 4cd111f Compare July 6, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant