G
YouTube TikTok Games
Skip to content

Don't report unchanged generated files as errors - #24431

Merged
p-linnane merged 1 commit into
mainfrom
no-change-messages-not-errors
Nov 1, 2026
Merged

p-linnane merged 1 commit into
mainfrom
no-change-messages-not-errors

Conversation

@p-linnane

Copy link
Copy Markdown
Contributor

brew update-maintainers and brew generate-man-completions exit non-zero when nothing changed so the sponsors, maintainers, manpage and completions workflow and the autogenerated files check can tell, but they used ofail, which reported that expected outcome as an error (a GitHub Actions error annotation in CI). They now print the message normally and still exit non-zero.


  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

Claude Code (Opus 5.5) wrote the change and tests, checked that the new examples fail without the change and ran brew lgtm.


- `brew update-maintainers` and `brew generate-man-completions` exit
  non-zero when nothing changed so workflows can skip committing, but
  `ofail` also printed an error (a GitHub Actions error annotation in
  CI) for this expected outcome.
- Print the message normally and keep the non-zero exit.

Signed-off-by: Patrick Linnane <patrick@linnane.io>
@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 30863dd9-184b-4445-97ed-ee2dec499dac
Commits

Reviewing files that changed from the base of the PR and between 244bd01 and 5740f85.

Files selected for processing: 4
  • Library/Homebrew/dev-cmd/generate-man-completions.rb
  • Library/Homebrew/dev-cmd/update-maintainers.rb
  • Library/Homebrew/test/dev-cmd/generate-man-completions_spec.rb
  • Library/Homebrew/test/dev-cmd/update-maintainers_spec.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • The man-page completion command now displays its status message before marking a failure, unless --no-exit-code is specified.
    • The maintainer-list command now reports when there are no changes and marks the command as failed.
  • Tests
    • Added coverage for status messages, error output and failure reporting in both commands.

Two dev commands now print status messages and set Homebrew.failed in the described cases instead of calling ofail. Tests cover the output and failure state.

Changes: Dev command failure reporting

Layer / File(s) Summary
Status output and failure state
Library/Homebrew/dev-cmd/generate-man-completions.rb, Library/Homebrew/test/dev-cmd/generate-man-completions_spec.rb, Library/Homebrew/dev-cmd/update-maintainers.rb, Library/Homebrew/test/dev-cmd/update-maintainers_spec.rb
GenerateManCompletions prints its status message and sets Homebrew.failed when the status is failure, unless --no-exit-code is specified. update-maintainers prints its no-changes message and sets Homebrew.failed when the README has no diff. Tests check the messages, stderr output, and failure state.
Merge Risk: Minimal · up to 5740f

Expected no-change outcomes remain non-zero without error annotations. No merge-blocking issue was identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title states the main change: unchanged generated files no longer produce errors. The changeset replaces ofail with a normal message and sets Homebrew.failed for brew update-maintainers and brew g…
Description check Passed The description explains the change. It states that brew update-maintainers and brew generate-man-completions exit non-zero when nothing changed, that they used ofail (reported as a GitHub Actions err…
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.
Full details: Title check

Explanation

The title states the main change: unchanged generated files no longer produce errors. The changeset replaces ofail with a normal message and sets Homebrew.failed for brew update-maintainers and brew generate-man-completions, so the title matches the core change.

Full details: Description check

Explanation

The description explains the change. It states that brew update-maintainers and brew generate-man-completions exit non-zero when nothing changed, that they used ofail (reported as a GitHub Actions error annotation), and that they now print the message normally while still exiting non-zero. This relates directly to the changeset.

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

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@p-linnane
p-linnane added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit 874c46a Nov 1, 2026
55 checks passed
@p-linnane
p-linnane deleted the no-change-messages-not-errors branch November 1, 2026 21:42
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.

3 participants