LearnNewsExamplesConnect
Frontmatter
assigneesneo-gemini-julia
createdAtNov 5, 2026, 5:18 PM
updatedAtNov 5, 2026, 7:05 PM
githubUrlhttps://github.com/neomjs/neo/issues/20344
authorneo-gemini-julia
commentsCount0
parentIssue20328
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 5, 2026, 7:05 PM

Review Admission Mergeability spawns a runner per open PR on every dev push

Closed v13.4.0/archive-v13-4-0-chunk-3 enhancementaiperformancebuild
neo-gemini-julia
neo-gemini-julia commented on Nov 5, 2026, 5:18 PM

Context

Sub-issue of Epic #20328 ("Engine CI runs each tier only when a change can reach it"), coordinated with @neo-opus-grace and @neo-gpt-emmy in neomjs/neo#20328 (#issuecomment-6662846915).

  • Live latest-open sweep: checked latest 20 open issues on neomjs/neo (#20340 down to #20270) at 2026-11-05T16:17Z; no equivalent found (#20329, #20330, #20338, and #20340 cover classifier reachability, selective E2E specs, skipped-tier jobs + Brain tip folding, and pr-baseline.yml concurrency).
  • A2A in-flight claim sweep: checked list_messages({ status: 'all', limit: 30 }) at 2026-11-05T16:17Z; @neo-opus-grace confirmed (MESSAGE:2c695615-05d4-45ef-b0d6-4fe64f5ac1b8) that review-admission-mergeability.yml single-job consolidation and repo-local lint consolidation are owned by @neo-gemini-julia while she folds Resolve the Brain's dev tip into #20338.
  • Memory Core rationale & own-assignment sweep: queried Memory Core (query_raw_memories for review-admission-mergeability runner slots concurrency #17692) and inspected commit 4e6d8da73e (#17692, which introduced two-job discover + publish matrix fan-out to replace per-PR synchronize fan-out); checked open issues assigned to @neo-gemini-julia (#3256 / PR #20324 and #6997 / PR #20323); no overlap.
  • Design authority: Epic #20328 and node_modules/neo-agent-skills/scripts/check-workflow-concurrency.mjs (#17692).

The Problem

The neomjs GitHub organization shares a hard ceiling of 20 concurrent GitHub Actions runner slots across all repositories. Every merge to dev (or completion of PR Review Gate / PR Baseline via workflow_run) triggers .github/workflows/review-admission-mergeability.yml, which currently runs a two-stage VM fan-out:

  1. jobs.discover (Discover open dev pull requests) boots 1 Ubuntu VM to run a 5s github.paginate(github.rest.pulls.list) call and emit matrix.pr ([20155, 20273, ..., 20337]).
  2. jobs.publish (PR (${{ matrix.pr }})) boots 1 separate Ubuntu VM per open dev PR (max-parallel: 4) just to make 3 lightweight GitHub REST API calls (pulls.get, repos.getCombinedStatusForRef, repos.createCommitStatus) that take 5–7s of actual script execution.

Empirical measurement from live dev push run 42057947595 (2026-11-05T15:43:58Z, merge of #20319):

  • Discover open dev pull requests: 5s (15:44:02Z–15:44:07Z) — 1 VM.
  • PR (20155) through PR (20337): 16 separate VMs, each running 5–7s of API calls while waiting in the org runner queue until 15:55:44Z (11m46s wall time, 17 runner jobs total).
  • On every pull_request_target event (opened, reopened, synchronize, ready_for_review), it also boots 2 sequential VMs (discover + 1-element publish matrix) where discover does zero API calls and merely echoes [event.pull_request.number].
  • Additionally, on run 42058372136 (2026-11-05T16:06:10Z), Publish live head mergeability failed on a transient GitHub API 502/500 because actions/github-script@v9 defaults to retries: 0 when retries is omitted.

The Architectural Reality

  • .github/workflows/review-admission-mergeability.yml publishes the commit status context review-admission/mergeability via github.rest.repos.createCommitStatus.
  • Reviewer assignment admission (manage_pr_reviewers(add)) and reusable-pr-review-gate.yml consume the commit status context review-admission/mergeability directly (not the workflow job check-run names Discover open dev pull requests or PR (N); dev branch ruleset 19087298 lists 16 required check contexts and does not require review-admission/mergeability).
  • node_modules/neo-agent-skills/scripts/check-workflow-concurrency.mjs enforces that every workflow file defines top-level concurrency.group and concurrency.cancel-in-progress. Because review-admission-mergeability.yml mutates commit statuses via createCommitStatus, cancel-in-progress must remain false (or scoped by event so a pull_request_target run on PR N and a board sweep do not cancel an in-flight status write).
  • Commit 4e6d8da73e (#17692) previously tested this workflow via an inline script harness in test/playwright/unit/ai/buildScripts/util/WorkflowConcurrency.spec.mjs before #17791 extracted ai/ to neomjs/neo-agent-brain. Restoring and adapting a dedicated unit spec in test/playwright/unit/buildScripts/util/ReviewAdmissionMergeability.spec.mjs provides direct regression coverage in neomjs/neo.

The Fix

  1. Collapse jobs.discover + jobs.publish into a single job (jobs.publish) in .github/workflows/review-admission-mergeability.yml:
    • On pull_request_target, evaluate [context.payload.pull_request.number] directly in the single job (2 VMs → 1 VM).
    • On board triggers (push to dev, workflow_run, workflow_dispatch), paginate open dev PRs (github.paginate(github.rest.pulls.list, { owner, repo, state: 'open', base: 'dev', per_page: 100 })) and evaluate them inside the same job with bounded in-process concurrency (MERGEABILITY_CONCURRENCY: '4') (1 + N_open_PRs VMs → 1 VM, saving 16 runner slots on every dev merge today and finishing in ~15–25s instead of 11m46s).
    • Add retries: 3 to actions/github-script@v9 so transient GitHub 500/502/503 responses on status queries/writes are automatically retried.
    • Scope top-level concurrency.group to review-admission-mergeability-${{ github.event_name == 'pull_request_target' && github.event.pull_request.number || 'board' }} with cancel-in-progress: false so single-PR runs and board runs do not block each other while preserving check-workflow-concurrency.mjs compliance.
  2. Add unit test coverage (test/playwright/unit/buildScripts/util/ReviewAdmissionMergeability.spec.mjs):
    • Verify single-job topology (no jobs.discover, no matrix fan-out on jobs.publish, retries: 3 on actions/github-script@v9, cancel-in-progress: false).
    • Verify functional execution of jobs.publish across pull_request_target (single PR) and board triggers (push / workflow_run multi-PR pagination with bounded concurrency, preserving held review-gate/decision and pr-baseline/status requirements before publishing review-admission/mergeability).

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
.github/workflows/review-admission-mergeability.yml (jobs.publish) Epic #20328 & review-admission/mergeability status contract (manage_pr_reviewers / reusable-pr-review-gate.yml) Single job resolves [eventPr] on pull_request_target or paginates open dev PRs on board triggers and publishes review-admission/mergeability for each PR with bounded in-process concurrency (4) and retries: 3 If any single PR fails after retries, record the error and fail the job after completing the remaining PRs in the batch Workflow comments in .github/workflows/review-admission-mergeability.yml test/playwright/unit/buildScripts/util/ReviewAdmissionMergeability.spec.mjs + node node_modules/neo-agent-skills/scripts/check-workflow-concurrency.mjs
  • Decision Record impact: none

Acceptance Criteria

  • .github/workflows/review-admission-mergeability.yml runs a single job (jobs.publish) with no jobs.discover or per-PR matrix VM fan-out (1 runner job per pull_request_target event and 1 runner job per dev push / workflow_run / workflow_dispatch event regardless of open PR count).
  • actions/github-script@v9 in .github/workflows/review-admission-mergeability.yml configures retries: 3.
  • node node_modules/neo-agent-skills/scripts/check-workflow-concurrency.mjs passes (Checked 36 workflow file(s); concurrency policy holds.).
  • Unit test test/playwright/unit/buildScripts/util/ReviewAdmissionMergeability.spec.mjs verifies both the single-job workflow contract and the runtime behavior for pull_request_target and multi-PR board sweeps.

Out of Scope

  • Changing the review-admission/mergeability commit status semantics, required upstream contexts (review-gate/decision, pr-baseline/status), or dev branch ruleset 19087298.
  • Modifying test-e2e-brain.yml, classify-test-scope.yml (#20338), pr-baseline.yml (#20340 / Skills #281), or repo-local lint workflows (tracked in sibling leaf under #20328).

Avoided Traps

  • Do not enable cancel-in-progress: true on review-admission-mergeability.yml: Because this workflow mutates commit statuses via createCommitStatus, cancelling an in-flight board sweep mid-loop could leave later open PRs with stale pending mergeability status after a dev advance (#17692).
  • Do not use unbounded Promise.all across all open PRs: Bounded concurrency (4 workers inside the single Node process) respects GitHub secondary rate limits while still completing 16 PRs in <15s inside one runner VM.

Related

Origin Session ID: c5b059c4-5d96-46f1-8c61-184af74d34b4 Retrieval Hint: "review-admission-mergeability.yml discover publish matrix 17 runner slots #20328"