Promote a pipeline-held go once the pipeline is green, and stop calling every wait "nunggu MR lain". lti-api !1388 was a go held at waiting because its pipeline was still running; the pipeline turned green but only a new commit could move the verdict, so the board never offered Gas and labelled it as waiting on another MR. The Hub now restores the model's go (and its own reason) on the next poll when the reviewed commit's pipeline is success, edits the verdict note and notifies; a waiting the model chose itself stays. The board's waiting mark is an hourglass with a neutral label.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -756,3 +756,55 @@ test('a provider down for about an hour ends in a manual check that says so', as
|
||||
assert.doesNotMatch(body, /not valid JSON/);
|
||||
assert.equal(w.store.nextEvent(), undefined);
|
||||
});
|
||||
|
||||
// lti-api !1388 (2026-11-09): the model said go, the pipeline was still running, so the hard
|
||||
// rule held it at waiting. The pipeline turned green but nothing moved it, and the board
|
||||
// showed no Gas.
|
||||
test('a go held by a running pipeline becomes go once that pipeline is green, without a new review', async () => {
|
||||
const w = world();
|
||||
w.gl.mrs.set(31, { sha: 'efef3333', state: 'opened', labels: ['labuh'], pipelineStatus: 'running' });
|
||||
const held: Checked = { ...checked('go', 'Urutan deploy aman.'), verdict: 'waiting', reason: 'Nunggu pipeline hijau.', heldReason: 'Urutan deploy aman.', overrides: ['go → waiting: pipeline is running'] };
|
||||
w.script(ok(held));
|
||||
await w.hub.poll();
|
||||
await w.hub.drain();
|
||||
const a = () => w.store.ajuan(PROJECT, 31)!;
|
||||
assert.equal(a().status, 'waiting');
|
||||
assert.deepEqual(allowedActions(a(), false), ['tunda', 'tolak'], 'no Gas while waiting');
|
||||
|
||||
await w.hub.poll();
|
||||
assert.equal(a().status, 'waiting', 'still running: nothing changes');
|
||||
|
||||
w.gl.mrs.get(31)!.pipelineStatus = 'success';
|
||||
await w.hub.poll();
|
||||
assert.equal(a().status, 'go');
|
||||
assert.equal(w.calls.review.length, 1, 'no second review');
|
||||
const v = JSON.parse(a().verdict_json!);
|
||||
assert.equal(v.reason, 'Urutan deploy aman.');
|
||||
assert.deepEqual(v.overrides, ['waiting → go: pipeline success']);
|
||||
assert.ok(allowedActions(a(), false).includes('gas'));
|
||||
const verdict = w.store.outbox(a().id).find((o) => o.kind === 'verdict')!;
|
||||
assert.match(verdict.body, /Aman|aman|🟢/);
|
||||
assert.match(verdict.body, /waiting → go: pipeline success/);
|
||||
|
||||
await w.hub.poll();
|
||||
assert.equal(w.store.outbox(a().id).filter((o) => o.kind === 'verdict').length, 1, 'the verdict note is edited, not duplicated');
|
||||
});
|
||||
|
||||
test('a waiting the model chose itself, or a failed pipeline, is not promoted', async () => {
|
||||
const w = world();
|
||||
w.gl.mrs.set(32, { sha: 'a0a04444', state: 'opened', labels: ['labuh'], pipelineStatus: 'success' });
|
||||
w.script(ok({ ...checked('go', 'x'), verdict: 'waiting', reason: 'Nunggu MR backend.' }));
|
||||
await w.hub.poll();
|
||||
await w.hub.drain();
|
||||
await w.hub.poll();
|
||||
assert.equal(w.store.ajuan(PROJECT, 32)!.status, 'waiting');
|
||||
|
||||
const f = world();
|
||||
f.gl.mrs.set(33, { sha: 'b0b05555', state: 'opened', labels: ['labuh'], pipelineStatus: 'running' });
|
||||
f.script(ok({ ...checked('go', 'x'), verdict: 'waiting', reason: 'Nunggu pipeline hijau.', heldReason: 'x', overrides: ['go → waiting: pipeline is running'] }));
|
||||
await f.hub.poll();
|
||||
await f.hub.drain();
|
||||
f.gl.mrs.get(33)!.pipelineStatus = 'failed';
|
||||
await f.hub.poll();
|
||||
assert.equal(f.store.ajuan(PROJECT, 33)!.status, 'waiting');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user