Skip to content

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

Open
botandbang wants to merge 8 commits into
mainfrom
bnb/pr-issue-check
Open

botandbang wants to merge 8 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
10549 / 10573
🟢 Statements 99.45% (🎯 99%)
🟰 ±0 pp
16130 / 16218
🟢 Functions 99.62% (🎯 99%)
🟰 ±0 pp
4302 / 4318
🟢 Branches 94.79% (🎯 94%)
🟰 ±0 pp
7846 / 8277
File CoverageNo changed files found.
Generated in workflow #494 for commit 8182e7a by the Vitest Coverage Report Action

Size

Compared with main. KiB are 1,024 bytes.

This pull request main Change
Client JavaScript 772.6 KiB 772.6 KiB 0 B (0%)
Client JavaScript, brotli 259.7 KiB 259.7 KiB 0 B (0%)
Client CSS 94.5 KiB 94.5 KiB 0 B (0%)
Client CSS, brotli 13.6 KiB 13.6 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
4430 / 4430
🟢 Statements 100% (🎯 100%)
🟰 ±0 pp
6009 / 6009
🟢 Functions 100% (🎯 100%)
🟰 ±0 pp
1759 / 1759
🟢 Branches 98.59% (🎯 50%)
🟰 ±0 pp
2875 / 2916
File CoverageNo changed files found.
Generated in workflow #494 for commit 8182e7a by the Vitest Coverage Report Action

Size

Compared with main. KiB are 1,024 bytes.

This pull request main Change
Packaged (localtoolbox.zip) 359 KiB 359 KiB -22 B (-0%)
Unpacked (dist/) 806.4 KiB 806.4 KiB 0 B (0%)

This branch has not been deployed

No deployments
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