Skip to content

fix(ci): plan-check waits for semantic-title to complete #3975

Closed

Description

@dan-petty

Problem

In .github/workflows/pr-title.yml, the job plan-check has:

  plan-check:
    name: Plan Check
    needs: semantic-title
    if: "${{ always() && github.event.pull_request.user.login == 'devops-cli-service[bot]' && startsWith(github.event.pull_request.title, 'docs(openspec): plan #') }}"

In GitHub Actions, the expression always() evaluates to true immediately, bypassing the completion wait of needs: semantic-title. GitHub Actions starts plan-check concurrently with semantic-title.

When plan-check runs devops roadmap plan-check, _check_problems checks the check runs of the pull request for Semantic PR title. Because semantic-title is still running, Semantic PR title has status in_progress, causing plan-check to fail with:
checks: semantic-pr-title: The check Semantic PR title has the state in_progress, and it needs success.

Expected

plan-check waits for semantic-title to complete before executing. The condition uses !cancelled() and checks the result of needs.semantic-title instead of unconditional always().

Acceptance criteria

  • The plan-check job does not start while semantic-title is still running.
  • When semantic-title fails, plan-check still runs and reports the failure.
  • When semantic-title succeeds, plan-check reads Semantic PR title as success without race conditions.

Existing tool considered

Standard GitHub Actions workflow expressions (!cancelled()).

Related

Related: #3103, #3875, #3928.

Proposed design

Problem statement

The plan-check job fails on some plan pull requests of the Service with checks: semantic-pr-title: The check Semantic PR title has the state in_progress, and it needs success. The command reads the Semantic PR title check run before that check completes. The change makes the job run only after semantic-title, and makes the command wait a bounded time for the title check to reach a terminal state.

Acceptance criteria

Requirement: Plan check job condition

The plan-check job SHALL keep needs: semantic-title and SHALL use !cancelled() in its if condition in place of always().

Scenario: Workflow condition holds no always()

  • WHEN A test parses .github/workflows/pr-title.yml.
  • THEN The test asserts that plan-check lists semantic-title in needs, that its if holds !cancelled(), and that its if holds no always().

Requirement: Failed title check is reported

The plan-check command SHALL report a Semantic PR title check with the state failure as a problem.

Scenario: Failed title check

  • WHEN The check summary holds semantic-pr-title with the state failure.
  • THEN _check_problems returns a problem that names semantic-pr-title and its state.

Requirement: Wait for a pending title check

The plan-check command SHALL poll the Semantic PR title check until its state is terminal or the wait limit elapses.

Scenario: Pending check becomes success

  • WHEN The first read gives in_progress and the next read gives success.
  • THEN The command makes no problem for semantic-pr-title and exits with status 0.

Requirement: Pending check at the wait limit

The command SHALL report a check that is still pending at the wait limit as a note and SHALL NOT fail on it.

Scenario: Pending check stays pending

  • WHEN Every read within the wait limit gives in_progress.
  • THEN The output holds a note for semantic-pr-title and _check_problems returns no problem for it.

Requirement: Successful title check

The command SHALL report no problem for Semantic PR title when its state is success.

Scenario: Successful title check

  • WHEN The check summary holds semantic-pr-title with the state success.
  • THEN _check_problems returns no problem that names semantic-pr-title.

Existing Tool Considered

No alternatives check has run. GitHub Actions status functions (!cancelled(), the needs context) and the existing src/devops_cli/github/check_verdict.py module cover the need, so the change adds no library and no dependency. GitHub Actions lacks a primitive that waits for a named check run, so the command needs a short poll of its own.

Key questions

  • Where does the plan-check command read the state of the Semantic PR title check?: src/devops_cli/roadmap/plan_check.py:226 builds the problems from a CheckVerdictSummary. _check_problems at line 230 turns a state that is not success into a problem. src/devops_cli/github/check_verdict.py holds the states, in_progress included. [sources: src/devops_cli/roadmap/plan_check.py:226, src/devops_cli/roadmap/plan_check.py:230, src/devops_cli/github/check_verdict.py]
  • How does the command avoid a false failure on a pending Semantic PR title check?: The command polls the Semantic PR title check until its state is terminal. The wait limit is 120 s and the poll interval is 5 s. A check that is still pending at the limit gives a note and no problem. (best practice) [sources: src/devops_cli/roadmap/plan_check.py:226, src/devops_cli/github/check_verdict.py, .github/workflows/pr-title.yml]
    • Rejected: Change the job condition only. needs already makes the job wait, and always() only lets the job run after a failed needed job. The condition cannot stop a read of a title check that another workflow run holds in progress.
    • Chosen: Bounded wait in the command. It removes the false failure whatever the cause, and it keeps the report of a failed title check.
    • Rejected: Job concurrency with cancel-in-progress. It cancels the run that holds the required Semantic PR title check, and a cancelled required check can block the merge (ADR 0014).
  • Which status function does the plan-check job condition use?: The condition uses !cancelled(). It runs the job after a failed semantic-title job and skips the job in a cancelled workflow run. (best practice) [sources: .github/workflows/pr-title.yml]
    • Rejected: always(). It runs the job in a cancelled workflow run, and the issue reports it as the cause of the race.
    • Chosen: !cancelled(). It runs the job after a failed needed job and skips the job in a cancelled run.
    • Rejected: success(). It skips the job when the title check fails, so the job never reports the failure.
  • What does the command do when the title check is still pending at the wait limit?: It prints a note for the check and reports no problem. plan-check is advisory, and the required Semantic PR title check gates the merge on its own. (best practice) [sources: .github/workflows/pr-title.yml, docs/adr/0004-ci-is-the-authoritative-gate.md]
    • Rejected: Fail at the wait limit. The false failure returns whenever a title check is slow.
    • Chosen: Note and pass. The check is advisory, and the required Semantic PR title check gates the merge on its own.
  • Which wait limit and poll interval does the command use?: The command uses a wait limit of 120 s and a poll interval of 5 s. The job has timeout-minutes: 10. (best practice) [sources: .github/workflows/pr-title.yml]
    • Chosen: 120 s with a 5 s interval. It is under the 10-minute job timeout and longer than a title check takes on a cold runner.
    • Rejected: 30 s with a 5 s interval. A queued runner can take longer than 30 s to start the other title check.
    • Rejected: 600 s with a 5 s interval. It is close to the job timeout and leaves no time for the rest of the command.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-09: partly.
Tool: lewagon/wait-on-check-action (https://github.com/lewagon/wait-on-check-action), MIT, last activity 2026-08-09, maintained.

Activity

  1. added
    source/agent
    type/bug
    scope/ci
    status/new
    value/medium
    effort/low
    on Nov 7, 2026
  2. dan-petty commented on Nov 7, 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/bug. The fix prefix of the title gives the type.
    • Scope: scope/ci. The (ci) scope of the title gives the scope.
    • Priority: P2-Medium. The race causes false CI failures on every plan pull request, but the check still runs and no data is lost.
    • Value: Medium. Developers see incorrect failures on every plan pull request, which wastes review time and erodes trust in CI.
    • Effort: Low. The fix replaces one expression in the workflow file and adjusts the condition to read needs.semantic-title.
    • Related: fix(ci): Plan Check judges the pull request as the event saw it #3829, which asks for a different change. Both fix the plan-check job in pr-title.yml, but #3829 fixes stale title data while this fixes the job starting before semantic-title completes.
  3. added
    priority/p2-medium
    on Nov 7, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 8, 2026
  5. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

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

  6. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    Contributor

    Alternatives check: partly

    Reason: The main fix is a one-line change to the workflow condition, from always() to !cancelled(). Built-in GitHub Actions expressions already cover it, and no tool is needed. The optional poll for a pending Semantic PR title check is partly covered by lewagon/wait-on-check-action, which is maintained and MIT-licensed. It is a workflow step, so it cannot replace the polling inside the Python plan-check command. The "note and pass at the limit" behaviour is also something it does not offer.

    Tool: lewagon/wait-on-check-action (https://github.com/lewagon/wait-on-check-action)

    • License: MIT
    • Last activity: 2026-08-09
    • Maintained: yes

    Covers:

    • Waits for a named check run on a ref to reach a terminal state
    • Runs as a workflow step with a configurable wait interval

    Lacks:

    • Does not change the !cancelled() job condition, which is plain workflow syntax
    • Cannot be called from the Python devops roadmap plan-check command
    • Does not give the 'note and pass at the wait limit' behaviour
    • Does not give the 120 s limit with a 5 s poll that the design asks for

    Tools considered:

    Searches run:

    • GitHub Action wait for check run to complete by name, results: 5

    Sources:

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

  7. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 14, 2026
  8. removed
    status/in-review
    on Nov 14, 2026
  9. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-14 15:02 UTC

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/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions