Branch naming
branch_naming
Branch naming convention for ticket-driven workflows.
branch_name_from_ticket(ticket_id, title, labels)
Build a deterministic branch name from ticket metadata.
Produces names in the format <type>/<TICKET_ID>-<slug> where
type is derived from the ticket labels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ticket_id
|
str
|
Ticket identifier (e.g. |
required |
title
|
str
|
Ticket title used to generate the slug. |
required |
labels
|
list[str]
|
Ticket labels used to determine the branch type. |
required |
Returns:
| Type | Description |
|---|---|
str
|
A URL-safe branch name. |
Source code in packages/axm-git/src/axm_git/core/branch_naming.py
slugify(title, *, max_len=40)
Convert a title string into a URL-safe slug.
Lowercases the input, replaces non-alphanumeric characters with hyphens, collapses consecutive hyphens, and strips leading/trailing hyphens.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
The title to slugify. |
required |
max_len
|
int
|
Maximum length of the slug (default 40). Truncation prefers word boundaries when possible. |
40
|
Returns:
| Type | Description |
|---|---|
str
|
A sanitized slug, or |
str
|
contains only special characters. |