Skip to content

ci: scope boundary enforcement for repo-health PRs#826

Merged
diberry merged 2 commits intodevfrom
repo-health/scope-boundary-check
Apr 5, 2026
Merged

ci: scope boundary enforcement for repo-health PRs#826
diberry merged 2 commits intodevfrom
repo-health/scope-boundary-check

Conversation

@diberry
Copy link
Copy Markdown
Collaborator

@diberry diberry commented Apr 4, 2026

  • Remove || true from git diff (applied in prior commit)
  • Replace hardcoded package paths with generic grep -E '^packages/[^/]+/src/' pattern so future packages are automatically covered

Copilot AI review requested due to automatic review settings April 4, 2026 18:44
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 4, 2026

🟡 Impact Analysis — PR #826

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 2
Files added 2
Files modified 0
Files deleted 0
Modules touched 2

🎯 Risk Factors

  • 2 files changed (≤5 → LOW)
  • 2 modules touched (2-4 → MEDIUM)

📦 Modules Affected

ci-workflows (1 file)
  • .github/workflows/squad-scope-check.yml
root (1 file)
  • .changeset/scope-boundary-check.md

This report is generated automatically for every PR. See #733 for details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 4, 2026

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit 877b896

PR Scope: 🔧 Infrastructure

⚠️ 3 item(s) to address before review

Status Check Details
Single commit 2 commits — consider squashing before review
Not in draft Ready for review
Branch up to date Up to date with dev
Copilot review No Copilot review yet — it may still be processing
Changeset present Changeset file found
Scope clean No .squad/ or docs/proposals/ files
No merge conflicts No merge conflicts
Copilot threads resolved 0 active Copilot thread(s) resolved (2 outdated skipped)
CI passing 12 check(s) still running

Files Changed (2 files, +39 −0)

File +/−
.changeset/scope-boundary-check.md +8 −0
.github/workflows/squad-scope-check.yml +31 −0

Total: +39 −0


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 4, 2026

🏗️ Architectural Review

⚠️ Architectural review: 1 info.

Severity Category Finding Files
ℹ️ info template-sync Template files changed in .github/workflows/ but not in other template locations. If these templates should stay in sync, consider updating the others too. Changed: .github/workflows/, Unchanged: templates/, .squad-templates/, packages/squad-cli/templates/

Automated architectural review — informational only.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an automated scope guard to ensure “repo-health” pull requests don’t accidentally include product source code changes under packages/*/src/.

Changes:

  • Introduces a new GitHub Actions workflow to fail repo-health PRs that modify product source directories.
  • Documents repo-health vs product PR scope rules in Copilot instructions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/squad-scope-check.yml New CI job that detects product source changes in repo-health PRs and fails the workflow.
.github/copilot-instructions.md Adds explicit written rules for repo-health PR scope boundaries.

Comment thread .github/workflows/squad-scope-check.yml Outdated
Comment thread .github/workflows/squad-scope-check.yml Outdated
@diberry diberry force-pushed the repo-health/scope-boundary-check branch from a03b460 to 7549337 Compare April 4, 2026 23:20
@diberry
Copy link
Copy Markdown
Collaborator Author

diberry commented Apr 4, 2026

@copilot review

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

@copilot review

Applied the remaining improvement from the reviewer suggestions in commit 19e0748: replaced the hardcoded packages/squad-cli/src/ and packages/squad-sdk/src/ path specs with grep -E '^packages/[^/]+/src/' so the scope gate automatically covers any future packages added to the monorepo. The || true after grep is intentional — it prevents a false failure when there are simply no matching files, while leaving git diff's stderr unsuppressed so real ref/fetch errors still surface.

@diberry diberry force-pushed the repo-health/scope-boundary-check branch from 19e0748 to 694caf7 Compare April 4, 2026 23:42
Copy link
Copy Markdown
Collaborator

@tamirdresher tamirdresher left a comment

Choose a reason for hiding this comment

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

✅ LGTM — Clean blocking scope check for repo-health PRs. Will need rebase after #825 (both touch copilot-instructions.md).

Add CI check that fails when repo-health PRs include product source
code changes under packages/*/src/. Prevents scope creep where
infrastructure PRs accidentally touch product code.

- Add squad-scope-check.yml workflow
- Document PR scope rules in copilot-instructions.md
- Fail loudly on git diff errors instead of silently passing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry diberry force-pushed the repo-health/scope-boundary-check branch from 694caf7 to e4d561b Compare April 5, 2026 18:17
@diberry diberry merged commit a8e8230 into dev Apr 5, 2026
19 checks passed
tamirdresher added a commit that referenced this pull request Apr 8, 2026
)

* feat(ci): add file list with line stats, scope badge, and check subtitles to PR readiness (#813)

- Add file list table with per-file +additions/-deletions stats
- Add PR scope classification (Product/Infrastructure/Mixed)
- Rename Architectural Review and Security Review checks with descriptive subtitles

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* ci: scope boundary enforcement for repo-health PRs (#826)

Add CI check that fails when repo-health PRs include product source
code changes under packages/*/src/. Prevents scope creep where
infrastructure PRs accidentally touch product code.

- Add squad-scope-check.yml workflow
- Document PR scope rules in copilot-instructions.md
- Fail loudly on git diff errors instead of silently passing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* ci: smart PR nudge for stale PRs (#827)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test: add cross-package export smoke test to catch missing imports

Validates every value import squad-cli uses from squad-sdk resolves to
a defined export at runtime.  Covers 15 SDK subpaths and 50+ named
exports including FSStorageProvider, SquadClient, CastingEngine,
RalphMonitor, and all resolution/config/platform helpers.

Also verifies that every entry in the SDK package.json exports map
points to a file that actually exists on disk.

Motivation: v0.9.3-insider.1 shipped with FSStorageProvider missing
from the SDK barrel — broke users at runtime while all TS-level tests
passed (TypeScript resolves from source, not compiled output).

Refs: #836

---------

Co-authored-by: Dina Berry (MSFT) <diberry@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
tamirdresher added a commit that referenced this pull request Apr 21, 2026
)

* feat(ci): add file list with line stats, scope badge, and check subtitles to PR readiness (#813)

- Add file list table with per-file +additions/-deletions stats
- Add PR scope classification (Product/Infrastructure/Mixed)
- Rename Architectural Review and Security Review checks with descriptive subtitles

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* ci: scope boundary enforcement for repo-health PRs (#826)

Add CI check that fails when repo-health PRs include product source
code changes under packages/*/src/. Prevents scope creep where
infrastructure PRs accidentally touch product code.

- Add squad-scope-check.yml workflow
- Document PR scope rules in copilot-instructions.md
- Fail loudly on git diff errors instead of silently passing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* ci: smart PR nudge for stale PRs (#827)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test: add cross-package export smoke test to catch missing imports

Validates every value import squad-cli uses from squad-sdk resolves to
a defined export at runtime.  Covers 15 SDK subpaths and 50+ named
exports including FSStorageProvider, SquadClient, CastingEngine,
RalphMonitor, and all resolution/config/platform helpers.

Also verifies that every entry in the SDK package.json exports map
points to a file that actually exists on disk.

Motivation: v0.9.3-insider.1 shipped with FSStorageProvider missing
from the SDK barrel — broke users at runtime while all TS-level tests
passed (TypeScript resolves from source, not compiled output).

Refs: #836

---------

Co-authored-by: Dina Berry (MSFT) <diberry@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.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.

4 participants