Skip to content

ci: PR contamination prevention guard#825

Merged
tamirdresher merged 2 commits intodevfrom
repo-health/contamination-guard
Apr 5, 2026
Merged

ci: PR contamination prevention guard#825
tamirdresher merged 2 commits intodevfrom
repo-health/contamination-guard

Conversation

@diberry
Copy link
Copy Markdown
Collaborator

@diberry diberry commented Apr 4, 2026

Adds:

  • Diff Size Guard job in squad-repo-health.yml that warns when single-commit PRs touch 30+ files (likely contamination from stale branches)
  • Branch contamination prevention rules in copilot-instructions.md (safe branching, no git reset --soft, safe squashing)
  • Diff verification checklist item in PR template

Prevents the recurring issue where git add -A on stale branches contaminates PRs with unrelated changes.

Repo-health PR — no product code changes.

Copilot AI review requested due to automatic review settings April 4, 2026 18:42
@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 4fa0d5b

⚠️ 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 (3 outdated skipped)
CI passing 14 check(s) still running

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

🟡 Impact Analysis — PR #825

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 5
Files added 1
Files modified 4
Files deleted 0
Modules touched 2

🎯 Risk Factors

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

📦 Modules Affected

ci-workflows (3 files)
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/copilot-instructions.md
  • .github/workflows/squad-repo-health.yml
root (2 files)
  • .changeset/contamination-guard.md
  • CONTRIBUTING.md

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

@diberry diberry force-pushed the repo-health/contamination-guard branch from fef41a1 to e8c3f65 Compare April 4, 2026 18:45
@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.

@diberry diberry changed the title docs: changeset requirement visibility ci: PR contamination prevention guard Apr 4, 2026
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

Improves contributor guidance to reduce missing changesets by adding prominent reminders in the PR template and expanding Copilot repository instructions around changesets and PR hygiene.

Changes:

  • Added a “Quick Check” changeset reminder and an additional diff-verification item to the PR template checklist.
  • Added branch hygiene guidance (“Branch Contamination Prevention”) to Copilot instructions.
  • Added PR scope rules and a detailed “Changeset Requirement” section (including examples and an escape hatch) to Copilot instructions.

Reviewed changes

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

File Description
.github/PULL_REQUEST_TEMPLATE.md Adds a prominent changeset reminder and an extra checklist item to verify staged diff contents.
.github/copilot-instructions.md Adds new sections for branch hygiene, PR scoping rules, and changeset requirements with examples.

Comment thread .github/PULL_REQUEST_TEMPLATE.md Outdated
Comment thread .github/copilot-instructions.md Outdated
Comment thread .github/copilot-instructions.md Outdated
@diberry diberry force-pushed the repo-health/contamination-guard branch 2 times, most recently from c5f3597 to 9d0da67 Compare April 4, 2026 23:43
- Add Diff Size Guard job to squad-repo-health.yml that warns when
  single-commit PRs touch 30+ files (likely contamination)
- Add branch contamination prevention rules to copilot-instructions.md
- Add diff verification checklist item to PR template

Prevents the recurring issue where git add -A on stale branches
contaminates PRs with unrelated changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry diberry force-pushed the repo-health/contamination-guard branch from 9d0da67 to e166f13 Compare April 5, 2026 00:28
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 — Warning-only diff guard is the right approach. Heuristic (≤2 commits + >30 files) catches the real contamination pattern without blocking legitimate large PRs. Branch hygiene rules in copilot-instructions and PR template checkbox are good additions.

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 — Warning-only diff guard catches contamination. Branch hygiene rules and PR template checkbox are good additions.

@tamirdresher tamirdresher merged commit 05b40c8 into dev Apr 5, 2026
17 checks passed
@tamirdresher tamirdresher deleted the repo-health/contamination-guard branch April 5, 2026 06:00
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.

3 participants