@futurelastic/colab-handbook 1.12.0-rc.41 → 1.12.0-rc.42
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 +14 -2
- package/tools/lib/util.js +17 -1
package/package.json
CHANGED
package/tools/colab
CHANGED
|
@@ -9738,7 +9738,9 @@ Options:
|
|
|
9738
9738
|
warning). --dry prints "Machine trailer: …" saying which way it will go.
|
|
9739
9739
|
--refs <N[,M]> reference these claimed issues (Refs #N) instead of closing them — for a
|
|
9740
9740
|
long-lived memory/tracking issue the branch touched but did not complete.
|
|
9741
|
-
Comma-separated
|
|
9741
|
+
Comma-separated, and repeatable: --refs A --refs B is --refs A,B (#479 —
|
|
9742
|
+
every other value flag to ship refuses a repeat). Each must be a claimed
|
|
9743
|
+
issue on the branch. An issue carrying
|
|
9742
9744
|
the "tracking" label is treated this way automatically, no flag needed. The
|
|
9743
9745
|
claim is still released either way — only Closes→Refs changes.
|
|
9744
9746
|
#385: a --refs'd issue whose body still has an unticked "- [ ]" box (under
|
|
@@ -11513,6 +11515,8 @@ function cmdShipDirect(opts) {
|
|
|
11513
11515
|
print(preOk ? '→ READY: preconditions pass. Re-run without --dry to close.' : '→ NOT READY: fix the ✗ rows above.');
|
|
11514
11516
|
print(' Plan: no merge, no commit, no push · post evidence comment + CLOSE each issue · release the claims (and the checkout hold)');
|
|
11515
11517
|
print(' Gate: every closing issue must already carry an evidence comment — checked at run time.');
|
|
11518
|
+
// #479: show BOTH halves of the split, so a wrong one is visible before the push.
|
|
11519
|
+
if (closeIssues.length) print(` Closes (closed by this ship): ${closeIssues.map((n) => '#' + n).join(' ')}`);
|
|
11516
11520
|
if (refsIssues.length) print(` Refs (kept open, NOT closed): ${refsIssues.map((n) => '#' + n).join(' ')}`);
|
|
11517
11521
|
return preOk ? 0 : 1;
|
|
11518
11522
|
}
|
|
@@ -11736,7 +11740,13 @@ function shipRefFor(repoAbs, branch) {
|
|
|
11736
11740
|
|
|
11737
11741
|
function cmdShip(argv) {
|
|
11738
11742
|
const opts = parseArgs(argv, {
|
|
11739
|
-
values: { '--repo': 'repo', '--worktree': 'worktree', '--branch': 'branch', '--message': 'message', '--
|
|
11743
|
+
values: { '--repo': 'repo', '--worktree': 'worktree', '--branch': 'branch', '--message': 'message', '--session': 'session', '--session-name': 'sessionName', '--batch': 'batch' },
|
|
11744
|
+
// #479: a repeated --refs used to keep only its LAST value, and every dropped issue then became a
|
|
11745
|
+
// `Closes` line on trunk — an issue meant to stay open, auto-closed by the push. --refs now
|
|
11746
|
+
// accumulates (a repeat is the same as one comma list); every OTHER value flag to ship refuses a
|
|
11747
|
+
// repeat (`once`), checked here before any git or GitHub call.
|
|
11748
|
+
lists: { '--refs': 'refs' },
|
|
11749
|
+
once: true,
|
|
11740
11750
|
flags: { '--keep-worktree': 'keepWorktree', '--delete-branch': 'deleteBranch', '--keep-branch': 'keepBranch', '--dry': 'dry', '--json': 'json', '--direct': 'direct', '--adopt': 'adopt', '-h': 'help', '--help': 'help' },
|
|
11741
11751
|
});
|
|
11742
11752
|
if (opts.help) return print(HELP_SHIP);
|
|
@@ -12180,6 +12190,8 @@ function cmdShip(argv) {
|
|
|
12180
12190
|
print(` ✗ "${c.keyword} #${c.num}" would close #${c.num} on merge — kept open by --refs; reword the commit before shipping.`);
|
|
12181
12191
|
}
|
|
12182
12192
|
}
|
|
12193
|
+
// #479: show BOTH halves of the split, so a wrong one is visible before the push.
|
|
12194
|
+
if (closeIssues.length) print(` Closes (closed by this ship): ${closeIssues.map((n) => '#' + n).join(' ')}`);
|
|
12183
12195
|
if (refsIssues.length) print(` Refs (kept open, NOT closed): ${refsIssues.map((n) => '#' + n).join(' ')}`);
|
|
12184
12196
|
return dryOk ? 0 : 1;
|
|
12185
12197
|
}
|
package/tools/lib/util.js
CHANGED
|
@@ -51,12 +51,19 @@ function humanAge(iso) {
|
|
|
51
51
|
* spec.flags : { '--json': 'json', '--force': 'force' } boolean flags
|
|
52
52
|
* spec.values : { '--repo': 'repo', '--count': 'count' } flags that take a value
|
|
53
53
|
* spec.aliases : { '--issue': '--issues' } map an alias to its canonical flag
|
|
54
|
+
* spec.lists : { '--refs': 'refs' } value flags that ACCUMULATE: a repeat is
|
|
55
|
+
* joined onto the earlier value(s) with ',' — the same as one comma list (#479)
|
|
56
|
+
* spec.once : true a repeated `values` flag is a usage error
|
|
57
|
+
* instead of last-one-wins (#479). Off by default: most commands keep the old
|
|
58
|
+
* overwrite, where a dropped value is harmless; turn it on where it is not.
|
|
54
59
|
* Positionals collected into result._ .
|
|
55
60
|
*/
|
|
56
61
|
function parseArgs(argv, spec = {}) {
|
|
57
62
|
const flags = spec.flags || {};
|
|
58
63
|
const values = spec.values || {};
|
|
59
64
|
const aliases = spec.aliases || {};
|
|
65
|
+
const lists = spec.lists || {};
|
|
66
|
+
const seen = new Set();
|
|
60
67
|
const out = { _: [] };
|
|
61
68
|
for (let i = 0; i < argv.length; i++) {
|
|
62
69
|
let a = argv[i];
|
|
@@ -66,9 +73,18 @@ function parseArgs(argv, spec = {}) {
|
|
|
66
73
|
const eq = a.indexOf('=');
|
|
67
74
|
if (a.startsWith('--') && eq !== -1) { inlineVal = a.slice(eq + 1); a = a.slice(0, eq); }
|
|
68
75
|
if (flags[a]) { out[flags[a]] = true; }
|
|
69
|
-
else if (
|
|
76
|
+
else if (lists[a]) {
|
|
70
77
|
const v = inlineVal !== null ? inlineVal : argv[++i];
|
|
71
78
|
if (v === undefined) throw new UserError(`Option ${a} needs a value`);
|
|
79
|
+
const k = lists[a];
|
|
80
|
+
out[k] = out[k] === undefined ? v : `${out[k]},${v}`;
|
|
81
|
+
} else if (values[a]) {
|
|
82
|
+
const v = inlineVal !== null ? inlineVal : argv[++i];
|
|
83
|
+
if (v === undefined) throw new UserError(`Option ${a} needs a value`);
|
|
84
|
+
if (spec.once && seen.has(values[a])) {
|
|
85
|
+
throw new UserError(`Option ${a} given more than once — only one value is accepted; pass it once`);
|
|
86
|
+
}
|
|
87
|
+
seen.add(values[a]);
|
|
72
88
|
out[values[a]] = v;
|
|
73
89
|
} else if (a.startsWith('-') && a !== '-') {
|
|
74
90
|
throw new UserError(`Unknown option: ${a}`);
|