@futurelastic/colab-handbook 1.13.0-rc.19 → 1.13.0-rc.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/tools/colab +6 -2
- package/tools/lib/release-finalize.js +9 -3
- package/tools/lib/release-policy.js +11 -3
package/package.json
CHANGED
package/tools/colab
CHANGED
|
@@ -1901,7 +1901,9 @@ Conditions (--json checks[].condition; required:false means reported, not blocki
|
|
|
1901
1901
|
already-final exit 0 (nothing to do yet is the ordinary output)
|
|
1902
1902
|
--tag <rc> pin the candidate a human reviewed; refused unless it is the newest one
|
|
1903
1903
|
--answered-by <n> with COLAB_HUMAN=1 and --tag: the human bar for a final that is a human act.
|
|
1904
|
-
No field, flag or project.yml value lowers it, and it never shortens a test period
|
|
1904
|
+
No field, flag or project.yml value lowers it, and it never shortens a test period.
|
|
1905
|
+
Where the final is a human act the period is informational anyway, and
|
|
1906
|
+
release.test-period: 0d declares none at all (#549)
|
|
1905
1907
|
--dry measure and report; open, post, tag and close nothing
|
|
1906
1908
|
--json { repo, row, route, final, testPeriodDays, lastFinal, dry, auto, candidate, tracking,
|
|
1907
1909
|
periodStart, periodEndsAt, state, tagged, finalTag, checks, handoff,
|
|
@@ -2132,7 +2134,9 @@ function cmdReleaseFinalize(argv) {
|
|
|
2132
2134
|
const tNew = version0 ? trackings.get(version0) : null;
|
|
2133
2135
|
if (newest && tNew && tNew.number) {
|
|
2134
2136
|
const pNew = releaseFinalize.periodVerdict({ cutAt: newest.cutAt, trackingCreatedAt: tNew.createdAt, testPeriodDays: policy.effective.testPeriodDays, now });
|
|
2135
|
-
comment(tNew.number, { candidate: newest.tag },
|
|
2137
|
+
comment(tNew.number, { candidate: newest.tag }, pNew.days === 0
|
|
2138
|
+
? `Candidate **${newest.tag}** (\`${shortSha(newest.sha)}\`) picked up — no test period on this repo (\`release.test-period: 0d\`, #549): the human's finalize is the test.`
|
|
2139
|
+
: walk
|
|
2136
2140
|
? `Candidate **${newest.tag}** (\`${shortSha(newest.sha)}\`) picked up — its own test period runs ${pNew.start} → ${pNew.endsAt}. A newer candidate does not restart an older one's clock: the newest candidate clean for its own period is finalized (\`--auto\`).`
|
|
2137
2141
|
: `Candidate **${newest.tag}** (\`${shortSha(newest.sha)}\`) picked up — its test period runs ${pNew.start} → ${pNew.endsAt}. A new candidate restarts it.`);
|
|
2138
2142
|
}
|
|
@@ -297,7 +297,10 @@ function whyNoFinal({ state, candidate, checks, period, skipped, now } = {}) {
|
|
|
297
297
|
|
|
298
298
|
// ---- the test period ----------------------------------------------------------------------------
|
|
299
299
|
|
|
300
|
-
/**
|
|
300
|
+
/**
|
|
301
|
+
* { start, endsAt, days, elapsed, detail } — start = max(cutAt, trackingCreatedAt), ISO strings. `days` 0
|
|
302
|
+
* (#549, human final only) is no test period: elapsed at once, and the detail says so.
|
|
303
|
+
*/
|
|
301
304
|
function periodVerdict({ cutAt, trackingCreatedAt, testPeriodDays, now }) {
|
|
302
305
|
const cut = Date.parse(cutAt);
|
|
303
306
|
const created = trackingCreatedAt ? Date.parse(trackingCreatedAt) : NaN;
|
|
@@ -310,8 +313,11 @@ function periodVerdict({ cutAt, trackingCreatedAt, testPeriodDays, now }) {
|
|
|
310
313
|
return {
|
|
311
314
|
start: new Date(startMs).toISOString(),
|
|
312
315
|
endsAt: new Date(endMs).toISOString(),
|
|
316
|
+
days: testPeriodDays,
|
|
313
317
|
elapsed,
|
|
314
|
-
detail:
|
|
318
|
+
detail: testPeriodDays === 0
|
|
319
|
+
? 'no test period (release.test-period: 0d, a human final — the human\'s finalize is the test, #549)'
|
|
320
|
+
: elapsed
|
|
315
321
|
? `${testPeriodDays}d test period from ${new Date(startMs).toISOString()} ended ${new Date(endMs).toISOString()}`
|
|
316
322
|
: `${testPeriodDays}d test period from ${new Date(startMs).toISOString()} ends ${new Date(endMs).toISOString()} (${hours}h left)`,
|
|
317
323
|
};
|
|
@@ -590,7 +596,7 @@ function tagMessage(verdict, { candidate, period, actor }) {
|
|
|
590
596
|
'',
|
|
591
597
|
`Candidate: ${candidate.tag}`,
|
|
592
598
|
`Commit: ${candidate.sha}`,
|
|
593
|
-
period ? `Test period: ${period.start} -> ${period.endsAt}` : null,
|
|
599
|
+
period ? (period.days === 0 ? 'Test period: none (release.test-period: 0d — the human final is the test)' : `Test period: ${period.start} -> ${period.endsAt}`) : null,
|
|
594
600
|
`Finalized by: ${actor}`,
|
|
595
601
|
verdict.grant ? `Automatic final granted by: release.final-grant -> decision #${verdict.grant.issue}${verdict.grant.ruledBy ? `, ruled by ${verdict.grant.ruledBy}` : ''} (an operator's per-repo grant; deleting it, or final: human, revokes it)` : null,
|
|
596
602
|
'',
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* route: public-tool # none | rapid-app | public-tool | library-fast | deploy-tag | deploy-tag-fast | live
|
|
12
12
|
* candidates: auto # auto | off
|
|
13
13
|
* candidates-per-day: 1 # positive integer — an opt-in cap; no route has one by default (#443)
|
|
14
|
-
* test-period: 3d # <N>d, never below the route's 3 days
|
|
14
|
+
* test-period: 3d # <N>d, never below the route's 3 days — or 0d where the final is human (#549)
|
|
15
15
|
* final: auto # auto | human
|
|
16
16
|
* guard-run: <command> # #422 — a breaking-change detector `release cut --auto` runs
|
|
17
17
|
* guard-result: <path> # #422 — or the file an earlier CI step wrote its result to
|
|
@@ -95,6 +95,8 @@ const FINAL = Object.freeze(['auto', 'human']);
|
|
|
95
95
|
// The routes' own test period (CONVENTIONS.md §6: "The test period is 3 days"). A floor, not a
|
|
96
96
|
// suggestion: a declared period may be longer, never shorter.
|
|
97
97
|
const TEST_PERIOD_DAYS = 3;
|
|
98
|
+
// #549: the one value below the floor — no test period at all, and only where the final is human.
|
|
99
|
+
const TEST_PERIOD_ZERO = '0d';
|
|
98
100
|
|
|
99
101
|
/**
|
|
100
102
|
* Each route's own policy — CONVENTIONS.md §6, *Release routes*, row for row.
|
|
@@ -369,8 +371,14 @@ function evaluateRelease(cfg) {
|
|
|
369
371
|
const days = parseTestPeriod(v);
|
|
370
372
|
if (days === null) fail(`release.test-period is ${JSON.stringify(v)}, expected a whole number of days like "${TEST_PERIOD_DAYS}d"`);
|
|
371
373
|
else if (effective.testPeriodDays === null) fail(`release.test-period: ${v} has no period to set — ${route} cuts no candidate, so there is no test period. Remove the key`);
|
|
372
|
-
else if (days
|
|
373
|
-
|
|
374
|
+
else if (days === 0 && effective.final === 'human') {
|
|
375
|
+
// #549: a human final may declare no test period — the human's finalize is the test.
|
|
376
|
+
effective.testPeriodDays = 0;
|
|
377
|
+
} else if (days === 0) {
|
|
378
|
+
widen('test-period', v, `the final is automatic here, so the test period is the only look a candidate gets before it becomes a release — no human looked. ${TEST_PERIOD_ZERO} fits only a human final (final: human). Set ${effective.testPeriodDays}d or longer`);
|
|
379
|
+
} else if (days < effective.testPeriodDays) {
|
|
380
|
+
widen('test-period', v, `the test period is ${effective.testPeriodDays}d, and a shorter one finalizes a candidate before the route's own window has passed. Set ${effective.testPeriodDays}d or longer` +
|
|
381
|
+
(effective.final === 'human' ? ` — or ${TEST_PERIOD_ZERO} for no test period, since the final here is a human act` : ''));
|
|
374
382
|
} else effective.testPeriodDays = days;
|
|
375
383
|
}
|
|
376
384
|
|