Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31b42b1851 |
No files matched your search
@@ -9,19 +9,15 @@ Git standard. The current action fails (exits 1) on any violation; `@v1` is the
|
||||
## Standard
|
||||
|
||||
```
|
||||
Branch: <role>/t-<ticket-id>/<kebab-description> e.g. dev/t-mazzph405ay0/fix-terminal-resize
|
||||
<role>/bug-<id>/<kebab-description> retired Bug ids remain accepted
|
||||
Mission: mission/mi-<mission-id> the work_branch AgentHub supplies to a Mission
|
||||
Chore: chore/<kebab-description> untracked trivia only (dep bumps, typos, CI tweaks)
|
||||
Title: [t-mazzph405ay0] fix(terminal): preserve resize state
|
||||
fix(terminal): preserve resize state on a Mission branch
|
||||
Branch: <role>/bug-<id>/<kebab-description> e.g. dev/bug-x7k2m9/fix-terminal-resize
|
||||
Chore: chore/<kebab-description> bug-less trivia only (dep bumps, typos, CI tweaks)
|
||||
Title: [bug-x7k2m9] fix(terminal): preserve resize state
|
||||
```
|
||||
|
||||
- `<role>` must be a roster handle: `dev` | `ux` | `ops` | `security` | `perf` | `architect` | `support`
|
||||
- `<ticket-id>` is a native AgentHub Ticket id: `t-` and twelve characters from `0123456789abcdefghjkmnpqrstvwxyz`; `bug-<id>` (lowercase alphanumerics) is the retired form
|
||||
- `<mission-id>` is `mi-` and twelve of the same characters; a Mission branch's title is `type(scope): description` with no tracked-id prefix and no `## Tracking` section
|
||||
- `<bug-id>` is `bug-` followed by lowercase alphanumeric characters
|
||||
- `<kebab-description>` is lowercase alphanumeric with hyphens, starting with a letter or digit
|
||||
- When both the branch and the title carry a tracked id they **must match**
|
||||
- When both the branch and the title carry a bug-id they **must match**
|
||||
- Break-glass: PRs authored by `dfritz` are exempt from all checks
|
||||
|
||||
## Usage
|
||||
|
||||
+3
-5
@@ -6,11 +6,9 @@ description: |
|
||||
continue-on-error: true on the job (or pin @v1, which never fails).
|
||||
|
||||
Standard:
|
||||
branch: <role>/t-<ticket-id>/<kebab> e.g. dev/t-mazzph405ay0/fix-terminal-resize
|
||||
<role>/bug-<id>/<kebab> retired Bug ids remain accepted
|
||||
mission: mission/mi-<mission-id> the work_branch AgentHub supplies to a Mission
|
||||
chore: chore/<kebab> untracked trivia only
|
||||
title: [t-<ticket-id>] type(scope): description, or type(scope): description on a Mission branch
|
||||
branch: <role>/bug-<id>/<kebab> e.g. dev/bug-x7k2m9/fix-terminal-resize
|
||||
chore: chore/<kebab> bug-less trivia only
|
||||
title: [bug-<id>] type(scope): description
|
||||
|
||||
Role must be a roster handle: dev | ux | ops | security | perf | architect | support
|
||||
Break-glass: PRs authored by dfritz are exempt.
|
||||
|
||||
@@ -101,32 +101,24 @@ VISIBLE_BODY=$(printf '%s\n' "${RENDERED_BODY}" |
|
||||
hidden_content_guidance='move ## Tracking and ## Attribution outside collapsed <details> or <video>/<audio> fallback content'
|
||||
|
||||
# ---- branch form ----
|
||||
# A tracked id is a native AgentHub Ticket (t- plus twelve id characters) or a
|
||||
# retired Bug id (bug- plus lowercase alphanumerics).
|
||||
TRACKED_ID='(t-[0-9abcdefghjkmnpqrstvwxyz]{12}|bug-[a-z0-9]+)'
|
||||
# <role>/<tracked-id>/<kebab>
|
||||
if echo "${BRANCH}" | grep -qE "^(dev|ux|ops|security|perf|architect|support)/${TRACKED_ID}/[a-z0-9][a-z0-9-]*$"; then
|
||||
# <role>/bug-<id>/<kebab>
|
||||
if echo "${BRANCH}" | grep -qE "^(dev|ux|ops|security|perf|architect|support)/bug-[a-z0-9]+/[a-z0-9][a-z0-9-]*$"; then
|
||||
BRANCH_KIND="role-bug"
|
||||
BRANCH_BUG=$(echo "${BRANCH}" | sed -E 's|^[^/]+/([^/]+)/.*|\1|')
|
||||
# mission/<mission-id>: the work_branch AgentHub supplies to a Mission.
|
||||
elif echo "${BRANCH}" | grep -qE "^mission/mi-[0-9abcdefghjkmnpqrstvwxyz]{12}$"; then
|
||||
BRANCH_KIND="mission"
|
||||
BRANCH_BUG=$(echo "${BRANCH}" | sed -E 's|^[^/]+/(bug-[a-z0-9]+)/.*|\1|')
|
||||
# chore/<kebab>
|
||||
elif echo "${BRANCH}" | grep -qE "^chore/[a-z0-9][a-z0-9-]*$"; then
|
||||
BRANCH_KIND="chore"
|
||||
else
|
||||
echo "FAIL[check-naming]: branch '${BRANCH}' does not match convention"
|
||||
echo " expected: <role>/t-<ticket-id>/<kebab> (role: dev|ux|ops|security|perf|architect|support)"
|
||||
echo " or: <role>/bug-<id>/<kebab>"
|
||||
echo " or: mission/mi-<mission-id>"
|
||||
echo " expected: <role>/bug-<id>/<kebab> (role: dev|ux|ops|security|perf|architect|support)"
|
||||
echo " or: chore/<kebab>"
|
||||
FAILED=1
|
||||
fi
|
||||
|
||||
# ---- title form ----
|
||||
TITLE_BUG=""
|
||||
if echo "${TITLE}" | grep -qE "^\[${TRACKED_ID}\] ."; then
|
||||
TITLE_BUG=$(echo "${TITLE}" | sed -E 's|^\[([^]]+)\].*|\1|')
|
||||
if echo "${TITLE}" | grep -qE "^\[bug-[a-z0-9]+\] ."; then
|
||||
TITLE_BUG=$(echo "${TITLE}" | sed -E 's|^\[(bug-[a-z0-9]+)\].*|\1|')
|
||||
fi
|
||||
|
||||
if [ "${BRANCH_KIND}" = "role-bug" ]; then
|
||||
@@ -139,7 +131,7 @@ if [ "${BRANCH_KIND}" = "role-bug" ]; then
|
||||
echo "FAIL[check-naming]: bug-id mismatch — branch carries '${BRANCH_BUG}' but title carries '${TITLE_BUG}'"
|
||||
FAILED=1
|
||||
elif ! printf '%s\n' "${TITLE}" | grep -qE "^\\[${BRANCH_BUG}\\] [a-z][a-z0-9-]*\\([a-z0-9][a-z0-9-]*\\)!?: .*[^[:space:]]$"; then
|
||||
echo "FAIL[check-naming]: tracked title must use '[${BRANCH_BUG}] type(scope): description'"
|
||||
echo "FAIL[check-naming]: Bug-backed title must use '[${BRANCH_BUG}] type(scope): description'"
|
||||
FAILED=1
|
||||
fi
|
||||
|
||||
@@ -163,11 +155,7 @@ if [ "${BRANCH_KIND}" = "role-bug" ]; then
|
||||
fi
|
||||
|
||||
elif [ "${BRANCH_KIND}" = "chore" ] && [ -n "${TITLE_BUG}" ]; then
|
||||
echo "FAIL[check-naming]: chore branch should not carry a [tracked-id] title prefix"
|
||||
FAILED=1
|
||||
elif [ "${BRANCH_KIND}" = "mission" ] && ! printf '%s\n' "${TITLE}" | grep -qE "^[a-z][a-z0-9-]*\([a-z0-9][a-z0-9-]*\)!?: .*[^[:space:]]$"; then
|
||||
echo "FAIL[check-naming]: Mission branch title must use 'type(scope): description'"
|
||||
echo " have: ${TITLE}"
|
||||
echo "FAIL[check-naming]: chore branch should not carry a [bug-id] title prefix"
|
||||
FAILED=1
|
||||
fi
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ canonical_body() {
|
||||
check() {
|
||||
local desc="$1" want_fail="$2" branch="$3" title="$4" author="$5"
|
||||
local bug body
|
||||
bug=$(printf '%s\n' "$branch" | sed -nE 's|^[^/]+/(bug-[a-z0-9]+\|t-[0-9a-z]{12})/.*|\1|p')
|
||||
bug=$(printf '%s\n' "$branch" | sed -nE 's|^[^/]+/(bug-[a-z0-9]+)/.*|\1|p')
|
||||
body=$(canonical_body "${bug:-bug-test}")
|
||||
local out rc=0
|
||||
out=$(cd "${FIXTURES}" && HEAD_BRANCH="$branch" PR_TITLE="$title" PR_AUTHOR="$author" \
|
||||
@@ -159,23 +159,6 @@ check "invalid — uppercase bug-id" 1 "dev/bug-ABC123/thing" "[b
|
||||
check "invalid — empty kebab" 1 "dev/bug-x7k2m9/" "[bug-x7k2m9] No kebab" "dev"
|
||||
check "invalid — no bug prefix on seg" 1 "dev/x7k2m9/fix-resize" "Fix resize" "dev"
|
||||
|
||||
# native Ticket ids on role branches, matching the title and ## Tracking
|
||||
check "dev/t-ticket matching title" 0 "dev/t-mazzph405ay0/accept-mission-branches" "[t-mazzph405ay0] fix(check): accept mission branches" "dev"
|
||||
check "ux/t-ticket matching title" 0 "ux/t-6ec3tjxva5pm/one-header-height" "[t-6ec3tjxva5pm] fix(frame): one header height" "ux"
|
||||
check "t-ticket mismatch" 1 "dev/t-mazzph405ay0/accept-mission" "[t-6ec3tjxva5pm] fix(check): accept mission" "dev"
|
||||
check "t-ticket no title prefix" 1 "dev/t-mazzph405ay0/accept-mission" "fix(check): accept mission" "dev"
|
||||
check "invalid — short ticket id" 1 "dev/t-abc123/thing" "[t-abc123] fix(x): thing" "dev"
|
||||
check "invalid — ticket id with l" 1 "dev/t-mazzph405ayl/thing" "[t-mazzph405ayl] fix(x): thing" "dev"
|
||||
|
||||
# Mission work branches: AgentHub supplies mission/<mission-id>; a Conventional
|
||||
# title, no tracked-id prefix, attribution still required
|
||||
check "mission Conventional title" 0 "mission/mi-hvaet01kawp2" "fix(gitea): name the site Fritzlab Code" "ux"
|
||||
check "mission breaking title" 0 "mission/mi-hvaet01kawp2" "feat(adapter)!: drop the stock footer" "ux"
|
||||
check "mission plain title" 1 "mission/mi-hvaet01kawp2" "Name the site Fritzlab Code" "ux"
|
||||
check "mission tracked-id title" 1 "mission/mi-hvaet01kawp2" "[bug-abc] fix(gitea): name the site" "ux"
|
||||
check "invalid — mission short id" 1 "mission/mi-abc" "fix(gitea): name the site" "ux"
|
||||
check "invalid — mission with kebab" 1 "mission/mi-hvaet01kawp2/extra" "fix(gitea): name the site" "ux"
|
||||
|
||||
# Bug-backed PR body contract. These mirror the omissions in agenthub#779.
|
||||
BODY=$(canonical_body "bug-x7k2m9")
|
||||
check_contract "raw Fixes only rejects missing link and attribution" \
|
||||
|
||||
Reference in new issue
Block a user