Skip to content

Skip the local test step in final runs for dev-bound PRs - #52

Merged
uayyagari merged 2 commits into
mainfrom
fm/nm-dev-review-only
Oct 27, 2026
Merged

uayyagari merged 2 commits into
mainfrom
fm/nm-dev-review-only

Conversation

@uayyagari

@uayyagari uayyagari commented Oct 26, 2026 •

Copy link
Copy Markdown

Problem

  • A local final no-mistakes run repeats the unit and integration tests that GitHub CI already runs for a dev-bound PR.
  • On 2026-10-26 at 21:24 IST, three local final runs pushed machine load to 84, and PR 750's local test step hung twice (45 and 31+ min) while its GitHub CI was 7/7 green.
  • Skipping the step by hand relies on each worker remembering it.

Fix

  • New PreToolUse check bin/fm-nm-base-skip-pretool-check.sh runs before a worker starts a new no-mistakes axi run --intent ....
  • It reads the PR base from --base-branch, else from the forge (gh pr view).
  • Base dev (set FM_NM_TEST_SKIP_BASES to change): the run must carry --skip test, or the command is refused with the exact flag to add. Review, document and lint still run.
  • Any other base (main): the run must not skip test; the full run keeps its tests.
  • Base unreadable: allowed unchanged, so the full run with tests stays the default.
  • bin/fm-op-guard-install.sh registers it beside the existing guards. It uses no-mistakes' own --skip flag; no-mistakes is not patched.
  • Out of scope: GitHub CI workflows, merge rules, quota items.

Worked example (PR 750, base dev):

  1. Worker runs no-mistakes axi run --intent "...".
  2. The check asks the forge: base is dev, no --skip test.
  3. It refuses and names the fix; the worker re-runs with --skip test, and the run does review, document and lint only.
before: dev PR  -> axi run            -> review, test (hangs 30-45 min), document, lint
after:  dev PR  -> axi run            -> refused, "add --skip test"
        dev PR  -> axi run --skip test -> review, document, lint
        main PR -> axi run            -> review, test, document, lint (unchanged)
        main PR -> axi run --skip test -> refused, "keep the test step"
        base unknown -> axi run        -> full run, unchanged

Proof

  • tests/fm-nm-base-skip-pretool-check.test.sh (stub forge): dev without skip refused, dev with --skip test or a list holding it allowed, testing does not count, main without skip allowed, main with --skip test refused, unknown base allowed, --base-branch overrides, only new runs checked, hook payload, installer registers it. All pass.
  • Direct run of the check: base=dev skip=[] -> rc=2, base=dev skip=[--skip test] -> rc=0, base=main skip=[] -> rc=0, base=main skip=[--skip test] -> rc=2.
  • tests/fm-op-pretool-check.test.sh (hook count now 3) and tests/fm-nm-mirror-pretool-check.test.sh pass; bin/fm-lint.sh clean.

Fork footprint vs upstream main

  • Upstream files touched by this change: 0 (+0/-0 lines vs upstream)
  • Upstream files the fork already modifies on origin/main: 67 of 194 changed files (+15356/-273 lines, includes fork-only files)
  • Result: ok

Add a PreToolUse check that reads the PR base and requires --skip test on a dev base, and refuses it on any other base. An unreadable base keeps the full run.
@uayyagari
uayyagari merged commit 40ed1f9 into main Oct 27, 2026
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