feat(tbd_ship): gate auto-merge on the risk tier; unclassified is not low (#63) #73
@@ -37,7 +37,7 @@ const (
|
||||
func (t *TBDShip) Descriptor() registry.ToolDescriptor {
|
||||
return registry.ToolDescriptor{
|
||||
Name: "tbd_ship",
|
||||
Description: "Trunk-based ship of a single-file change: branch from base, write the file, open a PR, and auto-merge (squash) to base ONLY when the head commit's CI is fully green AND the named issue carries exactly one risk/ label, risk/low. Fails closed to PR-only (never merges) when CI is pending, red, or absent, when no issue is named or its risk/ label is missing, ambiguous, unknown, risk/medium or risk/high, when the issue cannot be read, when the base branch requires reviews, or when the merge isn't clean — returning the PR for manual handling with a reason. Set ci_timeout_seconds to poll CI to completion (default 0 = snapshot, which returns pending right after opening the PR). Returns {merged, pr_url, pr_number, ci_status, reason, branch}.",
|
||||
Description: "Trunk-based ship of a single-file change: branch from base, write the file, open a PR, and auto-merge (squash) to base ONLY when the head commit's CI is fully green AND the named issue carries exactly one risk/ label, risk/low. Fails closed to PR-only (never merges) when CI is pending, red, or absent, when no issue is named or its risk/ label is missing, ambiguous, unknown, risk/medium or risk/high, when the issue cannot be read, when the base branch requires reviews, or when the merge isn't clean — returning the PR for manual handling with a reason. Set ci_timeout_seconds to poll CI to completion (default 0 = snapshot, which returns pending right after opening the PR). Returns {merged, pr_url, pr_number, ci_status, risk, reason, branch}.",
|
||||
InputSchema: json.RawMessage(`{
|
||||
"type":"object",
|
||||
"properties":{
|
||||
|
||||
@@ -85,6 +85,9 @@ func TestClassifyRisk(t *testing.T) {
|
||||
{"unknown value", l("risk/extreme"), riskUnknown},
|
||||
{"empty value", l("risk/"), riskUnknown},
|
||||
{"wrong case", l("Risk/Low"), riskNone},
|
||||
{"value case matters: risk/Low is unknown, not low", l("risk/Low"), riskUnknown},
|
||||
{"trailing space in the value is unknown, not low", l("risk/low "), riskUnknown},
|
||||
{"leading space in the value is unknown, not low", l("risk/ low"), riskUnknown},
|
||||
{"prefix only inside a name", l("not-risk/low"), riskNone},
|
||||
}
|
||||
for _, tc := range tests {
|
||||
|
||||
Reference in New Issue
Block a user