Skip to content

feat: Add PR changelog/review automation scripts - #2015

Closed
ashleyshaw wants to merge 6 commits into
developfrom
fix/infrastructure-bugs-final
Closed

feat: Add PR changelog/review automation scripts#2015
ashleyshaw wants to merge 6 commits into
developfrom
fix/infrastructure-bugs-final

Conversation

@ashleyshaw

@ashleyshawashleyshaw commented Aug 18, 2026

Copy link
Copy Markdown
Member

Summary

Add two reusable automation scripts for managing PR status labels based on review state and changelog requirements.

Scripts Added

  1. update-pr-changelog-review.js (Full-featured)

    • Fetches PR review data from GitHub API
    • Determines PR status based on review state (awaiting-review, approved, changes-requested, etc.)
    • Automatically updates status labels accordingly
    • Supports dry-run, interactive, and auto modes
    • Includes rate limiting and error handling
  2. update-pr-labels-simple.js (Lightweight)

    • Direct label-only updater for quick status synchronization
    • Minimal API calls
    • Suitable for CI/CD pipelines with limited quota
    • Fast execution for large PR batches

Usage

# Preview changes
node scripts/automation/update-pr-changelog-review.js --dry-run
# Apply changes automatically
node scripts/automation/update-pr-changelog-review.js --auto
# Interactive mode (prompt before each change)
node scripts/automation/update-pr-changelog-review.js --interactive

Linked issues

Closes#1735

Changelog

  • Added: update-pr-changelog-review.js for comprehensive PR review status tracking
  • Added: update-pr-labels-simple.js for lightweight PR label synchronization
  • Added: Comprehensive test suites for both automation scripts
  • Fixed: Removed unused variable from update-pr-labels-simple.js for code quality

Test Plan

  • Created test files for both scripts with comprehensive coverage
  • Manually tested scripts on sample PRs
  • Verified rate limiting and API error handling
  • Tested both dry-run and auto modes
  • Confirmed label operations work correctly

Checklist (Global DoD / PR)

  • All requirements met and code complete
  • Tests added and passing
  • CI checks passing
  • Code quality issues resolved

🤖 Generated with Claude Code

Test Userand others added 3 commits August 18, 2026 15:43
**#1928 - Gitleaks false positive**
- Added gitleaks ignore comments in OPENSPEC_TEMPLATE.md
**#1930 - PR template validator**
- Fixed regex to match any heading level
**#1938 - Branch name validator**
- Enforced strict kebab-case validation
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Replace relative path references to PLANNING.md with descriptive text
- Convert placeholder issue reference to documentation note
- Prevents lint-and-links CI validation failures on template files
These links were template placeholders and not meant to be valid file references.
Add two reusable scripts for managing PR status labels based on review state:
- update-pr-changelog-review.js: Full-featured handler that fetches review data and updates labels
- update-pr-labels-simple.js: Lightweight label-only updater for quick status sync
These scripts automate the process of updating PR status labels (status:needs-review,
status:needs-update, etc.) based on actual review progress and PR state, keeping
the meta:needs-changelog workflow in sync with real review activity.
Supports dry-run, interactive, and auto modes for safe and flexible deployment.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@coderabbitai

coderabbitaiBot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@ashleyshaw, you've reached your PR review limit, so we couldn't start this review.

Next review available in:54 minutes

Limit details: You’ve used all 1 included review currently available under your plan.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 27ad03f9-b367-4c03-8ee1-e6c4e8811d7d

📥 Commits

Reviewing files that changed from the base of the PR and between 27ca82a and 9a14667.

📒 Files selected for processing (7)
  • .github/projects/_templates/OPENSPEC_TEMPLATE.md
  • METRICS_AGENT_PHASE_2_CONTINUATION_3_4_5.md
  • docs/AGENTIC_RELEASE_TEAM_TRAINING.md
  • scripts/automation/__tests__/update-pr-changelog-review.test.js
  • scripts/automation/__tests__/update-pr-labels-simple.test.js
  • scripts/automation/update-pr-changelog-review.js
  • scripts/automation/update-pr-labels-simple.js
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/infrastructure-bugs-final

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actionsBot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🚫 This PR description is missing required template content.

Missing required section(s): Linked issues

Please update the PR body using one of the repository PR templates:

Empty placeholders, unchecked checklist boxes, and stub issue references do not count.

@github-actionsgithub-actionsBot added status:needs-review Awaiting code review type:bug Bug or defect priority:normal Default priority area:scripts Scripts & tooling lang:js JavaScript/TypeScript type:chore Chore / small hygiene change type:feature Feature or enhancement meta:needs-changelog Requires a changelog entry before merge labels Aug 18, 2026
@github-actions

github-actionsBot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

⏱️ Aging and SLA annotation

  • Age: 0 day(s)
  • SLA state: Within SLA
  • Thresholds: warn at 7 days, breach at 14 days
  • Last updated: 2026-08-18T14:33:44.389Z

Maintained by project-meta-sync workflow.

@github-actions

github-actionsBot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #2015

CI Status:success
Files changed: 7
Risk Distribution: 0 critical, 1 high, 2 medium, 4 low

Recommendations

  • Ready to proceed pending human review

Comment threadscripts/automation/update-pr-labels-simple.js Fixed
@ashleyshaw
ashleyshaw enabled auto-merge (squash) August 18, 2026 14:13
Test Userand others added 2 commits August 18, 2026 16:23
- Remove unused hasStatusLabel variable from update-pr-labels-simple.js
- Add comprehensive test files for both automation scripts
- Tests cover status determination, label management, and argument parsing
- Both scripts now have complete test coverage
Fixed linting violations:
- Added missing blank line before '### Watch the Workflow' heading (MD022)
- Wrapped bare URLs in markdown links (MD034)
- Ensured proper spacing around headings and code blocks
This resolves the pre-existing linting failures blocking PR #2013.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@github-actionsgithub-actionsBot added area:documentation Docs & guides area:tests Test suites & harnesses lang:md Markdown content/docs and removed type:feature Feature or enhancement type:chore Chore / small hygiene change labels Aug 18, 2026
ashleyshaw pushed a commit that referenced this pull request Aug 18, 2026
Added entry for PR #2015 documenting the two new automation scripts
for managing PR status labels based on review progress.
- Changed 'reviews === null || reviews === undefined || reviews.length === 0' to just 'expect(reviews).toBeNull()'
- This fixes the code quality issue where the assertion was overly defensive
- Matches the explicit test setup where reviews is null
ashleyshaw pushed a commit that referenced this pull request Aug 18, 2026
- Documents new update-pr-changelog-review.js and update-pr-labels-simple.js scripts
- Includes test suite coverage and integration details
- References PR #2015
ashleyshaw pushed a commit that referenced this pull request Aug 18, 2026
- Documents new update-pr-changelog-review.js and update-pr-labels-simple.js scripts
- Includes test suite coverage and integration details
- References PR #2015
@ashleyshaw

Copy link
Copy Markdown
MemberAuthor

Closed in favor of PR #2021 which has a cleaner implementation without unrelated markdown files.

auto-merge was automatically disabled August 18, 2026 14:34

Pull request was closed

ashleyshaw pushed a commit that referenced this pull request Aug 18, 2026
- Remove unused hasStatusLabel variable from update-pr-labels-simple.js
- Add comprehensive test files for both automation scripts
- Update PR template with all required sections (Linked issues, Changelog, Checklist)
These scripts automate PR status label updates based on review state and changelog requirements.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:documentationDocs & guidesarea:scriptsScripts & toolingarea:testsTest suites & harnesseslang:jsJavaScript/TypeScriptlang:mdMarkdown content/docsmeta:needs-changelogRequires a changelog entry before mergepriority:normalDefault prioritystatus:needs-reviewAwaiting code reviewtype:bugBug or defect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 4: Cleanup & Documentation — Reports & Projects

1 participant

@ashleyshaw