Skip to content

chore(git-hooks): migrate branch naming from jira to linear convention [ENG-538] - #2

Open
quentinLhotellier wants to merge 1 commit into
mainfrom
eng-538-git-hooks-linear-branch-naming
Open

chore(git-hooks): migrate branch naming from jira to linear convention [ENG-538]#2
quentinLhotellier wants to merge 1 commit into
mainfrom
eng-538-git-hooks-linear-branch-naming

Conversation

@quentinLhotellier

Copy link
Copy Markdown

What

Replace the legacy Jira-style branch-naming policy in the pre-commit hook
with the new Linear convention.

  • Old: <type>/<subject>/<jira_ref> (e.g. feat/foo/EXT-123)
  • New: <linear-ticket>-<scope>-<short-description>
    • regex: ^eng-[0-9]+-[a-z0-9]+(-[a-z0-9]+)*$
    • e.g. eng-145-extranet-front-document-preview

Details

  • Rewrote check_branch_name() around the Linear regex.
  • Kept escape hatches for non-feature branches: HEAD, main/master/develop,
    preprod/staging, release/* (now permissive — allows e.g. release/extranet-legacy),
    experimental/*.
  • Consolidated all invalid cases into a single clear error message (report_invalid_format).
  • Removed now-unreachable code tied to the old 3-part format
    (report_invalid_type, report_invalid_jira_ref, TYPELIST, commit_types.conf block).
  • commit-msg hook unchanged (already accepts type(scope): subject [ENG-nnn]).

Net: -91 / +25. bash -n clean; tested against valid/invalid branch names.

Rollout

After merge, each consuming repo picks it up with make install / make git-hooks
(re-runs doInstall.sh).

Ref: ENG-538

🤖 Generated with Claude Code

…n [ENG-538]

Replace the Jira-style branch policy (<type>/<subject>/<jira_ref>) with the Linear convention (eng-<n>-<scope>-<short-desc>, regex ^eng-[0-9]+-[a-z0-9]+(-[a-z0-9]+)*$). Keep escape hatches for non-feature branches (HEAD, main/master/develop, preprod/staging, release/*, experimental/*) and consolidate all invalid cases into a single clear error message.

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

Copy link
Copy Markdown
Contributor

aujourd'hui il n'est pas possible de faire une telle modification dans ce repo car il est utilisé par d'autres personnes. Effectivement, ce dossier étant public, une telle modification casserait les installations de tous les gens qui les utilisent

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