Skip to content

perf(ci): move the Design Tokens check into a filtered workflow #4934

Open

Description

@dan-petty

Problem or Motivation

The Design Tokens job of ci.yml tests its paths in a step with dorny/paths-filter, so it takes a runner on each push to a pull request, also when no design file changed. #4653 moved four checks of the same form (Rule Pack Tests, Docs Site Build, Image Pins and Third-Party Image Scan) into workflows of their own with the native on.pull_request.paths filter. Design Tokens came with #4738, after the audit that measured the four, so it still has the step filter. It is not a required check. The account runs at most 20 hosted jobs at one time, so each job that does no work makes the queue of each pull request longer.

Proposed Solution & Architectural Design

  • Move the job design-tokens into .github/workflows/design-tokens.yml with on.pull_request.paths equal to its current filter, with the workflow file in place of .github/workflows/ci.yml. Keep the job name and its limits.
  • Remove the dorny/paths-filter step, the step conditions and pull-requests: read.
  • Change test_the_design_tokens_job_builds_the_tokens_only_when_a_path_of_its_filter_changes and JOB_LIMIT_MINUTES in tests/invariants/test_workflow_contracts.py, the parity allowlist in tests/commands/test_ci.py, and the section of docs/SDLC.md. Add the workflow to PATH_CHECKS of the contract tests.

Target Subsystem

SDLC, Git & PR Governance (.github/workflows/, tests/invariants/test_workflow_contracts.py, tests/commands/test_ci.py, docs/SDLC.md).

Existing Tool Considered

The native on.pull_request.paths filter of GitHub Actions, as #4653 uses. No new tool. Cost: about 25,000 tokens and 1 hour.

Acceptance Criteria

  • A pull request that changes no path of the filter starts no Design Tokens job.
  • The check keeps its name Design Tokens.
  • A change to ci.yml alone does not start it.

Dependencies

#4653 (the PATH_CHECKS table and the SDLC rule).

Source: #4653

Alternatives check of 2026-11-15: not-applicable.
Class: perf, no search.
Tool: none found.

Proposed design

Problem statement

The Design Tokens job of .github/workflows/ci.yml tests its paths in a step with dorny/paths-filter. The job therefore takes a runner on each push to a pull request, also when no design file changed. The account runs at most 20 hosted jobs at one time, so each job that does no work makes the queue of each pull request longer. The change moves the job into .github/workflows/design-tokens.yml and uses the native on.pull_request.paths filter, as #4653 does for four other checks. The job keeps its name, and the step filter, its step conditions and its pull-requests: read permission go.

Acceptance criteria

Requirement: The design-tokens job runs from its own workflow

The design-tokens job SHALL run from .github/workflows/design-tokens.yml, and the check SHALL keep the name Design Tokens.

Scenario: The new workflow holds the job

  • WHEN the contract test reads .github/workflows/design-tokens.yml
  • THEN it finds one job design-tokens whose name is Design Tokens.

Requirement: The native paths filter replaces the step filter

The new workflow SHALL start on pull_request only for the paths of the current filter, and it SHALL hold no dorny/paths-filter step.

Scenario: No step filter remains

  • WHEN the contract test reads the on.pull_request.paths list and the steps of .github/workflows/design-tokens.yml
  • THEN the list holds at least one entry and no step uses dorny/paths-filter.

Requirement: The workflow file replaces ci.yml in the filter

The paths filter SHALL list .github/workflows/design-tokens.yml in place of .github/workflows/ci.yml.

Scenario: A change to ci.yml alone starts no check

  • WHEN the contract test reads the paths list of .github/workflows/design-tokens.yml
  • THEN the list holds .github/workflows/design-tokens.yml and does not hold .github/workflows/ci.yml.

Requirement: The job keeps its runner and its limit

The JOB_LIMIT_MINUTES table SHALL name .github/workflows/design-tokens.yml for the job design-tokens with the same limit, and the job SHALL keep runs-on: ubuntu-26.04.

Scenario: The limit table names the new file

  • WHEN the contract test reads JOB_LIMIT_MINUTES at tests/invariants/test_workflow_contracts.py:55 and the job of the new workflow
  • THEN the entry for design-tokens names the new file with the limit of ci.yml, and runs-on is ubuntu-26.04.

Requirement: The old job leaves ci.yml

.github/workflows/ci.yml SHALL hold no design-tokens job.

Scenario: The job is removed from ci.yml

  • WHEN the contract test reads the jobs map of .github/workflows/ci.yml
  • THEN the map holds no key design-tokens.

Requirement: The new workflow asks only for contents

The new workflow SHALL ask for contents: read and MUST NOT ask for pull-requests: read.

Scenario: The pull request read permission is gone

  • WHEN the contract test reads the permissions of .github/workflows/design-tokens.yml
  • THEN contents is read and no key pull-requests is present.

Requirement: A new push cancels the run before it

The new workflow SHALL cancel the run of an older push to the same pull request.

Scenario: The concurrency block cancels in progress

  • WHEN the contract test reads the concurrency block of .github/workflows/design-tokens.yml
  • THEN cancel-in-progress is true and the group holds github.workflow and github.ref.

Requirement: The contract test reads the new workflow

test_the_design_tokens_job_builds_the_tokens_only_when_a_path_of_its_filter_changes SHALL read the filter from .github/workflows/design-tokens.yml.

Scenario: The updated test reads the paths list

  • WHEN the test at tests/invariants/test_workflow_contracts.py:1927 runs
  • THEN it reads on.pull_request.paths of the new workflow and asserts that no step filter remains.

Requirement: The path checks cover the new workflow

PATH_CHECKS SHALL list .github/workflows/design-tokens.yml.

Scenario: The new workflow is in the path checks

  • WHEN the contract test reads PATH_CHECKS at tests/invariants/test_workflow_contracts.py:1636
  • THEN the table holds .github/workflows/design-tokens.yml.

Requirement: The CI parity allowlist names the new workflow

The parity allowlist in tests/commands/test_ci.py SHALL name .github/workflows/design-tokens.yml in place of the design-tokens job of ci.yml.

Scenario: The allowlist names the new workflow

  • WHEN the tests of tests/commands/test_ci.py read the allowlist
  • THEN it holds .github/workflows/design-tokens.yml and no entry for a design-tokens job of .github/workflows/ci.yml.

Requirement: The SDLC document names the new workflow

The list of path-filtered workflows in docs/SDLC.md SHALL name .github/workflows/design-tokens.yml.

Scenario: The document lists the new workflow

  • WHEN a test that reads docs/SDLC.md reads its list of path-filtered workflows
  • THEN the list holds .github/workflows/design-tokens.yml and no design-tokens job of .github/workflows/ci.yml.

Existing Tool Considered

Use the native on.pull_request.paths filter of GitHub Actions, as #4653 uses. The change builds no code and keeps no new tool. The alternatives check of 2026-11-15 gave not-applicable for class perf, made no search and found no tool. The native filter lacks negative patterns, content predicates and a per-job scope: it starts or skips the whole workflow only. The body estimates about 25,000 tokens and 1 hour for the move.

Key questions

  • Which filter starts the Design Tokens check after the move?: The native on.pull_request.paths filter, with the entries of the current design-tokens filter, and with .github/workflows/design-tokens.yml in place of .github/workflows/ci.yml. (best practice) [sources: .github/workflows/ci.yml, tests/invariants/test_workflow_contracts.py:1927]
    • Chosen: native on.pull_request.paths. GitHub reads the changed files before it starts the workflow, so a pull request that changes no listed path takes no runner.
    • Rejected: keep the dorny/paths-filter step in ci.yml. The job takes a runner before the step reads the paths, which is the cost that the item removes.
    • Rejected: a dorny/paths-filter step in the new workflow. The workflow still starts a runner for each pull request, so the queue stays long.
  • Is Design Tokens a required check of the main ruleset?: No. ADR 0004 names Static Analysis, Tests & Coverage and Semantic PR title as the required checks, so the move changes no ruleset. [sources: docs/adr/0004-ci-is-the-authoritative-gate.md]
  • Does this item need perf(ci): move the four path checks into filtered workflows #4653 done first?: No. PATH_CHECKS exists at tests/invariants/test_workflow_contracts.py:1636 at this commit, so perf(ci): move the four path checks into filtered workflows #4653 is in place and the item adds one entry to that table. [sources: tests/invariants/test_workflow_contracts.py:1636]
  • Which permissions does the new workflow ask for?: contents: read only. The permission pull-requests: read serves the dorny/paths-filter step, which the move removes. (best practice) [sources: .github/workflows/ci.yml]
    • Chosen: contents: read only. No step reads the pull request API, and a permission that no step uses widens the token of the job.
    • Rejected: keep pull-requests: read. It serves no step after the move.
  • Does a new push to a pull request cancel the run before it?: Yes. The new workflow sets a concurrency group that holds github.workflow and github.ref, with cancel-in-progress: true, as ci.yml does. (best practice) [sources: .github/workflows/ci.yml]
    • Chosen: copy the concurrency block of ci.yml. The run of an older push stops, so one pull request holds one run of the check.
    • Rejected: no concurrency block. Each push queues a full run, which makes the queue longer.
  • Which events start the new workflow?: pull_request only, with the paths filter, as the body proposes. (best practice) [sources: .github/workflows/ci.yml]
    • Chosen: pull_request with paths. The body gives this form, and the check reads the changed files of a pull request.
    • Rejected: pull_request and push to main. The body scopes the item to the pull request trigger.
    • Rejected: keep the step filter. The runner cost stays.
  • Does the job keep its name, its runner and its limit?: Yes. The job keeps the name Design Tokens, the runner ubuntu-26.04 and the limit that JOB_LIMIT_MINUTES records, and that table names the new file. (best practice) [sources: tests/invariants/test_workflow_contracts.py:55]
    • Chosen: keep the name, the runner and the limit. The name shows on each pull request and the limit table already bounds the job; a rename delivers no result.
    • Rejected: rename the check. It changes what a person reads on each pull request and breaks the parity allowlist for no gain.
  • Which part of docs/SDLC.md changes?: The list of path-filtered workflows that perf(ci): move the four path checks into filtered workflows #4653 added. It names .github/workflows/design-tokens.yml and drops the design-tokens job from .github/workflows/ci.yml. (best practice) [sources: docs/SDLC.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    on Nov 12, 2026
  2. added
    type/infra
    scope/ci
    status/new
    value/medium
    effort/low
    on Nov 12, 2026
  3. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/infra. The perf prefix of the title gives the type.
    • Scope: scope/ci. The (ci) scope of the title gives the scope.
    • Priority: P2-Medium. It saves runner-minutes and shortens queue time but does not block a release or fix a defect.
    • Value: Medium. It removes one idle runner per PR push and shortens the queue for all PRs.
    • Effort: Low. The body states about 25,000 tokens and 1 hour to move one job and update four test files.
    • Related: perf(ci): run only the required checks on the release PR #4637, which asks for a different change. Both reduce unnecessary CI runs, but #4637 targets release PRs while this targets the Design Tokens job on any PR.
  4. added
    priority/p2-medium
    on Nov 12, 2026
  5. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

    Class: perf. The check makes no search and no model call for an item of this class.

    Tool: none found

    Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.

  6. added
    status/ready
    and removed
    status/new
    on Nov 16, 2026
  7. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at fccb781 (see proposed design in issue body).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/cisource/agentstatus/readytype/infravalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions