Skip to content

Builds of closed PRs and deleted branches stop waiting for review (sc-8797) - #31

Merged
ndbroadbent merged 4 commits into
mainfrom
closed-builds
Dec 2, 2026
Merged

ndbroadbent merged 4 commits into
mainfrom
closed-builds

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

sc-8797. Builds of pull requests closed without merging, and of deleted branches, stayed in waiting_for_review, whoami and the waiting counts forever. In VisualCI's own project, that's #79 (sc-8709), #53 and #56 (qa/sticky-comment) and #5 (sc-8336-dogfood).

  • Events:
    • ForgeEvent::Closed { branch, why }:
      • GitHub pull_request closed without merging, delete of a branch, or a push with deleted: true;
      • GitLab merge request close, or a push whose after is all zeros.
    • ForgeEvent::Reopened: GitHub reopened, GitLab reopen.
    • Fork branches are named as for merges (octocat:main, <fork path>:<branch>).
  • Closing:
    • The branch's builds waiting for review become closed (migration 000040 adds it to the review state constraint), with a warning: "Closed without review: the pull request was closed without merging" or "…the branch was deleted".
    • They leave the waiting lists, which only count pending. Their check becomes neutral, "Closed without review", and the PR comment says "closed without review".
    • The web app shows a "closed" pill. Merged PRs are unchanged (supersede and merged approvals cover them).
  • Reopening: the branch's newest closed build waits again, without the note. Older ones stay closed, since the newest covers them.
  • Which projects: GitHub acts on every project linked to the repository, as for merges. A GitLab hook acts on its own project only, the same rule as merges (sc-8721).
  • GitLab: the project hook now subscribes to push events too, for branch deletions; other pushes are ignored. The next forge sync updates existing hooks.
  • Deleted branches without a pull request: the app has no Contents permission, so GitHub doesn't send delete or push events, and adding the permission would ask every installation for more access. Instead, the hourly forge:sync asks the forge whether each branch with builds waiting still exists, and closes the builds of those that are gone.
    • It asks at most once a day per branch (branch_checks, in migration 000040) and at most 500 branches a run, and only for branches with CI builds waiting. Fork branches aren't asked.
    • GitHub's "get a branch" needs only the Metadata permission the app has.
    • A project the forge can't be asked about is skipped, and asked again on the next run.
    • The delete/push parsing stays, in case the app is ever subscribed.
  • Docs: the agents page says a closed PR or deleted branch takes its builds off the waiting lists. Skills regenerated, plugin 0.1.30. Local builds that are never finalized finish quietly instead of failing (sc-8795) #24 and Docs: CLI 0.2.10, visualci test and the review commands #28 also bump to 0.1.30, so whichever merges later moves on.

Tests:

  • The request test makes three waiting builds (two on feature, one on other).
    • Closing the PR closes feature's two, with the note; the other stays, and the project's waiting count drops to 1.
    • Reopening puts back the newest only, without the note.
    • A delete closes it again with the branch note, and a push with deleted: true closes other.
    • The check is neutral, "Closed without review".
  • Parser unit tests for GitHub and GitLab: closed, reopened, deleted branch; tags and normal pushes are ignored.
  • The daily branch check skips a project it can't ask, without closing its builds or marking the branch checked.
  • The full workspace suite and clippy pass on docspring-dev.

Review: no screenshots change.

@visualci-com

visualci-com Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #140 · 302 unchanged · no changes

This PR vs base: nothing since #132, across 3 builds

Updated as builds change. Agents can review with VisualCI's MCP tools.

…review (sc-8797): a pull request closed without merging (GitHub, GitLab) makes its branch's pending builds closed, with a note, a neutral 'Closed without review' check and a closed pill, and reopening puts the newest back; the hourly forge sync closes the builds of branches deleted without one (asked once a day per branch; Metadata permission is enough); migration 000040; docs and plugin
@ndbroadbent
ndbroadbent merged commit 9addb28 into main Dec 2, 2026
10 checks passed
@ndbroadbent
ndbroadbent deleted the closed-builds branch December 2, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant