Skip to content

sync: add generic issue and pull request templates - #507

Merged
HaraldNordgren merged 5 commits into
mainfrom
sync-pull-request-template
Nov 3, 2026
Merged

HaraldNordgren merged 5 commits into
mainfrom
sync-pull-request-template

Conversation

@HaraldNordgren

@HaraldNordgren HaraldNordgren commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

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.

@HaraldNordgren
HaraldNordgren requested a review from a team as a code owner November 3, 2026 10:28
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Summary

Summary by CodeRabbit

  • Documentation
    • 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.

Changes: Shared contribution templates and sync

Layer / File(s) Summary
Contribution template content
.github/actions/sync/pull_request.template.md, .github/actions/sync/issue_bug.template.yml, .github/actions/sync/issue_config.template.yml
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: Passed 4
Check name Status Explanation
Title check Passed The title clearly summarises the main change: adding generic issue and pull request templates through the sync process.
Description check Passed The description explains the template changes, sync behaviour, affected repositories, and validation performed. It is directly related to the changeset.
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.

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.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

Comment thread .github/actions/sync/shared-config.rb Resolved

@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, looks good when Coderabbit and CI are happy!

@HaraldNordgren HaraldNordgren changed the title sync: add generic pull request template sync: add generic issue and pull request templates Nov 3, 2026
Comment thread .github/actions/sync/shared-config.rb Resolved
@HaraldNordgren
HaraldNordgren force-pushed the sync-pull-request-template branch from 1ac4f74 to 0ae4de5 Compare November 3, 2026 10:51
Comment thread .github/actions/sync/shared-config.rb Resolved
Comment thread .github/actions/sync/shared-config.rb Resolved
Comment thread .github/actions/sync/shared-config.rb Resolved
- 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.
- Include untracked files when looking for existing templates, so
  local syncs don't add a shared template beside an uncommitted one.
@HaraldNordgren
HaraldNordgren force-pushed the sync-pull-request-template branch from f03e175 to ae2671b Compare November 3, 2026 11:27
Comment thread .github/actions/sync/shared-config.rb Resolved
- Only count template paths that still exist, so local syncs treat
  templates deleted but not yet committed as gone.
@HaraldNordgren

HaraldNordgren commented Nov 3, 2026 •

Copy link
Copy Markdown
Member Author

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

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

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.

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

Still looks great, thanks!

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.

2 participants