You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sync: add generic issue and pull request templates - #507
Most Homebrew repositories have no issue or pull request template, so new issues and PRs open with an empty description and nothing prompts contributors to disclose AI usage as https://docs.brew.sh/Responsible-AI-Usage asks. Of the 17 repositories the sync covers, only brew, homebrew-core, homebrew-cask, BrewUI and formulae.brew.sh have both, and install has issue templates only.
As suggested in Homebrew/formulae.brew.sh#2352 (comment), install generic templates where a repository has none, built from what the existing ones have in common:
A pull request template asking about duplicate PRs, what the change does and why, tests, local checks and AI usage, based on the template from Add pull request template formulae.brew.sh#2352.
A bug report form asking what you were trying to do, what happened, what you expected and how to reproduce it, with checkboxes for duplicate issues and AI usage.
An issue config that disables blank issues and links to GitHub Discussions, like every repository with issue templates except BrewUI.
Links to each repository's own pull requests and issues.
The sync skips a repository that already has a pull request template or an ISSUE_TEMPLATE/ directory, wherever GitHub reads them from: .github/, the root or docs/, in any case. Single-file ISSUE_TEMPLATE.md templates don't count because GitHub retired them on 30 March 2025. Once installed, the templates belong to the repository like any other, so they have no "synced" comment and later sync runs leave them alone. The one exception is an unedited synced pull request template in a repository that later adds its own elsewhere: GitHub prefers .github/, so the sync removes ours. Feature request forms only exist in brew and BrewUI, so they're left out.
Skip .github itself, because GitHub would use templates there as the default for every repository without one, including archived repositories and forks that the sync skips.
This adds the pull request template to actions, advisory-database, brew-pip-audit, brew.sh, ci-orchestrator-private, discussions, glibc-bootstrap, install, patchelf.rb, private and ruby-macho, and the issue templates to the same repositories except install.
I used Claude Code (Claude Opus 5.5) to write the change and its specs. Claude ran brew style and the shared configuration specs, and checked that the new specs fail when the template skips are removed.
Added a pull request checklist covering duplicate PRs, change explanations, tests, repository checks and AI-use disclosure.
New Features
Shared pull request and issue templates are synced when suitable, while existing repository-owned templates are preserved.
Added a structured bug report form with required verification and reproduction details. Blank issue creation is disabled, and a contact link directs people to GitHub Discussions for help.
Tests
Added checks for template discovery, installation, repeat syncing and preservation of existing templates.
The pull request adds shared pull request and bug report templates, plus issue configuration. The sync script detects existing templates and installs shared templates according to repository-specific rules.
The pull request template adds contribution checks and AI-use guidance. The bug report form adds required verification and report fields. The issue configuration disables blank issues and links to Discussions.
Template synchronisation and validation .github/actions/sync/shared-config.rb, .github/actions/sync/shared-config_spec.rb
The sync script detects tracked and non-ignored untracked templates. It formats templates for target repositories and applies rules for existing templates and the .github repository. Specs cover installation, idempotency, and preservation of repository-owned templates.
Merge Risk: Minimal · up to a2762
No supported workflow presents an actionable merge-blocking risk in these template synchronization changes.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title clearly summarises the main change: adding generic issue and pull request templates through the sync process.
Description check
The description explains the template changes, sync behaviour, affected repositories, and validation performed. It is directly related to the changeset.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Tip
🎯 Customize your risk assessments
Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.
✅ Automatic approvals, with your rules
Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.
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.
- Give repositories without their own templates a pull request
template, bug report form and issue config built from what the
existing templates have in common.
- List repositories that keep their own templates, so pull request
descriptions don't start with a synced-file comment.
- Skip `.github` because templates there would become the default
for every repository, including unsynced ones.
- Detect existing templates wherever GitHub reads them from instead
of listing repositories that have their own.
- Leave installed templates to each repository afterwards, so they
need no synced-file comment.
- Remove an unedited synced pull request template once a repository
adds its own elsewhere, as GitHub would keep showing ours.
- Install issue templates next to single-file `ISSUE_TEMPLATE.md`
templates, which GitHub retired on 30 March 2025.
- Don't overwrite uncommitted templates during local syncs.
@MikeMcQuaid Do you want to take another look? The solution grew a lot when I leaned into the Coderabbit comments, which then generated more Coderabbit comments (did they reproduce like rabbits?).
But I think it's in an ok place now.
Important for me is that is doesn't duplicate or overwrite working templates. It seems okay to add new temples when there are ones in the paths that GitHub doesn't read anymore, I want to remove them in follow-up PRs in the relevant repos as well.
The reason will be displayed to describe this comment to others. Learn more.
Additional comments: 1
.github/actions/sync/shared-config.rb-236-236: 1
236-236: Minor · Functional Correctness · Quick win
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Preserve templates omitted by sparse checkout.
If a sparse checkout omits docs/PULL_REQUEST_TEMPLATE.md, this filter treats it as deleted. The sync can then commit a .github/PULL_REQUEST_TEMPLATE.md that takes precedence over the repository’s existing template. Git retains the omitted file in the index. (git-scm.com)
Keep tracked paths marked skip-worktree in working_tree_files, while continuing to exclude actual deletions.
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: 7c6454a1-3ee9-4efd-807d-e1688a76deea
Commits
Reviewing files that changed from the base of the PR and between ae2671b and a276219.
Files selected for processing: 2
.github/actions/sync/shared-config.rb
.github/actions/sync/shared-config_spec.rb
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Most Homebrew repositories have no issue or pull request template, so new issues and PRs open with an empty description and nothing prompts contributors to disclose AI usage as https://docs.brew.sh/Responsible-AI-Usage asks. Of the 17 repositories the sync covers, only
brew,homebrew-core,homebrew-cask,BrewUIandformulae.brew.shhave both, andinstallhas issue templates only.As suggested in Homebrew/formulae.brew.sh#2352 (comment), install generic templates where a repository has none, built from what the existing ones have in common:
BrewUI.The sync skips a repository that already has a pull request template or an
ISSUE_TEMPLATE/directory, wherever GitHub reads them from:.github/, the root ordocs/, in any case. Single-fileISSUE_TEMPLATE.mdtemplates don't count because GitHub retired them on 30 March 2025. Once installed, the templates belong to the repository like any other, so they have no "synced" comment and later sync runs leave them alone. The one exception is an unedited synced pull request template in a repository that later adds its own elsewhere: GitHub prefers.github/, so the sync removes ours. Feature request forms only exist inbrewandBrewUI, so they're left out.Skip
.githubitself, because GitHub would use templates there as the default for every repository without one, including archived repositories and forks that the sync skips.This adds the pull request template to
actions,advisory-database,brew-pip-audit,brew.sh,ci-orchestrator-private,discussions,glibc-bootstrap,install,patchelf.rb,privateandruby-macho, and the issue templates to the same repositories exceptinstall.I used Claude Code (Claude Opus 5.5) to write the change and its specs. Claude ran
brew styleand the shared configuration specs, and checked that the new specs fail when the template skips are removed.