Skip to content

feat: branch-aware-pr-templates#8

Merged
jopmiddelkamp merged 1 commit into
developfrom
feature/branch-aware-pr-templates
Jun 1, 2026
Merged

feat: branch-aware-pr-templates#8
jopmiddelkamp merged 1 commit into
developfrom
feature/branch-aware-pr-templates

Conversation

@jopmiddelkamp
Copy link
Copy Markdown
Contributor

No description provided.

Resolve PR body templates by branch type, most-specific first:
branch-specific -> group -> bflow default -> git default.

Templates live in .github/pr-templates/bflow-<key>.md. The "group"
layer reuses the conventional-commit type bflow already computes, so
the fix family (fix, release-fix, hotfix-fix) shares bflow-fix.md with
no config file and no new dependency. Opt-in: with no pr-templates dir,
existing git-default behavior is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude Bot commented Jun 1, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds branch-aware PR template resolution. When bflow finish opens a PR, it now looks up a template under .github/pr-templates/bflow-<key>.md using a most-specific → group → default order, and passes the resolved path to the hosting layer (which falls back to existing git/GitHub default templates when nothing matches).

Changes:

  • New BranchType::pr_template_keys() helper and new hosting::template resolver module.
  • HostingPlatform::create_or_get_pr gains a template: Option<&str> parameter; finish_work resolves and passes the template; main.rs dispatch simplified to forward &BranchType to release-fix/hotfix-fix finishers.
  • README and Claude skill docs document the new template lookup; tests/mocks updated for the new API and added unit tests for resolver and key mapping.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/git/branch.rs Adds pr_template_keys() + tests mapping branch types to (specific, group) keys.
src/hosting/template.rs New resolver module with specific→group→default lookup and tests.
src/hosting/mod.rs Exports template module; extends trait signature with template param + doc.
src/hosting/github.rs Uses provided template path first, falling back to repo default PR template paths.
src/flows/finish_work.rs Resolves template, prints path, passes to hosting; release-fix/hotfix-fix take &BranchType.
src/main.rs Drops manual destructuring; forwards branch_type to release-fix/hotfix-fix finishers.
tests/common/mod.rs MockHosting updated for new signature; appends :template=... suffix in calls.
tests/finish_work_test.rs Constructs BranchType values for the new finish API.
README.md Documents .github/pr-templates/ resolution order and file mapping.
.claude/skills/bflow/SKILL.md Mirrors README PR-template docs in the skill guide.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jopmiddelkamp jopmiddelkamp merged commit c2c199b into develop Jun 1, 2026
9 checks passed
@jopmiddelkamp jopmiddelkamp deleted the feature/branch-aware-pr-templates branch June 1, 2026 04:14
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