Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/devteam/scripts/devteam.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8317,6 +8317,9 @@ function cmdDecide() {
const incs = refs.map((r) => logGet(r)).filter(isIncident);
if (incs.length !== 1) die(`an incident-fix decision names exactly one incident in --refs (sensor incident …), then the fix ticket's id; it names ${incs.length}`);
const inc = incs[0];
// a fix names its ticket too, picked first: ticket add takes only a decision that names it, and
// an answer approves one decision, so a fix decided without it meant asking the owner again
if (!/^\s*(watch|ignore)\b/i.test(what) && !refs.some((r) => r !== inc.id && !/^[a-z]-\d{8}-/.test(r))) die(`a fix decision names its fix ticket's id in --refs too (pick it first): --refs ${inc.id} <ticket-id>. ticket add needs a decision that names the ticket, and an answer approves one decision, so leaving it out means asking again; "watch …" or "ignore …" needs no ticket`);
const want = sevScope(incidentSeverity(inc));
if (scope && scope !== want) die(`${inc.id} has computed severity ${incidentSeverity(inc)}: its scope is ${want}, not ${scope}`);
scope = want;
Expand Down
1 change: 1 addition & 0 deletions test/lib/chain.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,7 @@ out({ cursor: 'x' });
assert.equal(dec.status, 3, dec.err);
assert.match(dt(['decide', '--class', 'incident-fix', '--scope', 'sev:low', '--refs', pid, tid, '--', 'x'], sup).err, /its scope is sev:high, not sev:low/);
assert.match(dt(['decide', '--class', 'incident-fix', '--refs', tid, '--', 'x'], sup).err, /names exactly one incident/);
assert.match(dt(['decide', '--class', 'incident-fix', '--refs', pid, '--', 'fix OutOfMemory'], sup).err, /names its fix ticket's id/, 'a fix without its ticket would mean asking again');
const q = must(['ask', '--class', 'incident-fix', '--blocks', pid, '--question', 'Fix the checkout OutOfMemory?', '--recommendation', 'fix it', '--default', 'fix it', '--deadline', '2h', '--reasons', 'below-rung'], sup);
const qv = json(must(['questions', '--all', '--json'])).find((x) => x.id === q);
assert.equal(qv.scope, 'sev:high');
Expand Down
Loading