feat: changelog-check-run-annotations - GitHub Check Run support for validation - #3376
ashleyshaw wants to merge 10 commits into
Conversation
|
Warning Review limit reachedNext included review available in 56 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: lightspeedwp/.github/.coderabbit.yml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
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. Comment |
PR Template RoutingBranch Type: This PR was automatically routed based on the branch naming strategy. |
7 similar comments
PR Template RoutingBranch Type: This PR was automatically routed based on the branch naming strategy. |
PR Template RoutingBranch Type: This PR was automatically routed based on the branch naming strategy. |
PR Template RoutingBranch Type: This PR was automatically routed based on the branch naming strategy. |
PR Template RoutingBranch Type: This PR was automatically routed based on the branch naming strategy. |
PR Template RoutingBranch Type: This PR was automatically routed based on the branch naming strategy. |
PR Template RoutingBranch Type: This PR was automatically routed based on the branch naming strategy. |
PR Template RoutingBranch Type: This PR was automatically routed based on the branch naming strategy. |
|
Tick the box to add this pull request to the merge queue (same as
|
PR Template RoutingBranch Type: This PR was automatically routed based on the branch naming strategy. |
PR Template RoutingBranch Type: This PR was automatically routed based on the branch naming strategy. |
2 similar comments
PR Template RoutingBranch Type: This PR was automatically routed based on the branch naming strategy. |
PR Template RoutingBranch Type: This PR was automatically routed based on the branch naming strategy. |
📋 Changelog Quality ValidationSummary
Status❌ Validation FAILED - This PR introduces 1 new changelog failure(s). Please fix them before merging. How to FixReproduce the exact PR check locally (from the repository root): cd .github/validation/changelog
node bin/validate.js --changelog-path ../../../CHANGELOG.md --trigger pr_submission --pr-number 3376 --branch feat/changelog-check-run-annotations --output textOnly new failures introduced by this PR block merging; pre-existing Unreleased failures do not block. See Changelog Quality Audit for the rule reference. |
Implement GitHub Check Run API integration to close FR-2 gap: - T084: Create CheckRunReporter class for GitHub Check Run API integration - Provides reportCheckRun() method to create/update checks with annotations - Maps validation violations to GitHub annotation objects - Handles 50 annotation limit per GitHub API spec - Supports conclusion determination (success/failure/neutral) - T085: Integrate CheckRunReporter into changelog-validation.yml workflow - Add "Report validation via GitHub Check Run" step after validation - Calls new report-check-run.js bin script with validation results - Continues on error to preserve downstream steps - T086: Create integration test suite for check run annotations - Test check run creation with proper conclusions - Verify annotation structure and GitHub API compliance - Test edge cases (50 annotation limit, API errors, missing PR context) - Validate severity-to-level mapping - T087: Ensure workflow reports validation status via check run - Check runs now serve as primary validation artifact - Replaces comment-only approach with proper GitHub API integration - Updates task completion status in tasks.md This implementation addresses the critical FR-2 gap identified during MVP convergence: changelog validation now creates proper GitHub Check Runs with detailed violation annotations visible in the PR Checks tab. Files created: - .github/validation/changelog/lib/check-run-reporter.js (89 lines) - .github/validation/changelog/bin/report-check-run.js (104 lines) - .github/validation/changelog/test/integration/test-check-run-annotations.js (285 lines) Files modified: - .github/workflows/changelog-validation.yml (added check run reporting step) - .github/specs/003-changelog-quality-audit/tasks.md (marked T084-T087 complete)
…GELOG.md not changed - Add conditional check for validation-report.json existence - Prevents check run reporter from failing when workflow triggers on validation script changes only - Ensures check run is only created when changelog validation actually ran - Makes executable bit on report-check-run.js explicit
The "Report validation via GitHub Check Run" step was failing when the workflow triggered on .github/validation/changelog/** path changes without CHANGELOG.md changes, because validation-report.json was not created. Replace the ineffective hashFiles() condition with an explicit output variable from the validate step that tracks whether validation-report.json was successfully created. This allows the check-run reporter to only run when the report file exists. - Add report_created=true/false output to validate step - Update check-run step condition to use report_created output - Resolves workflow failure in CI checks Relates to T084-T087: GitHub Check Run support integration Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CbYXeahLUGjYcfFaKwodc6
…anged When CHANGELOG.md has not changed, the validate step exits early without setting the report_created output variable. This causes the check-run step's condition to be undefined, leading to unclear workflow status. Ensure report_created=false is always set so downstream steps can properly determine whether to create a check run or skip. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CbYXeahLUGjYcfFaKwodc6
When CHANGELOG.md has not changed, validation is skipped but GitHub was not receiving an explicit check run status, leaving it undefined. Add a new step that creates a "neutral" check run with an appropriate message when validation is skipped due to no changelog changes. This ensures GitHub's checks tab always shows the validation status. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CbYXeahLUGjYcfFaKwodc6
The previous implementation incorrectly tried to manually instantiate Octokit. The actions/github-script@v7 action provides pre-configured github and context objects that should be used directly. Update the skip-check step to use the built-in github and context objects for creating the neutral check run. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CbYXeahLUGjYcfFaKwodc6
Replace context object access with direct GitHub Actions variable expansion for better reliability. Add try-catch error handling and logging to help diagnose check run creation failures. This should help identify any permission or API issues when creating the neutral check run for skipped validations. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CbYXeahLUGjYcfFaKwodc6
When CHANGELOG.md has not changed, the workflow needs to explicitly succeed rather than leaving status undefined. Add a step that runs when validation is skipped to ensure the workflow completes with success status. This ensures GitHub receives a clear success status for the workflow when no changelog changes require validation. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CbYXeahLUGjYcfFaKwodc6
- Remove redundant `any_changed` condition from skip-check steps - Ensures check run is created even when workflow triggers on .github/validation/changelog/** changes without CHANGELOG.md changes - Fixes case where neither check-run nor skip-check steps execute, leaving GitHub status undefined Fixes the persistent 'Validate changelog on PR' check failure by ensuring ALWAYS explicit check run status, never conditional skipping. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CbYXeahLUGjYcfFaKwodc6
- GitHub Checks API integration for changelog validation workflow - CheckRunReporter class with full check run creation and annotation support - CLI tool for invoking check run reporter from workflow - Integration test suite with comprehensive coverage - Workflow integration with proper status reporting for all validation states - Fixes persistent check run status issue by ensuring ALWAYS explicit check creation Closes FR-2 gap from Changelog Quality Audit specification (Spec 003). Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CbYXeahLUGjYcfFaKwodc6
71ba37a to
b22cc01
Compare
Feature Pull Request
Linked issues
Closes #NONE (new convergence work on MVP tasks)
Relates to: Convergence analysis for Phase 10 (MVP Validation & Gap Closure)
Summary
Implements GitHub Check Run API integration to close the critical FR-2 gap identified during MVP convergence. The changelog validation workflow now creates proper GitHub Check Runs with detailed violation annotations visible in the PR Checks tab, replacing the comment-only approach.
Changes Made
T084: CheckRunReporter Class
.github/validation/changelog/lib/check-run-reporter.js(89 lines)reportCheckRun()method for GitHub Check Run API integrationreportCheckRun(context, validationResult): Creates/updates check rundetermineConclusion(validationResult): Maps results to conclusionsbuildCheckOutput(validationResult): Formats title, summary, annotationsbuildAnnotations(violations): Converts violations to GitHub annotationsseverityToAnnotationLevel(severity): Maps severity to annotation levelT085: Workflow Integration
.github/validation/changelog/bin/report-check-run.js(104 lines).github/workflows/changelog-validation.ymlT086: Integration Tests
.github/validation/changelog/test/integration/test-check-run-annotations.js(285 lines)T087: Workflow Status Reporting
.github/workflows/changelog-validation.yml.github/specs/003-changelog-quality-audit/tasks.mdTechnical Details
GitHub Check Run Conclusions
success: All entries pass validation (pass rate = 100%)failure: 1+ entries fail validation (pass rate < 100%)neutral: Warning-level issues detected (pass rate ≥ 90% but < 100%)Annotation Severity Mapping
critical/high→failure(red badge)medium→warning(yellow badge)low/unknown →notice(grey badge)GitHub API Compliance
Testing
Run integration tests:
Manual testing in GitHub UI:
Changelog
Added
Changed
Checklist (Global DoD / PR)
🤖 Generated with Claude Code
https://claude.ai/code/session_01CbYXeahLUGjYcfFaKwodc6
Generated by Claude Code