Skip to content

feat(validation): enforce breaking acknowledgement - #653

Merged
fredcamaral merged 2 commits into
developfrom
feat/mandatory-breaking-change-guard
Aug 6, 2026
Merged

feat(validation): enforce breaking acknowledgement#653
fredcamaral merged 2 commits into
developfrom
feat/mandatory-breaking-change-guard

Conversation

@fredcamaral

Copy link
Copy Markdown
Member
Lerian

GitHub Actions Shared Workflows


Description

Makes breaking-change detection mandatory for every caller of the PR validation, Go validation, and JS/TS validation workflows.

The guard runs for every pull request target branch, including drafts, and enforces through the existing Blocking Checks status. There is no enable input, branch filter, configurable acknowledgement, or guard opt-out.

A breaking PR passes only when its description contains this exact, visible, case-sensitive author acknowledgement line:

Breaking change acknowledged: I understand that this PR intentionally introduces a breaking change and requires the next release to be a major version.

The acknowledgement records author awareness. It does not grant maintainer authorization.

Detection and enforcement fail closed for unsupported events, shallow history, action failures, malformed outputs, cancelled jobs, and blocking runtime failures. Feedback comments run separately with minimal write permissions and never control enforcement.

Reporter, summary, Slack, and all reusable workflow outputs now propagate guard and blocking-runtime state with fail-closed fallbacks.

Caller trigger configuration must include edited so acknowledgement changes rerun validation and ready_for_review so full validation reruns when a draft becomes ready.

Type of Change

  • feat: New workflow or new input/output/step in an existing workflow
  • fix: Bug fix in a workflow (incorrect behavior, broken step, wrong condition)
  • perf: Performance improvement (e.g. caching, parallelism, reduced steps)
  • refactor: Internal restructuring with no behavior change
  • docs: Documentation only (README, docs/, inline comments)
  • ci: Changes to self-CI (workflows under .github/workflows/ that run on this repo)
  • chore: Dependency bumps, config updates, maintenance
  • test: Adding or updating tests
  • BREAKING CHANGE: Callers must update their configuration after this PR

Breaking Changes

None. The workflow remains on v1 by product decision. Callers must add edited and ready_for_review to their pull_request activity types for complete revalidation.

Testing

  • YAML syntax validated locally
  • Triggered a real workflow run on a caller repository using @this-branch or the beta tag
  • Verified all existing inputs still work with default values
  • Confirmed no secrets or tokens are printed in logs
  • Checked that unrelated workflows are not affected

Caller repo / workflow run: Local validation passed 42 workflow-state tests and 56 detector tests. Actionlint, ShellCheck, duplicate-safe YAML parsing, composite schema validation, JavaScript syntax checks, documentation checks, and diff checks also passed.

Related Issues

Related PRs: #649, #651, and #652.

@fredcamaral
fredcamaral requested a review from a team as a code owner August 6, 2026 09:34
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8d052998-8dd6-44a7-8a91-7e44893bcce8

📥 Commits

Reviewing files that changed from the base of the PR and between c258fe4 and 66c25dc.

📒 Files selected for processing (3)
  • .github/workflows/pr-validation.yml
  • docs/pr-validation.md
  • src/validate/breaking-change-guard/test-workflow.py

Summary by CodeRabbit

  • New Features

    • Added mandatory breaking-change detection for pull requests, including drafts.
    • Added configurable author acknowledgement matching, including exact visible-line checks.
    • Added blocking feedback in validation summaries, comments, and notifications.
    • Added workflow outputs for breaking-change status and approval results.
    • Added runtime failure reporting for blocking validation checks.
  • Documentation

    • Updated workflow and action documentation with new inputs, outputs, triggers, enforcement behavior, and usage examples.
  • Tests

    • Expanded coverage for detection, acknowledgement matching, workflow behavior, and failure handling.

Walkthrough

The pull-request validation workflows now run a mandatory breaking-change guard, enforce exact author acknowledgement, expose guard outputs, report blocking-check runtime failures, and add workflow regression coverage and documentation.

Changes

Breaking Change Validation

Layer / File(s) Summary
Acknowledgement matching
src/validate/breaking-change-guard/*
The detector supports contains and exact-visible-line matching. Tests cover invalid modes, comments, fenced code, whitespace, case sensitivity, and compatibility behavior.
Workflow guard and enforcement
.github/workflows/pr-validation.yml, .github/workflows/go-pr-validation.yml, .github/workflows/js-pr-validation.yml
The workflows validate pull-request events, run the breaking-change guard, normalize failures, expose guard outputs, and apply draft-aware enforcement.
Result reporting and runtime failures
.github/workflows/pr-validation.yml, src/notify/pr-validation-reporter/*, src/validate/pr-checks-summary/*
Summaries, comments, reports, and Slack notifications include guard results. Reporter and summary actions identify non-success, non-skipped blocking-check results.
Workflow regression coverage
src/validate/breaking-change-guard/test-workflow.py, src/validate/breaking-change-guard/test.sh, .github/workflows/self-pr-validation.yml
Tests validate event handling, fail-closed normalization, enforcement, permissions, workflow wiring, outputs, matching modes, and unconditional self-validation.
Workflow documentation
docs/*, src/notify/*/README.md, src/validate/*/README.md
Documentation describes guard outputs, acknowledgement rules, draft and dry-run behavior, reporting behavior, runtime failures, triggers, and the v1 release line.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested reviewers: bedatty

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: enforcing breaking-change acknowledgement in validation workflows.
Description check ✅ Passed The description follows the template and documents behavior, affected workflows, testing, caller requirements, and related work.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/mandatory-breaking-change-guard

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

@lerian-studio

lerian-studio commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🔍 Lint Analysis

Check Files Scanned Status
YAML Lint 7 file(s) ✅ success
Action Lint 4 file(s) ✅ success
Pinned Actions 7 file(s) ✅ success
Markdown Link Check 6 file(s) ✅ success
Spelling Check 16 file(s) ✅ success
Shell Check 7 file(s) ✅ success
README Check 7 file(s) ✅ success
Composite Schema 3 file(s) ✅ success
Deployment Matrix no changes ⏭️ skipped

🔍 View full scan logs

@lerian-studio lerian-studio added size/XL PR changes ≥ 1000 lines — consider splitting documentation Improvements or additions to documentation workflow Changes to one or more reusable workflow files golang Changes to Go-related workflows notify Changes to notification composite actions (src/notify/) validate Changes to PR validation composite actions (src/validate/) composite Changes to any composite action manifest (src/**/*.yml) scripts Changes to shell scripts (src/**/*.sh) labels Aug 6, 2026
@lerian-studio

lerian-studio commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🛡️ CodeQL Analysis Results

Languages analyzed: actions

✅ No security issues found.


🔍 View full scan logs | 🛡️ Security tab

@lerian-studio

lerian-studio commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🔍 PR Validation Summary

✅ PR Mergeable — no blocking failures

Check Status Blocking
Source Branch ✅ success yes
PR Title ✅ success yes
PR Description ✅ success yes
Breaking Change Guard ✅ success yes
PR Size ✅ success no
Auto Labels ✅ success no
PR Metadata ✅ success no

🔍 View workflow run

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/pr-validation.yml:
- Around line 343-349: The workflow regression test should extract the
acknowledgement literals from both the detector in “Detect breaking changes” and
the “breaking-change-comment” configuration, then assert they are identical.
Preserve the existing check for “breaking-change-acknowledgement” while adding
coverage for the second literal.
- Around line 136-144: Update the breaking-change-guard action reference in the
“Detect breaking changes” workflow step from v1 to a release that declares and
supports the acknowledgement-match-mode input, while preserving the existing
exact-visible-line configuration.

In `@docs/pr-validation.md`:
- Around line 17-20: Update the “Draft PR support” description in the
documentation to state that draft runs still write the step summary, while
deferring only PR comments, pr-validation-reporter, guard comments, and Slack
notifications until the PR is ready for review. Apply the same wording to the
repeated draft-support entry.

In `@src/validate/breaking-change-guard/test-workflow.py`:
- Around line 430-436: Update the tests around the breaking-change guard step
assertions to first extract the breaking-change-guard job, then call
extract_step on that job content rather than the full WORKFLOW. Apply this
scoping both to the “Detect breaking changes” lookup near the existing
assertions and to the lookup around line 515, reusing the job-extraction pattern
already used by
test_guard_checkout_has_full_history_without_persisted_credentials.
- Around line 342-377: Add an EnforcementTests live-mode test that calls
enforce(DETECTION_SUCCEEDED="false") and asserts a nonzero return code, covering
the fail-closed enforcement behavior. If dry-run behavior is intended to remain
non-blocking, add the corresponding dry-run test and assert it succeeds while
detection is false.
- Around line 148-163: Update execute_body to construct a minimal allowlisted
environment instead of copying os.environ, while retaining the explicitly
provided env values and the temporary GITHUB_OUTPUT path. Do not include
GITHUB_STEP_SUMMARY, and add coverage verifying snippet execution fails or
behaves correctly when a required variable is absent.
- Around line 125-136: Update extract_workflow_call_section to stop depending on
the next_section argument or sibling section order. After locating the
section_name marker, scan subsequent lines and end at the first non-empty line
whose indentation is 4 spaces or fewer, while preserving the section content for
nested lines.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7050c286-2303-4e20-bdde-310eec2ff8e6

📥 Commits

Reviewing files that changed from the base of the PR and between 6aa9c6a and c258fe4.

📒 Files selected for processing (16)
  • .github/workflows/go-pr-validation.yml
  • .github/workflows/js-pr-validation.yml
  • .github/workflows/pr-validation.yml
  • .github/workflows/self-pr-validation.yml
  • docs/go-pr-validation.md
  • docs/js-pr-validation.md
  • docs/pr-validation.md
  • src/notify/pr-validation-reporter/README.md
  • src/notify/pr-validation-reporter/action.yml
  • src/validate/breaking-change-guard/README.md
  • src/validate/breaking-change-guard/action.yml
  • src/validate/breaking-change-guard/detect.sh
  • src/validate/breaking-change-guard/test-workflow.py
  • src/validate/breaking-change-guard/test.sh
  • src/validate/pr-checks-summary/README.md
  • src/validate/pr-checks-summary/action.yml

Comment thread .github/workflows/pr-validation.yml
Comment thread .github/workflows/pr-validation.yml
Comment thread docs/pr-validation.md Outdated
Comment thread src/validate/breaking-change-guard/test-workflow.py Outdated
Comment thread src/validate/breaking-change-guard/test-workflow.py
Comment thread src/validate/breaking-change-guard/test-workflow.py
Comment thread src/validate/breaking-change-guard/test-workflow.py Outdated
Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
@fredcamaral

Copy link
Copy Markdown
Member Author

@CodeRabbit approve

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

@fredcamaral
fredcamaral merged commit 03fe6d9 into develop Aug 6, 2026
25 checks passed
@github-actions
github-actions Bot deleted the feat/mandatory-breaking-change-guard branch August 6, 2026 13:26
@fredcamaral fredcamaral mentioned this pull request Aug 6, 2026
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

composite Changes to any composite action manifest (src/**/*.yml) documentation Improvements or additions to documentation golang Changes to Go-related workflows notify Changes to notification composite actions (src/notify/) scripts Changes to shell scripts (src/**/*.sh) size/XL PR changes ≥ 1000 lines — consider splitting validate Changes to PR validation composite actions (src/validate/) workflow Changes to one or more reusable workflow files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants