Skip to content

Name the Single-Line If Requirement in the Schedule Concurrency Drift Message #2889

Closed

Description

@ptr727

Problem

concurrency_caller_findings in spec/audit.py reports a publisher that gives a schedule run its own concurrency group but whose schedule it cannot read as never publishing. The DRIFT message names what it needs as "a dispatch test in each build-release-task.yml job's if:".

_schedule_never_publishes reads only a single-line job-level if:. A block scalar such as if: >- reduces to an empty condition there, so a release job folding a long condition that way fails the check even when the dispatch conjunct is present.

Impact

An adopter whose release job carries github.event_name == 'workflow_dispatch' inside an if: >- block gets a DRIFT message that names a requirement the job already meets, with no hint that the folded form is the cause.

Suggested fix

Name the single-line requirement in the DRIFT message, matching WORKFLOW.md D4.1, or teach _schedule_never_publishes to read a folded or literal block scalar.

Found while: the local review of the D4.1 dispatch-guard documentation change.

🤖 Generated with Claude Code

Activity

  1. ptr727 commented on Oct 12, 2026

    @ptr727
    OwnerAuthor

    The premise here does not hold on develop. _schedule_never_publishes does not reduce a block-scalar if: to an empty condition. It reads the folded form in full.

    • _code_view in spec/audit.py keeps a block-scalar if: body and folds it onto the key line. Its docstring says so: "A block-scalar if: body, the form the Workflow YAML convention sets for a multi-line condition, is kept", and "It is folded onto the key line, so a token the condition wraps across two lines still matches whole."
    • The --selftest concurrency cases include "a folded dispatch gate" (if: >- with github.event_name == 'workflow_dispatch' && on the next line) and "a folded dispatch gate with a comment on its key line". Both expect 0 findings, and both pass.

    So the current DRIFT message ("a dispatch test in each build-release-task.yml job's if:") is accurate. Naming a single-line requirement there would make it false.

    The real defect was in WORKFLOW.md D4.1. It required the guard in "a single-line if:", which contradicts the if: >- form D9.3 and GOVERNANCE.md "Workflow YAML Conventions" set for a multi-line condition. The fix aligns D4.1 with the parser instead of the message: D4.1 now reads "an && term of its job-level if: holding no || or negated group". The audit message stays unchanged. That change lands in the pull request closing this issue.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions