Compare commits
1
Commits
1fba1e06b2
...
e2e7c825a8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2e7c825a8 |
@@ -69,7 +69,9 @@ The check validates four things for every non-break-glass Agent PR:
|
|||||||
|
|
||||||
2. **Title form** — for a `role/bug` branch the title must start with
|
2. **Title form** — for a `role/bug` branch the title must start with
|
||||||
`[bug-<id>] `. For a `chore` branch the title must have no `[bug-id]`
|
`[bug-<id>] `. For a `chore` branch the title must have no `[bug-id]`
|
||||||
prefix. If both carry a bug-id they must match.
|
prefix. If both carry a bug-id they must match. The description is a
|
||||||
|
plain-language imperative; Conventional Commit forms such as `fix(scope):`
|
||||||
|
are rejected.
|
||||||
|
|
||||||
3. **Tracking and attribution** — on Bug-backed work, `## Tracking` contains both the literal
|
3. **Tracking and attribution** — on Bug-backed work, `## Tracking` contains both the literal
|
||||||
`Fixes bug-<id>` automation token and the matching navigable
|
`Fixes bug-<id>` automation token and the matching navigable
|
||||||
|
|||||||
@@ -109,6 +109,12 @@ if echo "${TITLE}" | grep -qE "^\[bug-[a-z0-9]+\] ."; then
|
|||||||
TITLE_BUG=$(echo "${TITLE}" | sed -E 's|^\[(bug-[a-z0-9]+)\].*|\1|')
|
TITLE_BUG=$(echo "${TITLE}" | sed -E 's|^\[(bug-[a-z0-9]+)\].*|\1|')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
TITLE_DESCRIPTION=$(printf '%s\n' "${TITLE}" | sed -E 's/^\[bug-[a-z0-9]+\] //')
|
||||||
|
if printf '%s\n' "${TITLE_DESCRIPTION}" | grep -qE '^[[:alnum:]-]+(\([^)]*\))?!?:[[:space:]]'; then
|
||||||
|
echo "FAIL[check-naming]: title must use a plain-language imperative without Conventional Commit syntax"
|
||||||
|
FAILED=1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${BRANCH_KIND}" = "role-bug" ]; then
|
if [ "${BRANCH_KIND}" = "role-bug" ]; then
|
||||||
if [ -z "${TITLE_BUG}" ]; then
|
if [ -z "${TITLE_BUG}" ]; then
|
||||||
echo "FAIL[check-naming]: title must lead with [${BRANCH_BUG}]"
|
echo "FAIL[check-naming]: title must lead with [${BRANCH_BUG}]"
|
||||||
|
|||||||
@@ -119,8 +119,9 @@ check "bug-id mismatch" 1 "dev/bug-x7k2m9/fix-resize" "[bug-
|
|||||||
|
|
||||||
# fail: chore branch with [bug-id] title prefix
|
# fail: chore branch with [bug-id] title prefix
|
||||||
check "chore with bug-id title" 1 "chore/bump-deps" "[bug-abc123] Bump deps" "dev"
|
check "chore with bug-id title" 1 "chore/bump-deps" "[bug-abc123] Bump deps" "dev"
|
||||||
check "role/bug Conventional title" 0 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix(hub): fix resize" "dev"
|
check "role/bug Conventional title" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix(hub): fix resize" "dev"
|
||||||
check "chore Conventional title" 0 "chore/bump-deps" "chore(deps): bump deps" "dev"
|
check "chore Conventional title" 1 "chore/bump-deps" "chore(deps): bump deps" "dev"
|
||||||
|
check "role/bug breaking title" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix!: break resize" "dev"
|
||||||
|
|
||||||
# fail: invalid branch forms
|
# fail: invalid branch forms
|
||||||
check "invalid — no role prefix" 1 "feature/foo-bar" "Add feature" "dev"
|
check "invalid — no role prefix" 1 "feature/foo-bar" "Add feature" "dev"
|
||||||
|
|||||||
Reference in New Issue
Block a user