Skip to content

feat(ci): automated PR readiness checks — contributor feedback before review - #752

Merged
diberry merged 1 commit into
devfrom
squad/750-pr-readiness-checks
Apr 3, 2026
Merged

diberry merged 1 commit into
devfrom
squad/750-pr-readiness-checks

Conversation

@diberry

@diberry diberry commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

What

Adds an automated PR readiness check system that posts a checklist comment on every PR, telling contributors exactly what needs fixing before review.

Closes #750

Why

Contributors open PRs that aren't review-ready (draft, unsquashed commits, stale branch, missing changeset, etc.). Brady has to manually check and comment on each one. This workflow automates that feedback loop — contributors get immediate, actionable guidance.

How

Approach: GitHub Action with PR comment (evaluated 3 approaches — see docs/proposals/pr-readiness-checks.md for full analysis).

Workflow (squad-pr-readiness.yml):

  • Runs on pull_request events (opened, synchronize, reopened, edited, ready_for_review)
  • Evaluates 7 readiness checks via GitHub API
  • Posts/updates a single checklist comment (no spam — uses HTML comment marker for upsert)
  • Informational only — does not block merge

7 Checks:

  1. Single commit (or squashable)
  2. Not in draft
  3. Branch up to date with target
  4. Copilot review present
  5. Changeset present (respects skip-changelog label)
  6. No merge conflicts
  7. CI passing

Also includes:

  • Proposal doc at docs/proposals/pr-readiness-checks.md
  • Updated CONTRIBUTING.md with PR Readiness Checklist section
  • Changeset

Testing

  • Workflow validated via YAML syntax
  • npm run build passes
  • npm test passes

Docs

  • CONTRIBUTING.md updated with PR Readiness Checklist section
  • Proposal doc at docs/proposals/pr-readiness-checks.md

Exports

N/A — no SDK changes

Breaking Changes

None

Waivers

None needed

Copilot AI review requested due to automatic review settings April 2, 2026 17:44
@github-actions

github-actions Bot commented Apr 2, 2026 •

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

⚠️ 2 item(s) to address before review

Status Check Details
❌ Single commit (or squashable) 2 commits — consider squashing before review (or repo will squash on merge)
✅ 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
✅ No merge conflicts No merge conflicts
✅ CI passing No CI checks have run yet

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 “PR readiness” GitHub Action that posts/updates a single checklist comment on PRs, aiming to give contributors fast, actionable feedback before human review.

Changes:

  • Added a new workflow (squad-pr-readiness.yml) that evaluates PR readiness signals via GitHub API and upserts a checklist comment.
  • Documented the approach in a proposal doc and added a PR readiness section to CONTRIBUTING.
  • Added a Changesets entry (currently targeting @bradygaster/squad-cli).

Reviewed changes

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

File Description
docs/proposals/pr-readiness-checks.md Proposal documenting rationale/approach and intended behavior of readiness checks.
CONTRIBUTING.md Adds contributor-facing PR readiness checklist section.
.github/workflows/squad-pr-readiness.yml Implements the readiness checks and PR comment upsert workflow.
.changeset/pr-readiness-checks.md Declares a package version bump related to this change.

Comment thread .changeset/pr-readiness-checks.md Resolved
Comment thread docs/proposals/pr-readiness-checks.md Resolved
diberry added a commit that referenced this pull request Apr 2, 2026
Address all 12 Copilot review comments on PR #752:

- Add issues: write permission for comment upserts
- Switch to pull_request_target with safety guards (no checkout)
- Rename 'Single commit (or squashable)' to 'Single commit'
- Fix reversed compareCommitsWithBasehead base/head order
- Use latest review per user instead of find() for Copilot review
- Accept CHANGELOG.md edits in changeset check (match changelog-gate)
- Model CI pending/no-checks as not-passing (don't mark ready early)
- Use absolute repo URLs instead of broken relative links
- Add pagination via github.paginate for comments, commits, reviews, files
- Remove unnecessary changeset (no CLI code changes)
- Fix fork-safe claim in proposal docs
- Remove unnecessary actions/checkout step

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
diberry added a commit that referenced this pull request Apr 2, 2026
Wraps checks.listForRef in github.paginate() to handle PRs with 100+
check runs, matching the pagination pattern already used for commits,
reviews, files, and comments in the same workflow.

Closes #752

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
diberry added a commit that referenced this pull request Apr 2, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
diberry added a commit that referenced this pull request Apr 2, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tamirdresher

Copy link
Copy Markdown
Collaborator

Really useful for Brady's workflow - automates all the 'is this PR ready?' feedback he gives manually today.

Two things before merge:

  1. Needs squash - 10 commits is too many for this
  2. Needs rebase on dev (behind)

One suggestion from looking at microsoft/aspire: they also have a pull_request_template.md with static checkboxes that contributors see at PR creation time. Your bot comment validates dynamically which is better, but having both layers would be nice - template gives the checklist upfront, bot validates it. Could be a quick follow-up.

Content-wise this is solid. Fix the above and it's good to go.

@diberry

diberry commented Apr 3, 2026

Copy link
Copy Markdown
Contributor Author

📁 Files in this PR

# File Status
1 .github/workflows/squad-pr-readiness.yml Added
2 CONTRIBUTING.md Modified
3 scripts/pr-readiness.mjs Added
4 test/pr-readiness.test.ts Added

4 files — 1 workflow, 1 script, 1 test, 1 doc update.

@diberry
diberry force-pushed the squad/750-pr-readiness-checks branch from a00c9b7 to 1c3f963 Compare April 3, 2026 11:49
diberry added a commit to diberry/squad that referenced this pull request Apr 3, 2026
Adds .github/pull_request_template.md with static checkboxes that
contributors see at PR creation time. Complements the dynamic PR
readiness bot (squad-pr-readiness.yml) — template gives the checklist
upfront, bot validates it after push.

Suggested by @tamirdresher in PR github#752 review.

Closes github#778

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds a GitHub Action that posts a readiness checklist comment on every PR,
giving contributors immediate feedback on what needs fixing before review.

7 checks: single commit, not draft, branch up to date, Copilot review,
changeset present, no merge conflicts, CI passing. Informational only.

Includes extracted script (pr-readiness.mjs), tests, and CONTRIBUTING.md update.

Closes #750

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry
diberry force-pushed the squad/750-pr-readiness-checks branch from 4346d79 to e468222 Compare April 3, 2026 13:29
@diberry
diberry merged commit a8e2ccb into dev Apr 3, 2026
11 checks passed
diberry added a commit to diberry/squad that referenced this pull request Apr 3, 2026
Adds .github/pull_request_template.md with static checkboxes that
contributors see at PR creation time. Complements the dynamic PR
readiness bot (squad-pr-readiness.yml) — template gives the checklist
upfront, bot validates it after push.

Suggested by @tamirdresher in PR github#752 review.

Closes github#778

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
diberry added a commit that referenced this pull request Apr 3, 2026
Adds .github/pull_request_template.md with static checkboxes that
contributors see at PR creation time. Complements the dynamic PR
readiness bot (squad-pr-readiness.yml) — template gives the checklist
upfront, bot validates it after push.

Suggested by @tamirdresher in PR #752 review.

Closes #778

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
diberry added a commit that referenced this pull request Apr 3, 2026
Adds a GitHub Action that posts a readiness checklist comment on every PR,
giving contributors immediate feedback on what needs fixing before review.

7 checks: single commit, not draft, branch up to date, Copilot review,
changeset present, no merge conflicts, CI passing. Informational only.

Includes extracted script (pr-readiness.mjs), tests, and CONTRIBUTING.md update.

Closes #750

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster
bradygaster deleted the squad/750-pr-readiness-checks branch August 8, 2026 08:41
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.

feat(ci): automated PR readiness checks — contributor feedback before review

3 participants