Skip to content

🔧 fix: allow scoped PR titles#31

Merged
yeazelm merged 1 commit into
mainfrom
fix_lints/daggerverse
May 29, 2026
Merged

🔧 fix: allow scoped PR titles#31
yeazelm merged 1 commit into
mainfrom
fix_lints/daggerverse

Conversation

@yeazelm

@yeazelm yeazelm commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Allows ghcontrib PR title checks to accept scoped conventional commit titles like 🔧 fix(percolator): ....
  • Keeps the existing emoji/type pairing strict, including colon aliases such as :wrench: fix(scope): ....
  • Updates ghrelease classification so scoped commit subjects drive the same SemVer bump and release-note section as unscoped subjects.
  • Keeps ♻️ refactor release commits patch-level by default while letting refactor! opt into a major bump.

How it works

The PR title checker now builds the allowed emoji/type pairs into regexes that accept an optional lowercase scope and optional breaking marker before the colon.

The release script normalizes the supported emoji or colon-alias prefix before classifying feat, fix, and chore, so fix(scope): is treated the same as fix: for patch releases.

Refactor commits are classified separately into a Refactors release-note section. Plain refactors stay patch-level under the current release model; refactor! and refactor(scope)! are treated as breaking changes and force a major bump.

Test plan

  • direnv exec . go test ./pr_title.go ./pr_test.go
  • sh -n ghrelease/create-release.sh
  • Scoped release dry-runs for patch, minor, and major classification
  • Scoped refactor release dry-runs for patch and major classification
  • Dagger ghrelease dry-run against a synthetic scoped fix commit
  • Dagger ghrelease dry-run against a synthetic refactor commit
  • Dagger ghcontrib check-pull-request against paper PR #52
  • PR workflow passes

Fixes PCC-615

@yeazelm yeazelm requested a review from a team May 29, 2026 00:16
@linear-code

linear-code Bot commented May 29, 2026

Copy link
Copy Markdown

PCC-615

@greptile-apps

greptile-apps Bot commented May 29, 2026

Copy link
Copy Markdown

Greptile Summary

Extends the ghcontrib PR title checker and the ghrelease commit classifier to accept scoped conventional-commit subjects (e.g. 🔧 fix(scope): …) and adds explicit ♻️ refactor support as a major-bump type in the release pipeline.

  • ghcontrib/pr_title.go replaces the static prefix list with regex-built patterns that allow an optional lowercase scope and optional ! breaking marker; ghcontrib/pr_test.go adds a comprehensive table-driven test suite covering all new forms.
  • ghrelease/create-release.sh introduces a commit_type() helper that strips emoji/colon-alias prefixes before classification, routes scoped subjects to the same SemVer bucket as their unscoped counterparts, and always promotes ♻️ refactor commits to a major bump with a dedicated Refactors release-note section.
  • flake.nix / go.mod / go.sum are routine dependency updates.

Confidence Score: 5/5

Safe to merge; the logic changes are well-tested and the shell function is correctly structured

The regex-based PR title checker is correct and thoroughly exercised by the new test suite. The commit_type() shell helper correctly normalises emoji and colon-alias prefixes before classification, and scoped subjects flow through to the right SemVer bucket. The only findings are minor documentation gaps.

ghrelease/create-release.sh and ghrelease/README.md — the refactor!: classification behaviour warrants a comment or explicit documentation entry

Important Files Changed

Filename Overview
ghcontrib/pr_title.go New file introducing regex-based PR title validation with support for optional scope and breaking marker; logic is correct and well-structured
ghcontrib/pr_test.go Comprehensive test suite for valid and invalid PR title forms including scoped, breaking, colon-alias, and mixed combinations
ghcontrib/pr.go Removes old prefix-based validation in favour of the new regex-backed validatePullRequestTitle; clean refactor with no logic gaps
ghrelease/create-release.sh Introduces commit_type() helper to normalise emoji/colon-alias prefixes before classification; refactor commits always force a major bump; refactor!: lands in Refactors rather than Breaking Changes
ghrelease/main.go Doc-comment update to reflect scoped commit classification; no functional changes
ghrelease/README.md New table documents classification rules but omits the scoped-breaking forms and the refactor! edge case
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
ghrelease/README.md:15
The Breaking Changes row only lists the unscoped `!` forms, but the script also routes `feat(scope)!:`, `fix(scope)!:`, and `chore(scope)!:` to the Breaking Changes section. Additionally, `refactor!:` and `refactor(scope)!:` are routed to the Refactors section (not Breaking Changes) — a reader using the `!` marker on a refactor commit would not find it in the Breaking Changes changelog entry. Both gaps are worth surfacing here.

```suggestion
| `feat!: ...`, `feat(scope)!: ...`, `fix!: ...`, `fix(scope)!: ...`, `chore!: ...`, or `chore(scope)!: ...` | Major bump, Breaking Changes section |
| `refactor!: ...` or `refactor(scope)!: ...` | Major bump, Refactors section (not Breaking Changes) |
```

### Issue 2 of 2
ghrelease/create-release.sh:51
`refactor!:` treated the same as `refactor:` — both land in Refactors, not Breaking Changes. The PR title checker permits `♻️ refactor!:` (the `!?` in the regex makes the breaking marker valid), so a contributor who writes `♻️ refactor!: remove public API` will expect that commit to appear under Breaking Changes in the release notes, not Refactors. If this is intentional, a comment here explaining why `!` is ignored for the refactor type would prevent future confusion.

Reviews (3): Last reviewed commit: "🔧 fix(ghcontrib): allow scoped PR title..." | Re-trigger Greptile

Comment thread ghrelease/README.md
Comment thread ghcontrib/pr_test.go
@yeazelm yeazelm force-pushed the fix_lints/daggerverse branch from f35da17 to d647d91 Compare May 29, 2026 02:24
@yeazelm yeazelm changed the title 🔧 fix(ghcontrib): allow scoped PR titles 🔧 fix: allow scoped PR titles May 29, 2026

@jpmcb jpmcb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is great! The only thing I'm unsure of: refactors being major bumps - is the idea here that, with a refactor, we're guarding on SDK / API changes and expecting a breaking change?

@yeazelm yeazelm force-pushed the fix_lints/daggerverse branch from d647d91 to 9f40734 Compare May 29, 2026 17:43
@yeazelm

yeazelm commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

Yeah, I was a little to fast and loose with the refactor. I've moved it down to patch by default which was what I had in my head and not what came out in the PR

@yeazelm yeazelm merged commit 45e997a into main May 29, 2026
0 of 2 checks passed
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