Skip to content

ci: make CircleCI workflow routing declarative#21580

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

ci: make CircleCI workflow routing declarative#21580
ajsutton wants to merge 1 commit into
developfrom
aj/refactor/circleci-declarative-routing

Conversation

@ajsutton

Copy link
Copy Markdown
Contributor

Separates the CircleCI routing data from the routing logic. Stacked on #21579.

A new .circleci/routing.yml holds the declarative data:

  • schedules — schedule name → workflows
  • api_dispatch — dispatch flag → workflows (including main_dispatch and labeled_pr, whose conditions stay in the script)
  • change_patternsany/all ERE patterns matched against changed files
  • passthrough_params — params forwarded to continuation configs

compute-workflow-conditions.sh now holds only the conditions; collect-params.sh reads the change patterns from routing.yml; and test-schedule-triggers.js reads the schedule map directly instead of regex-parsing the routing script.

No routing behavior changes — the same c-run_* flags are enabled for every trigger/branch/schedule/dispatch case.

Test plan

  • mise exec -- bash .circleci/scripts/test-decision-tree.sh — 19/19 scenarios pass (now reads routing.yml)
  • mise exec -- shellcheck .circleci/scripts/*.sh
  • mise exec -- bash .circleci/scripts/merge-configs.sh && mise exec -- bash .circleci/scripts/test-continuation-params.sh /tmp/merged-config.yml
  • 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 from 9d09c3e to 09ace01 Compare June 26, 2026 05:16
@ajsutton ajsutton force-pushed the aj/refactor/circleci-declarative-routing branch from f6d6d94 to e96f8fe Compare June 26, 2026 05:17
@ajsutton ajsutton force-pushed the aj/refactor/circleci-extract-routing-script branch from 09ace01 to e493fce Compare June 26, 2026 05:24
@ajsutton ajsutton force-pushed the aj/refactor/circleci-declarative-routing branch from e96f8fe to 37ec546 Compare June 26, 2026 05:25
@ajsutton ajsutton force-pushed the aj/refactor/circleci-extract-routing-script branch from e493fce to d3ee186 Compare July 6, 2026 20:29
@ajsutton ajsutton force-pushed the aj/refactor/circleci-declarative-routing branch from 37ec546 to 22c6f11 Compare July 6, 2026 20:29
@ajsutton ajsutton force-pushed the aj/refactor/circleci-extract-routing-script branch from d3ee186 to 4cd111f Compare July 6, 2026 22:22
@ajsutton ajsutton force-pushed the aj/refactor/circleci-declarative-routing branch from 22c6f11 to 711b9b2 Compare July 6, 2026 22:30
@ajsutton ajsutton force-pushed the aj/refactor/circleci-extract-routing-script branch 2 times, most recently from ac25283 to 32fe48d Compare July 7, 2026 20:00
Base automatically changed from aj/refactor/circleci-extract-routing-script to develop July 7, 2026 21:59
Move the routing data (schedule->workflows, API dispatch flags,
change-detection patterns, passthrough params) into a standalone
routing.yml and have compute-workflow-conditions.sh read it, so the
scripts hold only the routing logic. collect-params.sh now reads the
change patterns from routing.yml, and test-schedule-triggers.js reads
the schedule map directly instead of parsing the routing script.
@ajsutton ajsutton force-pushed the aj/refactor/circleci-declarative-routing branch from 711b9b2 to 38c9f9f Compare July 7, 2026 22:05
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