Skip to content

ci(repo): require an issue reference on pull requests - #364

Merged
botandbang merged 9 commits into
mainfrom
bnb/pr-issue-check
Nov 10, 2026
Merged

botandbang merged 9 commits into
mainfrom
bnb/pr-issue-check

Conversation

@botandbang

@botandbang botandbang commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Adds .github/workflows/pr-issue.yml, which fails a pull request unless its description names an issue (a Linear identifier, a # number or the issue's URL), its branch is bnb/loc-<number>-..., or it has the new no-issue label. Bot pull requests are skipped, and template hints in HTML comments don't count. It runs again when the description, labels or commits change, and on merge queue groups, where it passes at once because each pull request in the group already passed. Its passed job fails when the issue job fails, or is skipped for any reason other than a merge queue group, a bot or the no-issue label.

Adds PR issue passed to the Protect Main ruleset, which an admin applies with tools/ruleset.sh apply after merge. Until then the check isn't required, and the Repo checks workflow fails on main. Exempts the workflow from the policy's changes job rule, with a test, and adds the no-issue label. Updates CONTRIBUTING, the pull request template and NEW_PROJECT.

Adds tools/policy/pr-issue.test.ts, which runs the workflow's step against descriptions and branches, and yaml as a root dev dependency to read the workflow.

How it was tested

tools/policy.sh passes (88 policy tests, 52 conftest checks). Removing the exemption fails its test, and removing merge_group fails the ruleset policy. actionlint and zizmor pass.

pnpm test:tools passes (740 tests, coverage thresholds met), with 16 cases for the check covering each kind of reference, the unedited template, references inside comments, other repositories' issues, pull request URLs and branch names. Each of these breaks at least one case: dropping # numbers, dropping nocasematch, not stripping comments, dropping the word boundary, dropping the branch match, and accepting pull request URLs.

This pull request has the no-issue label, so its own run passes.

Checklist

  • Tests cover the change
  • The READMEs, docs/ and --help still say what the code does

@botandbang botandbang added the no-issue No issue to link, so the PR issue check passes label Nov 1, 2026
@botandbang
botandbang requested a review from bnb as a code owner November 1, 2026 21:33
# Conflicts:
#	.github/NEW_PROJECT.md
#	.github/rulesets/protect-main.json
#	tools/policy/workflows.rego
bnb
bnb previously approved these changes Nov 1, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code tests Tests, fixtures and test harnesses tooling Repo config, lint and build tooling, and GitHub settings labels Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Coverage Report for apps/web

Status Category Percentage Covered / Total
🟢 Lines 99.77% (🎯 99%)
🟰 ±0 pp
11079 / 11104
🟢 Statements 99.46% (🎯 99%)
🟰 ±0 pp
16977 / 17068
🟢 Functions 99.63% (🎯 99%)
🟰 ±0 pp
4578 / 4595
🟢 Branches 94.68% (🎯 94%)
🟰 ±0 pp
8247 / 8710
File CoverageNo changed files found.
Generated in workflow #619 for commit a973c5f by the Vitest Coverage Report Action

Size

Compared with main. KiB are 1,024 bytes.

This pull request main Change
Client JavaScript 806.1 KiB 806.1 KiB 0 B (0%)
Client JavaScript, brotli 272.1 KiB 272.1 KiB 0 B (0%)
Client CSS 99.1 KiB 99.1 KiB 0 B (0%)
Client CSS, brotli 14.2 KiB 14.2 KiB 0 B (0%)

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Coverage Report for apps/localtoolbox

Status Category Percentage Covered / Total
🟢 Lines 100% (🎯 100%)
🟰 ±0 pp
4461 / 4461
🟢 Statements 100% (🎯 100%)
🟰 ±0 pp
6041 / 6041
🟢 Functions 100% (🎯 100%)
🟰 ±0 pp
1762 / 1762
🟢 Branches 98.6% (🎯 50%)
🟰 ±0 pp
2889 / 2930
File CoverageNo changed files found.
Generated in workflow #619 for commit a973c5f by the Vitest Coverage Report Action

Size

Compared with main. KiB are 1,024 bytes.

This pull request main Change
Packaged (localtoolbox.zip) 360.3 KiB 360.3 KiB +1 B (+0%)
Unpacked (dist/) 810.8 KiB 810.8 KiB 0 B (0%)

bnb
bnb previously approved these changes Nov 7, 2026
@botandbang
botandbang added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 6b6b265 Nov 10, 2026
29 checks passed
@botandbang
botandbang deleted the bnb/pr-issue-check branch November 10, 2026 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation github_actions Pull requests that update GitHub Actions code no-issue No issue to link, so the PR issue check passes tests Tests, fixtures and test harnesses tooling Repo config, lint and build tooling, and GitHub settings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants