Skip to content

feat: configurable branch prefixes/ticket pattern and failure fix guidelines (#26, #27, #29)#30

Open
oto-macenauer-absa wants to merge 1 commit into
mainfrom
feature/branch-config-and-fix-guidelines
Open

feat: configurable branch prefixes/ticket pattern and failure fix guidelines (#26, #27, #29)#30
oto-macenauer-absa wants to merge 1 commit into
mainfrom
feature/branch-config-and-fix-guidelines

Conversation

@oto-macenauer-absa

Copy link
Copy Markdown
Collaborator

Summary

Implements three follow-up issues:

  • branch-name: allow overriding prefix list without rewriting full regex #26branch-prefixes: new input to override just the allowed branch-prefix list without rewriting the full regex. Comma-separated (e.g. feature,bugfix,hotfix), whitespace-trimmed. Builds ^(p1|p2|...)/[a-zA-Z0-9._-]+$ and takes precedence over branch-pattern, which stays the full-override escape hatch.
  • branch-name: make ticket pattern configurable #27branch-ticket-pattern: new input to override the previously hardcoded ticket regex (^[^/]+/[0-9]+-). Defaults to the current numeric behavior for back-compat; supports schemes like feature/PROJ-123-user-login.
  • Add fix guidelines and examples for failed checks to the run summary #29 — "How to fix" guidance: when any check fails, the step summary now appends a How to fix section with a per-check remediation tip and concrete examples. Tips are built from the same configuration inputs the checks use (title types, allowed target branches, required labels, branch prefixes, ticket pattern, etc.), so guidance stays accurate as rules change. Passing runs are unchanged. Config values are rendered as inert code spans.

Precedence (#26)

branch-prefixes > branch-pattern. Set branch-prefixes to tweak just the allowed prefixes; leave it empty and set branch-pattern to fully override the regex.

Tests

  • tests/test_branch_name.sh: prefix override, precedence, whitespace trimming, custom + default ticket patterns.
  • tests/test_check_orchestrator.sh: failure renders How to fix, lists failed-check tips, tips reflect configured inputs, passing runs omit the section.
  • Full suite green locally.

Docs

README input table updated with the three new/clarified inputs.

Closes #26
Closes #27
Closes #29

🤖 Generated with Claude Code

…26, #27, #29)

#26 branch-name: add `branch-prefixes` input to override just the allowed
prefix list without rewriting the full regex. Takes precedence over
`branch-pattern`, which remains the full-override escape hatch.

#27 branch-name: add `branch-ticket-pattern` input to override the
hardcoded numeric ticket regex, defaulting to current behavior for
back-compat (supports schemes like feature/PROJ-123-...).

#29 check.sh: append a "How to fix" section to the step summary when any
check fails. Per-check remediation tips are built from the same
configuration inputs the checks use, with concrete examples; passing runs
are unchanged. Config values rendered as inert code spans.

Adds tests for all three and documents the new inputs in README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread README.md
| `issue-reference-require-keyword` | `false` | Only keyword references count (`Fixes #123`, `Closes AB#12345`); bare `#123` / `AB#123` / URLs are rejected |
| `branch-pattern` | `^(feature|bugfix|hotfix|release|support|chore|docs|ci|dependabot)/[a-zA-Z0-9._-]+$` | Branch name regex |
| `branch-require-ticket` | `false` | Require ticket number after the branch prefix (`feature/123-user-login`) |
| `branch-prefixes` | *(empty)* | Comma-separated allowed branch prefixes, e.g. `feature,bugfix,hotfix`. When set, builds the branch pattern from this list and **takes precedence over `branch-pattern`** |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is duplication - user can define his own setup in branch-pattern or keep empty to use default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants