Skip to content

fix: treat failing commit statuses and pending checks as preflight blockers #340

Description

@SebTardif

External merge preflight can clear a pull request whose required commit status is red, or whose checks are still running.

From reading scripts/preflight-external-pr-merge.mjs and from node --test --test-name-pattern "legacy status|pending checks" test/preflight-external-pr-merge.test.mjs. This was not reproduced against a live pull request.

isFailingCheck counted a rollup entry as failing only when status was COMPLETED or SUCCESS and conclusion was a non-passing value. A GitHub status context uses state (FAILURE, ERROR, PENDING) and has no conclusion. An in-progress CheckRun uses IN_PROGRESS. Both returned false. isAcceptableMergeState then accepted UNSTABLE, BLOCKED, or BEHIND when mergeable was MERGEABLE, and an empty blocker list continued into security_status: "cleared".

apply-result.mjs validateStatusChecks already blocks FAILURE / ERROR states and pending checks. The inventory copy of isFailingCheck in scripts/import-github-pr-inventory.mjs had the same predicate.

The fork branch treats only SUCCESS, and COMPLETED with a passing conclusion (SUCCESS, SKIPPED, NEUTRAL), as clean. Ignored checks stay ignored.

Upstream pull requests are limited to collaborators (pull_request_creation_policy is collaborators_only), so the patch is on the fork:

Activity

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

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions