Skip to content

fix(security): scope the gate to the package being changed - #85

Merged
ry-ops merged 1 commit into
mainfrom
fix/gate-scope-per-package
Jun 25, 2026
Merged

fix(security): scope the gate to the package being changed#85
ry-ops merged 1 commit into
mainfrom
fix/gate-scope-per-package

Conversation

@ry-ops

@ry-ops ry-ops commented Jun 25, 2026

Copy link
Copy Markdown
Owner

The bug (found reviewing DriveIQ's open PRs)

Per-package remediation (#84) scoped the fix to one package but the gate still built all packages and rolled up to one verdict. So DriveIQ's docker-extension/ui β€” which has a pre-existing build break (vite@7.3.6 vs @vitejs/plugin-react peer conflict) unrelated to any fix β€” held the backend and frontend PRs at NO-GO too. All three per-package PRs failed for the same unrelated reason; nothing could auto-merge.

Fix

  • run-gate.mjs gains --scope <dir>: filter discovered packages to the one at that manifest dir, so the gate verifies only the package the PR changed.
  • verify-functional-form.yml takes a scope input β†’ passes --scope.
  • security-fix-worker.yml passes package_dir as scope.

Now backend's PR builds only backend (clean β†’ GO β†’ auto-merge), frontend builds only frontend (clean β†’ GO β†’ auto-merge), and only docker-extension/ui is held β€” its genuine break, with the reason on the PR.

Verified

Synthetic monorepo (backend breaks): --scope frontend β†’ GO, --scope backend β†’ NO-GO. No cross-contamination. Build clean, 42 tests pass.

πŸ€– Generated with Claude Code

Per-package PRs (#84) were all held NO-GO for the SAME unrelated reason:
the worker scoped the FIX to one package, but the gate still built ALL
packages and rolled up β€” so docker-extension/ui's pre-existing build
break (vite/plugin-react peer conflict) held DriveIQ's backend and
frontend PRs too, even though neither touched it. The per-package split
was defeated.

run-gate.mjs gains `--scope <dir>`: gate ONLY the package at that
manifest dir. The reusable gate workflow takes a `scope` input and the
worker passes `package_dir`, so each per-package PR is verified against
its own package alone.

Verified: on a synthetic monorepo where backend breaks, `--scope
frontend` returns GO (would auto-merge) while `--scope backend` returns
NO-GO β€” no cross-contamination.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ry-ops
ry-ops merged commit b50966c into main Jun 25, 2026
2 checks passed
@ry-ops
ry-ops deleted the fix/gate-scope-per-package branch June 25, 2026 11:36
ry-ops added a commit that referenced this pull request Jun 25, 2026
…86)

scopem/ was a local synthetic monorepo used to validate --scope; it was
created in the project dir by mistake and committed. Not part of the
codebase.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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