AgentHub supplies every Mission a work_branch of the form mission/<mission-id>, and Bug ids were retired in favour of native Ticket ids. The check accepted neither, so no Mission-driven pull request could pass validate / naming in a consumer that pins this action (t-mazzph405ay0). A Mission branch needs a Conventional title and the visible attribution, and no Tracking section, because the Mission is the tracking. Role branches now carry a native Ticket id or the retired Bug id; the title and Tracking rules are unchanged apart from the id they name. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
1edb148aa1
commit
4c17d84dd2
4 files changed
+52
-17
No files matched your search
@@ -101,24 +101,32 @@ VISIBLE_BODY=$(printf '%s\n' "${RENDERED_BODY}" |
|
||||
hidden_content_guidance='move ## Tracking and ## Attribution outside collapsed <details> or <video>/<audio> fallback content'
|
||||
|
||||
# ---- branch form ----
|
||||
# <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
|
||||
# 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
|
||||
BRANCH_KIND="role-bug"
|
||||
BRANCH_BUG=$(echo "${BRANCH}" | sed -E 's|^[^/]+/(bug-[a-z0-9]+)/.*|\1|')
|
||||
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"
|
||||
# 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>/bug-<id>/<kebab> (role: dev|ux|ops|security|perf|architect|support)"
|
||||
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 " or: chore/<kebab>"
|
||||
FAILED=1
|
||||
fi
|
||||
|
||||
# ---- title form ----
|
||||
TITLE_BUG=""
|
||||
if echo "${TITLE}" | grep -qE "^\[bug-[a-z0-9]+\] ."; then
|
||||
TITLE_BUG=$(echo "${TITLE}" | sed -E 's|^\[(bug-[a-z0-9]+)\].*|\1|')
|
||||
if echo "${TITLE}" | grep -qE "^\[${TRACKED_ID}\] ."; then
|
||||
TITLE_BUG=$(echo "${TITLE}" | sed -E 's|^\[([^]]+)\].*|\1|')
|
||||
fi
|
||||
|
||||
if [ "${BRANCH_KIND}" = "role-bug" ]; then
|
||||
@@ -131,7 +139,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]: Bug-backed title must use '[${BRANCH_BUG}] type(scope): description'"
|
||||
echo "FAIL[check-naming]: tracked title must use '[${BRANCH_BUG}] type(scope): description'"
|
||||
FAILED=1
|
||||
fi
|
||||
|
||||
@@ -155,7 +163,11 @@ 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 [bug-id] title prefix"
|
||||
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}"
|
||||
FAILED=1
|
||||
fi
|
||||
|
||||
|
||||
Reference in new issue
Block a user