Skip to content

id-gate: run batch evaluations inside pkgs/id's nix dev shell - #12516

Merged
dezren39 merged 1 commit into
mainfrom
archer-lane-g/12229-gate-shell
Nov 22, 2026
Merged

dezren39 merged 1 commit into
mainfrom
archer-lane-g/12229-gate-shell

Conversation

@dezren39

@dezren39 dezren39 commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

What

The id gate's default runner (scripts/id/gate.py) ran batch commands under fleet shell --build. Batch 1 (#12229) died in the wayland-sys build script there — that shell lacks the wayland client libraries, so the batch was infrastructure-red and PR #12470's code was never evaluated. The manual re-evaluation of the same candidate inside nix develop in pkgs/id went green (cargo check passed, 58/59 suites).

This changes the runner seam (renamed _run_fleet → _run_devshell) to enter nix develop of the candidate's pkgs/id — the flake that wires wayland/X11 via pkgs/id/nix-common.nix — and passes the batch command through verbatim from the candidate root, so the JSONL gate log keeps recording the exact command that ran.

Unchanged semantics

Planner, affected-crate selection, bisect, merge-green via gh pr merge --merge, JSONL log format, and the ID_GATE_OFF kill switch (gate_enabled()) are untouched.

Tests (oracle: the batch-1 failure record)

  • 3 new DevShellRunnerTests: the runner invokes nix develop against <candidate>/pkgs/id; the batch command reaches bash -c byte-for-byte; the exit code propagates. Written failing-first (3 errors before the fix).
  • All 21 pre-existing tests (17 in test_gate.py, 4 in test_affected_crates.py) pass unchanged — including the kill-switch tests (test_gate_off_plans_nothing, test_gate_off_runs_nothing) and the bisect suite, which cover the paths this change must not affect.

Total: 24 tests, all passing locally (python3 -m unittest discover -s scripts/id).

Refs #12229 — this is the driver fix the issue's manual-evaluation comment names as still owed. It does not itself count toward criterion 2; counting starts with batches run through the fixed driver in production cadence.


Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Chores
    • Batch commands now run in the candidate’s development environment instead of on the fleet build host.
    • The command runs from the candidate’s repository directory, and its exit status is preserved.

…12229)

Batch 1 died in the wayland-sys build script under `fleet shell
--build`: that shell lacks the wayland client libraries pkgs/id's
workspace needs. pkgs/id's own flake wires them (nix-common.nix), and
the manual re-evaluation of batch 1's candidate in that shell went
green. The default runner seam now enters `nix develop` of the
candidate's pkgs/id and passes the batch command through verbatim, so
the JSONL log keeps recording the exact command that ran. Planner,
bisect, merge and kill-switch semantics are unchanged; the 21
pre-existing tests pass as written, plus 3 new runner-oracle tests.
@dezren39
dezren39 requested a review from a team as a code owner November 22, 2026 11:59
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T12:01:23.767035Z 3912ab0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Batch commands now run by default in the candidate repository’s pkgs/id Nix development shell instead of on the fleet build host. Tests verify the working directory, command invocation, and exit-code handling.

Changes: Batch Runner

Layer / File(s) Summary
Run batches in the candidate dev shell
scripts/id/gate.py, scripts/id/test_gate.py
run_batch now defaults to _run_devshell, which invokes the batch command through nix develop for pkgs/id. Tests check the working directory, command arguments, and return-code propagation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

Merge Risk: Minimal · up to 3912a

The id gate now runs batch evaluations inside the pkgs/id Nix dev shell instead of the fleet build host. No concrete problems were found, and the new tests cover the runner's behavior, so the change looks ready to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "id-gate: run batch evaluations inside pkgs/id's nix dev shell" matches the main change. The PR changes the id gate's default batch runner from the fleet shell to a nix develop runner for …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "id-gate: run batch evaluations inside pkgs/id's nix dev shell" matches the main change. The PR changes the id gate's default batch runner from the fleet shell to a nix develop runner for the candidate's pkgs/id flake. The title names the component, the action, and the target environment. Its scope fits the changeset, which adds _run_devshell, switches run_batch to use it, and adds tests for it.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 743d110c-ec00-40e5-9236-b7996e68b4cf
Commits

Reviewing files that changed from the base of the PR and between fe428de and 3912ab0.

Files selected for processing: 2

  • scripts/id/gate.py
  • scripts/id/test_gate.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3912ab03d2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/id/gate.py
"develop", str(root / "pkgs" / "id"),
"--command", "bash", "-c", command,
]
result = subprocess.run(argv, cwd=root)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve the build lock around the nix dev-shell invocation

When the gate runs on the laptop, this direct invocation bypasses the concurrency lock and Cargo target-broker lease previously supplied by fleet shell --build. The command's documented --build behavior is to “take a fleet-build-lock slot” (pkgs/fleet/crates/fleet-agent/src/shell.rs, implemented by local_build_line and under_build_lock). Without it, batch checks and tests compete with other fleet builds outside the shared limit and, absent an inherited target override, rebuild into each disposable candidate's target directory rather than reusing the broker's warm cache. Keep the new nix environment, but execute it through the build-lock wrapper as required by the repository's laptop build discipline.

AGENTS.md reference: AGENTS.md:L30-L32

Useful? React with 👍 / 👎.

@dezren39
dezren39 merged commit 164556e into main Nov 22, 2026
2 checks passed
@dezren39
dezren39 deleted the archer-lane-g/12229-gate-shell branch November 22, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant