@futurelastic/colab-handbook 1.13.0-rc.39 → 1.13.0-rc.40
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
CHANGED
package/tools/colab
CHANGED
|
@@ -2001,7 +2001,7 @@ function cmdReleaseFinalize(argv) {
|
|
|
2001
2001
|
const issues = readAllIssuesForSwitches(repoAbs);
|
|
2002
2002
|
const labelNames = (i) => (i.labels || []).map((l) => (typeof l === 'string' ? l : l.name));
|
|
2003
2003
|
const records = (issues || [])
|
|
2004
|
-
.map((i) => ({ number: i.number, url: i.url || null, state: String(i.state || '').toUpperCase(), createdAt: i.createdAt || null, held: labelNames(i).includes(releaseFinalize.HOLD_LABEL), version: releaseFinalize.parseReleaseMarker(i.body) }))
|
|
2004
|
+
.map((i) => ({ number: i.number, url: i.url || null, title: i.title == null ? null : String(i.title), state: String(i.state || '').toUpperCase(), createdAt: i.createdAt || null, held: labelNames(i).includes(releaseFinalize.HOLD_LABEL), version: releaseFinalize.parseReleaseMarker(i.body) }))
|
|
2005
2005
|
.filter((r) => r.version);
|
|
2006
2006
|
const trackingFor = (version, { isCandidate }) => {
|
|
2007
2007
|
if (issues === null) return { error: 'the issue list could not be read (or may be truncated) — the tracking issue cannot be found' };
|
|
@@ -2009,7 +2009,7 @@ function cmdReleaseFinalize(argv) {
|
|
|
2009
2009
|
const open = mine.filter((r) => r.state === 'OPEN');
|
|
2010
2010
|
if (open.length > 1) return { error: `${open.length} open tracking issues for ${version} (${open.map((r) => `#${r.number}`).join(', ')}) — one per version; close the duplicate by hand` };
|
|
2011
2011
|
if (open.length === 1) return { ...open[0] };
|
|
2012
|
-
if (isCandidate && mine.length) return { error: `the tracking issue for ${version} (#${mine[0].number}) is closed but ${version} is not final — reopen it; a closed record is never silently replaced` };
|
|
2012
|
+
if (isCandidate && mine.length) return { error: `the tracking issue for ${version} (#${mine[0].number}${mine[0].title ? ` ${JSON.stringify(mine[0].title)}` : ''}) is closed but ${version} is not final — reopen it; a closed record is never silently replaced` };
|
|
2013
2013
|
return { number: null, createdAt: null, held: false, wouldCreate: !opts.dry };
|
|
2014
2014
|
};
|
|
2015
2015
|
const version0 = newest ? newest.version : (selection.version || null);
|
|
@@ -2021,7 +2021,7 @@ function cmdReleaseFinalize(argv) {
|
|
|
2021
2021
|
const body = releaseFinalize.trackingBody({ version: version0, row: policy.derived.row, final: policy.effective.final, testPeriodDays: policy.effective.testPeriodDays });
|
|
2022
2022
|
const c = tracker.forRepo(repoAbs).issueCreate({ title: releaseFinalize.trackingTitle(version0), body });
|
|
2023
2023
|
if (!c.number) trackings.set(version0, { error: `could not open the tracking issue for ${version0} (${String(c.stderr || '').split('\n')[0] || 'no issue URL returned'})` });
|
|
2024
|
-
else { trackings.set(version0, { number: c.number, url: c.url, createdAt: now, held: false }); trackingCreated = true; }
|
|
2024
|
+
else { trackings.set(version0, { number: c.number, url: c.url, title: releaseFinalize.trackingTitle(version0), createdAt: now, held: false }); trackingCreated = true; }
|
|
2025
2025
|
}
|
|
2026
2026
|
|
|
2027
2027
|
// #441: an operator-granted automatic final — the decision it names is resolved once per run, from
|
|
@@ -2202,7 +2202,7 @@ function cmdReleaseFinalize(argv) {
|
|
|
2202
2202
|
|
|
2203
2203
|
const supersededHeld = records.filter((r) => r.state === 'OPEN' && r.held && r.version !== (cand ? cand.version : version0) && !finals.has(r.version)).map((r) => r.number);
|
|
2204
2204
|
const trackingOut = tracking && !tracking.error
|
|
2205
|
-
? { number: tracking.number || null, url: tracking.url || null, created: trackingCreated && (!cand || cand.version === version0), held: !!tracking.held, supersededHeld }
|
|
2205
|
+
? { number: tracking.number || null, url: tracking.url || null, title: tracking.title || null, created: trackingCreated && (!cand || cand.version === version0), held: !!tracking.held, supersededHeld }
|
|
2206
2206
|
: null;
|
|
2207
2207
|
// #468: why this run made no final, and which candidate finals first — the line the release
|
|
2208
2208
|
// workflow prints, so "no final" never has to be reconstructed from a checklist.
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
* (CONVENTIONS.md §6, *The release rung*), as encode/decode pairs. Pure and synchronous.
|
|
5
5
|
*
|
|
6
6
|
* tracking marker — `<!-- colab:release version=vX.Y.Z -->`, the first line of a tracking
|
|
7
|
-
* issue's body. Only the marker identifies the version, never the title
|
|
7
|
+
* issue's body. Only the marker identifies the version, never the title —
|
|
8
|
+
* and only at the START of the body (leading whitespace tolerated): a body
|
|
9
|
+
* that merely MENTIONS the marker further down is talking about releases,
|
|
10
|
+
* not recording one, and is never adopted as the record (#575).
|
|
8
11
|
* event marker — `<!-- colab:release-event k=v … -->`, one per thing announced on the
|
|
9
12
|
* tracking issue, keys in the order written. Its exact presence is what makes
|
|
10
13
|
* a re-run post nothing twice, so key order is part of the wire format.
|
|
@@ -16,7 +19,7 @@
|
|
|
16
19
|
*/
|
|
17
20
|
|
|
18
21
|
const VERSION_RE = /^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/;
|
|
19
|
-
const TRACKING_MARKER_RE =
|
|
22
|
+
const TRACKING_MARKER_RE = /^\s*<!--\s*colab:release\s+version=(v[0-9]+\.[0-9]+\.[0-9]+)\s*-->/;
|
|
20
23
|
const RELEASE_EVENT_RE = /^<!-- colab:release-event((?: [^\s=]+=\S*)+) -->$/;
|
|
21
24
|
const RELEASED_COMMENT_RE = /^<!-- colab:release-event released=(\S+) -->\nReleased in \*\*(\S+)\*\* \(`([^`]*)`\)\.$/;
|
|
22
25
|
|
|
@@ -24,7 +27,7 @@ const RELEASED_COMMENT_RE = /^<!-- colab:release-event released=(\S+) -->\nRelea
|
|
|
24
27
|
function encodeTrackingMarker(version) { return `<!-- colab:release version=${version} -->`; }
|
|
25
28
|
|
|
26
29
|
/** The version a body's tracking marker declares, or null — a marker naming a non-canonical
|
|
27
|
-
* version (a leading zero) declares nothing. */
|
|
30
|
+
* version (a leading zero) declares nothing, and neither does one anywhere but the body's start. */
|
|
28
31
|
function decodeTrackingMarker(body) {
|
|
29
32
|
const m = TRACKING_MARKER_RE.exec(String(body || ''));
|
|
30
33
|
return m && VERSION_RE.test(m[1]) ? m[1] : null;
|
|
@@ -710,6 +710,18 @@
|
|
|
710
710
|
"decoded": "v0.1.6"
|
|
711
711
|
}
|
|
712
712
|
],
|
|
713
|
+
"notTracking": [
|
|
714
|
+
{
|
|
715
|
+
"wire": "Finalize keeps one tracking issue per version; its body starts <!-- colab:release version=v0.1.6 --> and nothing else counts.",
|
|
716
|
+
"decoded": null,
|
|
717
|
+
"note": "synthetic (#575): an issue ABOUT releases that mentions the marker mid-body — never adopted as the record"
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
"wire": "fix: release lookup\n\n```\n<!-- colab:release version=v0.1.6 -->\n```",
|
|
721
|
+
"decoded": null,
|
|
722
|
+
"note": "synthetic (#575): the marker quoted on a later line, not the body's first"
|
|
723
|
+
}
|
|
724
|
+
],
|
|
713
725
|
"events": [
|
|
714
726
|
{
|
|
715
727
|
"wire": "<!-- colab:release-event candidate=v0.1.6-rc.1 -->",
|
|
@@ -534,7 +534,8 @@ function handoffCommand(tag) {
|
|
|
534
534
|
* `facts`:
|
|
535
535
|
* policy release-policy.js evaluateRelease(doc)
|
|
536
536
|
* selection selectCandidate(...)
|
|
537
|
-
* tracking { number|null, createdAt|null, held, wouldCreate } | { error }
|
|
537
|
+
* tracking { number|null, title|null, createdAt|null, held, wouldCreate } | { error } — `title` is the
|
|
538
|
+
* matched issue's own, shown so a record that is not `release: vX.Y.Z` is visible (#575)
|
|
538
539
|
* supersededHeld [issue numbers]
|
|
539
540
|
* period periodVerdict(...) (when there is a candidate)
|
|
540
541
|
* trunk trunkGreenVerdict(...)
|
|
@@ -586,7 +587,7 @@ function decide(facts) {
|
|
|
586
587
|
|
|
587
588
|
const t = f.tracking || {};
|
|
588
589
|
if (t.error) { add('tracking-issue', false, t.error); return out('refused'); }
|
|
589
|
-
add('tracking-issue', true, t.number ? `#${t.number} (${trackingTitle(cand.version)})` : `none yet — ${t.wouldCreate ? 'this run opens' : 'a non-dry run opens'} "${trackingTitle(cand.version)}"`);
|
|
590
|
+
add('tracking-issue', true, t.number ? `#${t.number} (${t.title ? JSON.stringify(t.title) : trackingTitle(cand.version)})` : `none yet — ${t.wouldCreate ? 'this run opens' : 'a non-dry run opens'} "${trackingTitle(cand.version)}"`);
|
|
590
591
|
|
|
591
592
|
const held = [...(t.held && t.number ? [t.number] : []), ...(f.supersededHeld || [])];
|
|
592
593
|
add('release-hold', !held.length, held.length
|