Skip to content

feat: changelog-check-run-annotations - GitHub Check Run support for validation - #3376

Open
ashleyshaw wants to merge 10 commits into
developfrom
feat/changelog-check-run-annotations
Open

ashleyshaw wants to merge 10 commits into
developfrom
feat/changelog-check-run-annotations

Conversation

@ashleyshaw

Copy link
Copy Markdown
Member

Feature Pull Request

This repository enforces changelog, release, and label automation for all PRs and issues.
See the organisation-wide Automation Governance & Release Strategy for contributor rules.

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

  • Created .github/validation/changelog/lib/check-run-reporter.js (89 lines)
  • Provides reportCheckRun() method for GitHub Check Run API integration
  • Maps validation violations to GitHub annotation objects
  • Handles 50 annotation limit per GitHub API spec
  • Supports conclusion determination (success/failure/neutral)
  • Methods:
    • reportCheckRun(context, validationResult): Creates/updates check run
    • determineConclusion(validationResult): Maps results to conclusions
    • buildCheckOutput(validationResult): Formats title, summary, annotations
    • buildAnnotations(violations): Converts violations to GitHub annotations
    • severityToAnnotationLevel(severity): Maps severity to annotation level

T085: Workflow Integration

  • Created .github/validation/changelog/bin/report-check-run.js (104 lines)
  • Standalone script for invoking CheckRunReporter from workflow
  • Accepts validation report path, token, owner, repo, SHA, PR number
  • Returns check run data as JSON
  • Integrated into .github/workflows/changelog-validation.yml
  • Added "Report validation via GitHub Check Run" step after validation
  • Continues on error to preserve downstream steps

T086: Integration Tests

  • Created .github/validation/changelog/test/integration/test-check-run-annotations.js (285 lines)
  • Comprehensive test suite using Vitest
  • Tests check run creation with proper conclusions
  • Verifies annotation structure and GitHub API compliance
  • Tests edge cases:
    • 50 annotation limit enforcement
    • API error handling
    • PR context availability (head SHA vs fallback)
    • Severity-to-level mapping
    • Success/failure/warning conclusion determination
  • Uses mocked GitHub API client for isolation

T087: Workflow Status Reporting

  • Updated .github/workflows/changelog-validation.yml
  • Check runs now serve as primary validation artifact
  • Replaces comment-only approach with proper GitHub API integration
  • Tasks marked complete in .github/specs/003-changelog-quality-audit/tasks.md

Technical 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/highfailure (red badge)
  • mediumwarning (yellow badge)
  • low/unknown → notice (grey badge)

GitHub API Compliance

  • Respects 50 annotation limit per check run
  • Uses correct GitHub Actions context (head SHA for PRs, fallback SHA for commits)
  • Includes violation details in annotation messages
  • Handles transient API errors gracefully

Testing

Run integration tests:

cd .github/validation/changelog
npm test test/integration/test-check-run-annotations.js

Manual testing in GitHub UI:

  • Create PR with changelog changes
  • Review "Changelog Validation" check in Checks tab
  • Verify annotations appear with correct severity levels
  • Confirm entry-specific violation details are visible

Changelog

Added

  • GitHub Check Run API integration for changelog validation (closes FR-2 gap)
  • CheckRunReporter class with full GitHub Checks API support
  • Annotation-style output with per-entry violation details
  • Integration test suite for check run creation and annotation validation
  • Support for 50-annotation limit compliance

Changed

  • Changelog validation workflow now creates GitHub Check Runs
  • Validation results now provide actionable check badges in PR

Checklist (Global DoD / PR)

  • All AC met and demonstrated
    • CheckRunReporter creates check runs with proper conclusions
    • Violations converted to GitHub annotations
    • Workflow integration functional
    • 50 annotation limit respected
  • Tests added/updated (unit/E2E as appropriate)
    • Integration test suite created with comprehensive coverage
    • Mock GitHub API client for isolated testing
    • Edge cases verified (context variations, API errors)
  • Accessibility checklist completed (where relevant)
    • N/A (backend automation, no UI components)
  • Docs/readme/changelog updated (if user-facing)
    • Code comments and docstrings added
    • Changelog section completed above
  • Security checklist completed (where relevant)
    • GitHub token handled securely via secrets
    • No sensitive data logged or exposed
    • API calls use proper authentication
  • Code/design reviews approved
  • CI green; linked issues closed; release notes prepared (if shipping)

🤖 Generated with Claude Code

https://claude.ai/code/session_01CbYXeahLUGjYcfFaKwodc6


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 56 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: lightspeedwp/.github/.coderabbit.yml

Review profile: CHILL

Plan: Advanced

Run ID: c00b8899-0995-49c8-9c36-2bc904019f52

📥 Commits

Reviewing files that changed from the base of the PR and between d1424a4 and b22cc01.

📒 Files selected for processing (6)
  • .github/specs/003-changelog-quality-audit/tasks.md
  • .github/validation/changelog/bin/report-check-run.js
  • .github/validation/changelog/lib/check-run-reporter.js
  • .github/validation/changelog/test/integration/test-check-run-annotations.js
  • .github/workflows/changelog-validation.yml
  • CHANGELOG.md

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

Copy link
Copy Markdown
Contributor

PR Template Routing

Branch Type: feat
Scope: changelog-check-run-annotations
Template: pr_feature.md
Labels Applied: type:feature

This PR was automatically routed based on the branch naming strategy.

7 similar comments
@github-actions

Copy link
Copy Markdown
Contributor

PR Template Routing

Branch Type: feat
Scope: changelog-check-run-annotations
Template: pr_feature.md
Labels Applied: type:feature

This PR was automatically routed based on the branch naming strategy.

@github-actions

Copy link
Copy Markdown
Contributor

PR Template Routing

Branch Type: feat
Scope: changelog-check-run-annotations
Template: pr_feature.md
Labels Applied: type:feature

This PR was automatically routed based on the branch naming strategy.

@github-actions

Copy link
Copy Markdown
Contributor

PR Template Routing

Branch Type: feat
Scope: changelog-check-run-annotations
Template: pr_feature.md
Labels Applied: type:feature

This PR was automatically routed based on the branch naming strategy.

@github-actions

Copy link
Copy Markdown
Contributor

PR Template Routing

Branch Type: feat
Scope: changelog-check-run-annotations
Template: pr_feature.md
Labels Applied: type:feature

This PR was automatically routed based on the branch naming strategy.

@github-actions

Copy link
Copy Markdown
Contributor

PR Template Routing

Branch Type: feat
Scope: changelog-check-run-annotations
Template: pr_feature.md
Labels Applied: type:feature

This PR was automatically routed based on the branch naming strategy.

@github-actions

Copy link
Copy Markdown
Contributor

PR Template Routing

Branch Type: feat
Scope: changelog-check-run-annotations
Template: pr_feature.md
Labels Applied: type:feature

This PR was automatically routed based on the branch naming strategy.

@github-actions

Copy link
Copy Markdown
Contributor

PR Template Routing

Branch Type: feat
Scope: changelog-check-run-annotations
Template: pr_feature.md
Labels Applied: type:feature

This PR was automatically routed based on the branch naming strategy.

@ashleyshaw ashleyshaw self-assigned this Sep 18, 2026
@ashleyshaw ashleyshaw added this to the v1.1 milestone Sep 18, 2026
@ashleyshaw
ashleyshaw marked this pull request as ready for review September 18, 2026 14:11
@mergify

mergify Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@github-actions

Copy link
Copy Markdown
Contributor

PR Template Routing

Branch Type: feat
Scope: changelog-check-run-annotations
Template: pr_feature.md
Labels Applied: type:feature

This PR was automatically routed based on the branch naming strategy.

@github-actions

Copy link
Copy Markdown
Contributor

PR Template Routing

Branch Type: feat
Scope: changelog-check-run-annotations
Template: pr_feature.md
Labels Applied: type:feature

This PR was automatically routed based on the branch naming strategy.

2 similar comments
@github-actions

Copy link
Copy Markdown
Contributor

PR Template Routing

Branch Type: feat
Scope: changelog-check-run-annotations
Template: pr_feature.md
Labels Applied: type:feature

This PR was automatically routed based on the branch naming strategy.

@github-actions

Copy link
Copy Markdown
Contributor

PR Template Routing

Branch Type: feat
Scope: changelog-check-run-annotations
Template: pr_feature.md
Labels Applied: type:feature

This PR was automatically routed based on the branch naming strategy.

@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

📋 Changelog Quality Validation

Summary

Metric Count
✅ Passing 73
⚠️ Warnings 0
❌ Failing 1
🆕 New failures in this PR 1
📦 Pre-existing failures 0

Status

Validation FAILED - This PR introduces 1 new changelog failure(s). Please fix them before merging.
Pre-existing failures (0) are reported for visibility and do not block this PR.

How to Fix

Reproduce 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 text

Only new failures introduced by this PR block merging; pre-existing Unreleased failures do not block. See Changelog Quality Audit for the rule reference.

@ashleyshaw
ashleyshaw requested a review from eleshar September 18, 2026 14:25
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
@eleshar
eleshar force-pushed the feat/changelog-check-run-annotations branch from 71ba37a to b22cc01 Compare September 21, 2026 17:30
@ashleyshaw ashleyshaw modified the milestones: v1.1, v1.6 Sep 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants