@futurelastic/colab-handbook 1.18.0-rc.7 → 1.18.0-rc.8
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 +24 -3
- package/tools/lib/migration-paths.js +44 -14
- package/tools/lib/release-cut.js +58 -8
- package/tools/lib/release-finalize.js +5 -2
package/package.json
CHANGED
package/tools/colab
CHANGED
|
@@ -1414,7 +1414,12 @@ function readAllIssuesForSwitches(repoAbs) {
|
|
|
1414
1414
|
return Array.isArray(list) && list.length < LIMIT ? list : null;
|
|
1415
1415
|
}
|
|
1416
1416
|
|
|
1417
|
-
/**
|
|
1417
|
+
/**
|
|
1418
|
+
* [{status, path, content, added?}] for every path changed between `from` (null = the empty tree) and
|
|
1419
|
+
* `sha`; null on a git failure. #673: a declared schema FILE (migration-paths.js isDeclaredFile) also
|
|
1420
|
+
* carries `added` — the lines the change added, with their line numbers — which is what schema-additive
|
|
1421
|
+
* reads for it. A failed read leaves `added` null, which that check refuses (an unread change).
|
|
1422
|
+
*/
|
|
1418
1423
|
function releaseCutChanges(repoAbs, from, sha, declared) {
|
|
1419
1424
|
let base = from;
|
|
1420
1425
|
if (!base) {
|
|
@@ -1433,6 +1438,11 @@ function releaseCutChanges(repoAbs, from, sha, declared) {
|
|
|
1433
1438
|
const show = git.git(['show', `${sha}:${file}`], repoAbs);
|
|
1434
1439
|
content = show.ok ? show.stdout : '';
|
|
1435
1440
|
}
|
|
1441
|
+
if (!status.startsWith('D') && migrationPaths.isDeclaredFile(file, declared)) {
|
|
1442
|
+
// -U0: only the added lines and their hunk headers; --no-renames keeps one path per side.
|
|
1443
|
+
const d = git.git(['diff', '-U0', '--no-renames', '--no-color', base, sha, '--', file], repoAbs);
|
|
1444
|
+
return { status, path: file, content, added: d.ok ? releaseCut.addedLinesFromDiff(d.stdout) : null };
|
|
1445
|
+
}
|
|
1436
1446
|
return { status, path: file, content };
|
|
1437
1447
|
});
|
|
1438
1448
|
}
|
|
@@ -1801,7 +1811,7 @@ function cmdReleaseCut(argv) {
|
|
|
1801
1811
|
let created = false;
|
|
1802
1812
|
let published = null; // #443: { ok, detail } once a tag was created — null when nothing was cut
|
|
1803
1813
|
if (verdict.ok && !opts.dry) {
|
|
1804
|
-
const message = releaseCut.tagMessage(verdict, { sha, lastFinal });
|
|
1814
|
+
const message = releaseCut.tagMessage(verdict, { sha, lastFinal, checkedBy: checkedByLine() });
|
|
1805
1815
|
const t = git.git(['tag', '-a', '--cleanup=verbatim', verdict.tag, sha, '-m', message], repoAbs);
|
|
1806
1816
|
if (!t.ok) throw new UserError(`git tag ${verdict.tag} failed: ${(t.stderr || '').split('\n')[0]}`);
|
|
1807
1817
|
const push = git.git(['push', remote, `refs/tags/${verdict.tag}`], repoAbs);
|
|
@@ -2312,7 +2322,7 @@ function cmdReleaseFinalize(argv) {
|
|
|
2312
2322
|
if (!opts.dry) {
|
|
2313
2323
|
if (verdict.state === 'finalized') {
|
|
2314
2324
|
const actor = humanBar && !verdict.grant ? `${opts.answeredBy} (human bar: COLAB_HUMAN=1${verdict.early ? ', --early' : ''})` : `automatic — clean test period (CONVENTIONS.md §6)${verdict.grant ? `, by the operator's grant (decision #${verdict.grant.issue})` : ''}${walk ? ', newest candidate clean on its own clock (--auto)' : ''}${selection.older ? `, an older candidate clean on its own clock (--tag; newest open: ${selection.newest})` : ''}`;
|
|
2315
|
-
const message = releaseFinalize.tagMessage(verdict, { candidate: cand, period, actor });
|
|
2325
|
+
const message = releaseFinalize.tagMessage(verdict, { candidate: cand, period, actor, checkedBy: checkedByLine() });
|
|
2316
2326
|
const t = git.git(['tag', '-a', '--cleanup=verbatim', cand.version, cand.sha, '-m', message], repoAbs);
|
|
2317
2327
|
if (!t.ok) throw new UserError(`git tag ${cand.version} failed: ${(t.stderr || '').split('\n')[0]}`);
|
|
2318
2328
|
const push = git.git(['push', remote, `refs/tags/${cand.version}`], repoAbs);
|
|
@@ -9674,6 +9684,17 @@ function versionLine(self) {
|
|
|
9674
9684
|
return `colab ${self.version} (${where})`;
|
|
9675
9685
|
}
|
|
9676
9686
|
|
|
9687
|
+
/**
|
|
9688
|
+
* #673: the colab that decided, for a release tag's message — the version plus, for a working tree, the
|
|
9689
|
+
* commit it runs at (its "version" is only the nearest release tag, so two dev checkouts would read
|
|
9690
|
+
* alike). No filesystem path: a tag message is published with the repo it lands in.
|
|
9691
|
+
*/
|
|
9692
|
+
function checkedByLine(self = selfProvenance()) {
|
|
9693
|
+
if (self.kind !== 'working-tree') return `colab ${self.version} (${self.kind === 'npm' ? 'npm package' : 'frozen copy'})`;
|
|
9694
|
+
const head = stamp.gitIn(self.source, ['rev-parse', '--short=12', 'HEAD']);
|
|
9695
|
+
return `colab ${self.version} (working tree${head.ok && head.out ? ` @ ${head.out}` : ''}${self.branch ? `, branch ${self.branch}` : ''})`;
|
|
9696
|
+
}
|
|
9697
|
+
|
|
9677
9698
|
function cmdVersion() {
|
|
9678
9699
|
return print(versionLine(selfProvenance()));
|
|
9679
9700
|
}
|
|
@@ -9,9 +9,16 @@
|
|
|
9
9
|
* `migrations/` — was invisible to both: `colab ship --dry` reported `no new migrations ✓` on a
|
|
10
10
|
* branch adding a production data backfill, so the human-only grant (#98) never engaged.
|
|
11
11
|
*
|
|
12
|
-
* `migrations:` in `.github/project.yml` names the extra places, as repo-relative
|
|
12
|
+
* `migrations:` in `.github/project.yml` names the extra places, as repo-relative paths:
|
|
13
13
|
*
|
|
14
|
-
* migrations: [backend/migrations/]
|
|
14
|
+
* migrations: [backend/migrations/, server/db.ts]
|
|
15
|
+
*
|
|
16
|
+
* #673: an entry is a DIRECTORY when it ends in `/` (matched by prefix, as before), and otherwise a
|
|
17
|
+
* path that may be a FILE: that exact path, or anything under it. So `backend/migrations` still covers
|
|
18
|
+
* `backend/migrations/x.sql`, and `server/db.ts` covers a schema the server applies inline at start-up
|
|
19
|
+
* (`CREATE TABLE`/`ALTER TABLE` in its own code, no migrations directory) — before this, that layout
|
|
20
|
+
* could not be declared at all, and #671's fail-closed grant gate left such a repo no tooled release.
|
|
21
|
+
* A change to a declared file IS a migration; release-cut's schema-additive reads the lines it added.
|
|
15
22
|
*
|
|
16
23
|
* The declared list is ADDED to the two defaults, never a replacement for them: a declaration can
|
|
17
24
|
* only make the gate see more. There is deliberately no opt-out of the defaults — an opt-out can
|
|
@@ -30,23 +37,34 @@ const DEFAULT_MIGRATION_PATHS = Object.freeze(['database/migrations/', 'prisma/m
|
|
|
30
37
|
const FOREIGN_TREE_SEGMENTS = new Set(['node_modules', 'vendor']);
|
|
31
38
|
|
|
32
39
|
/**
|
|
33
|
-
* One declared entry → its normalised
|
|
34
|
-
*
|
|
35
|
-
*
|
|
40
|
+
* One declared entry → its normalised path, or `{ problem }`. `./` and doubled `/` are removed; a
|
|
41
|
+
* trailing `/` is KEPT when written (a directory) and never added (#673: without one, the entry may
|
|
42
|
+
* name a file). Rejected, not guessed: absolute paths and `..` (not repo-relative), globs (a path
|
|
43
|
+
* match would silently match nothing for `*`), and empties.
|
|
36
44
|
*/
|
|
37
45
|
function normalizeEntry(raw) {
|
|
38
46
|
if (typeof raw !== 'string') return { problem: `${JSON.stringify(raw)} is not a path` };
|
|
39
47
|
let p = raw.trim();
|
|
40
48
|
if (p === '') return { problem: 'an empty entry is not a path' };
|
|
41
49
|
if (p.startsWith('/')) return { problem: `"${p}" is absolute — declare a repo-relative prefix (e.g. "backend/migrations/")` };
|
|
42
|
-
if (/[*?[\]{}]/.test(p)) return { problem: `"${p}" is a glob — declare a plain directory prefix; entries are matched by
|
|
43
|
-
p = p.replace(/^(\.\/)+/, '').replace(/\/{2,}/g, '/');
|
|
44
|
-
if (p === '' || p === '.') return { problem: `"${raw}" names the repo root — every file would be a migration` };
|
|
50
|
+
if (/[*?[\]{}]/.test(p)) return { problem: `"${p}" is a glob — declare a plain directory prefix ("backend/migrations/") or a file ("server/db.ts"); entries are matched by path, not by pattern` };
|
|
51
|
+
p = p.replace(/^(\.\/)+/, '').replace(/\/{2,}/g, '/').replace(/(\/\.)+\/?$/, '/');
|
|
52
|
+
if (p === '' || p === '.' || p === '/' || p === './') return { problem: `"${raw}" names the repo root — every file would be a migration` };
|
|
45
53
|
if (p.split('/').includes('..')) return { problem: `"${p}" climbs out of the repo — declare a repo-relative prefix` };
|
|
46
|
-
if (!p.endsWith('/')) p += '/';
|
|
47
54
|
return { path: p };
|
|
48
55
|
}
|
|
49
56
|
|
|
57
|
+
/** The directory form of an entry (`a/b` → `a/b/`) — what duplicates and defaults compare by. */
|
|
58
|
+
function dirForm(p) {
|
|
59
|
+
return p.endsWith('/') ? p : `${p}/`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Does declared entry `p` cover repo-relative `f`? A directory by prefix; a no-slash entry exactly or below it. */
|
|
63
|
+
function entryCovers(p, f) {
|
|
64
|
+
if (p.endsWith('/')) return f.startsWith(p);
|
|
65
|
+
return f === p || f.startsWith(`${p}/`);
|
|
66
|
+
}
|
|
67
|
+
|
|
50
68
|
/**
|
|
51
69
|
* `migrations:` from a parsed project.yml → `{ declared, paths, problems, notes, reason }`.
|
|
52
70
|
* `problems` are invalid shapes/entries (the audit fails them); `notes` are harmless redundancy — an
|
|
@@ -58,7 +76,8 @@ function normalizeEntry(raw) {
|
|
|
58
76
|
* lenient in the direction that makes the gate STRICTER (it still sees
|
|
59
77
|
* the path the author obviously meant); the audit fails the shape.
|
|
60
78
|
*
|
|
61
|
-
* `paths` never includes the defaults — `isMigrationPath` always applies those itself.
|
|
79
|
+
* `paths` never includes the defaults — `isMigrationPath` always applies those itself. An entry
|
|
80
|
+
* keeps its trailing `/` as written (#673): `a/b/` is a directory, `a/b` a file or a directory.
|
|
62
81
|
*/
|
|
63
82
|
function parseMigrationPaths(doc) {
|
|
64
83
|
const has = !!doc && Object.prototype.hasOwnProperty.call(doc, 'migrations');
|
|
@@ -83,11 +102,11 @@ function parseMigrationPaths(doc) {
|
|
|
83
102
|
for (const raw of entries) {
|
|
84
103
|
const r = normalizeEntry(raw);
|
|
85
104
|
if (r.problem) { problems.push(`migrations: ${r.problem}`); continue; }
|
|
86
|
-
if (DEFAULT_MIGRATION_PATHS.includes(r.path)) {
|
|
105
|
+
if (DEFAULT_MIGRATION_PATHS.includes(dirForm(r.path))) {
|
|
87
106
|
notes.push(`migrations: "${r.path}" is already a default — it need not be declared`);
|
|
88
107
|
continue;
|
|
89
108
|
}
|
|
90
|
-
if (paths.
|
|
109
|
+
if (paths.some((q) => dirForm(q) === dirForm(r.path))) { notes.push(`migrations: "${r.path}" is declared twice`); continue; }
|
|
91
110
|
paths.push(r.path);
|
|
92
111
|
}
|
|
93
112
|
return { declared: true, paths, problems, notes, reason: paths.length ? `migrations: [${paths.join(', ')}] + defaults` : 'defaults only' };
|
|
@@ -106,10 +125,21 @@ function isMigrationPath(file, declared) {
|
|
|
106
125
|
for (const d of DEFAULT_MIGRATION_PATHS) {
|
|
107
126
|
if (f.startsWith(d) || f.includes(`/${d}`)) return true;
|
|
108
127
|
}
|
|
109
|
-
for (const p of declared || []) if (
|
|
128
|
+
for (const p of declared || []) if (entryCovers(p, f)) return true;
|
|
110
129
|
return false;
|
|
111
130
|
}
|
|
112
131
|
|
|
132
|
+
/**
|
|
133
|
+
* #673: is `file` exactly a declared no-slash entry — a schema FILE, edited in place by nature (one
|
|
134
|
+
* `db.ts` that runs its `CREATE`/`ALTER` at start-up)? Such a file is not a migration *history*: an
|
|
135
|
+
* edit is how it grows, never "an existing migration was rewritten", so schema-additive reads the
|
|
136
|
+
* lines the edit ADDED instead. A file under a declared directory is not one (that is a history).
|
|
137
|
+
*/
|
|
138
|
+
function isDeclaredFile(file, declared) {
|
|
139
|
+
const f = String(file || '');
|
|
140
|
+
return (declared || []).some((p) => !p.endsWith('/') && f === p);
|
|
141
|
+
}
|
|
142
|
+
|
|
113
143
|
/**
|
|
114
144
|
* Directories named `migrations` in a tracked-file list that NO rule covers — the likely
|
|
115
145
|
* undeclared layout the audit reports. `files` is `git ls-files` output (repo-relative). Returns the
|
|
@@ -131,5 +161,5 @@ function undeclaredMigrationDirs(files, declared) {
|
|
|
131
161
|
}
|
|
132
162
|
|
|
133
163
|
module.exports = {
|
|
134
|
-
DEFAULT_MIGRATION_PATHS, parseMigrationPaths, unionPaths, isMigrationPath, undeclaredMigrationDirs,
|
|
164
|
+
DEFAULT_MIGRATION_PATHS, parseMigrationPaths, unionPaths, isMigrationPath, isDeclaredFile, undeclaredMigrationDirs,
|
|
135
165
|
};
|
package/tools/lib/release-cut.js
CHANGED
|
@@ -870,21 +870,25 @@ function laravelUpBody(text) {
|
|
|
870
870
|
*/
|
|
871
871
|
function schemaVerdict(changes, since, declared, layout) {
|
|
872
872
|
const inPaths = (changes || []).filter((c) => isMigrationPath(c.path, declared));
|
|
873
|
-
|
|
873
|
+
// #673: a declared schema FILE (an inline schema the server applies itself) is read by the lines
|
|
874
|
+
// its change added — never "unread", and an edit is never "an existing migration was rewritten".
|
|
875
|
+
const schemaFiles = inPaths.filter((c) => migrationPaths.isDeclaredFile(c.path, declared));
|
|
876
|
+
const history = inPaths.filter((c) => !migrationPaths.isDeclaredFile(c.path, declared));
|
|
877
|
+
const migrations = history.filter((c) => /\.(php|sql)$/.test(c.path));
|
|
874
878
|
// #383: a declared path widens what COUNTS as a migration, not what this heuristic can READ. A
|
|
875
879
|
// declared migration in any other format (a Node boot migration, a Go file) is named in the
|
|
876
880
|
// detail, so the §6 judgement the release notes owe knows exactly which files it still has to
|
|
877
881
|
// read by hand — never silently folded into "none destructive". Only for DECLARED paths: under
|
|
878
882
|
// the defaults a non-php/sql file is Prisma's migration_lock.toml and the like, as it always was.
|
|
879
883
|
const unread = (declared && declared.length)
|
|
880
|
-
?
|
|
884
|
+
? history.filter((c) => !/\.(php|sql)$/.test(c.path) && !migrationPaths.isMigrationPath(c.path, []))
|
|
881
885
|
: [];
|
|
882
|
-
const scope = `Laravel database/migrations + Prisma prisma/migrations${declared && declared.length ? ` + declared ${declared.join(', ')} (php/sql only)` : ''} — other layouts are not read`;
|
|
886
|
+
const scope = `Laravel database/migrations + Prisma prisma/migrations${declared && declared.length ? ` + declared ${declared.join(', ')} (php/sql only; a declared file: the SQL it added)` : ''} — other layouts are not read`;
|
|
883
887
|
const hasDeclared = !!(declared && declared.length);
|
|
884
888
|
const notChecked = (why) => ({ ok: true, checked: false, detail: `not checked — ${why}` });
|
|
885
889
|
const unreadWhy = () => `${unread.length} declared migration file(s) changed since ${since} in a format this check does not read (php/sql only) — a human reads them before the final: ${unread.map((c) => c.path).join(', ')}`;
|
|
886
890
|
const howToDeclare = 'a repo whose migrations live elsewhere declares their directory as `migrations:` in .github/project.yml (project.schema.md `migrations`); a repo with no database has nothing to declare';
|
|
887
|
-
if (!migrations.length) {
|
|
891
|
+
if (!migrations.length && !schemaFiles.length) {
|
|
888
892
|
if (unread.length) return notChecked(unreadWhy());
|
|
889
893
|
if (!hasDeclared && layout === false) return notChecked(`no Laravel database/migrations/ or Prisma prisma/migrations/ directory at the candidate and no \`migrations:\` declared, so no migration was read — ${howToDeclare}`);
|
|
890
894
|
if (!hasDeclared && layout === null) return notChecked(`the tree at the candidate could not be read for a migration layout, so no migration was read — ${howToDeclare}`);
|
|
@@ -904,11 +908,55 @@ function schemaVerdict(changes, since, declared, layout) {
|
|
|
904
908
|
if (m) findings.push(`${c.path}:${m.line}: \`${m.statement}\`${m.inUp ? ' in the Up section' : ''}`);
|
|
905
909
|
}
|
|
906
910
|
}
|
|
911
|
+
for (const c of schemaFiles) {
|
|
912
|
+
const f = schemaFileFinding(c);
|
|
913
|
+
if (f) findings.push(f);
|
|
914
|
+
}
|
|
907
915
|
if (findings.length) {
|
|
908
916
|
return { ok: false, detail: `destructive schema change since ${since} — a release carrying one is a human's to cut (CONVENTIONS.md §6, Switched epics rule 5): ${findings.join('; ')}` };
|
|
909
917
|
}
|
|
910
|
-
|
|
911
|
-
|
|
918
|
+
const read = [
|
|
919
|
+
...(migrations.length ? [`${migrations.length} migration file(s) added`] : []),
|
|
920
|
+
...(schemaFiles.length ? [`declared schema file(s) changed (${schemaFiles.map((c) => c.path).join(', ')}), the SQL they added read`] : []),
|
|
921
|
+
].join(' and ');
|
|
922
|
+
if (unread.length) return notChecked(`${read} since ${since}, none destructive — but ${unreadWhy()}`);
|
|
923
|
+
return { ok: true, detail: `${read} since ${since}, none destructive (${scope})` };
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
/**
|
|
927
|
+
* #673: one declared schema file's change → a destructive finding, or null. Reads ONLY what the change
|
|
928
|
+
* added (`c.added` = [{ line, text }], new-side line numbers; for an added file, its whole content):
|
|
929
|
+
* a `CREATE TABLE` the file has always held is not this release's, a `DROP COLUMN` it just gained is.
|
|
930
|
+
* Fails CLOSED — a deleted file, or added lines that could not be read, is a finding. Lines removed
|
|
931
|
+
* from the file are not read: a schema that stops creating a table drops nothing that exists.
|
|
932
|
+
*/
|
|
933
|
+
function schemaFileFinding(c) {
|
|
934
|
+
const st = String(c.status || '').charAt(0);
|
|
935
|
+
if (st === 'D') return `${c.path}: deleted — the declared schema file is gone`;
|
|
936
|
+
let lines = Array.isArray(c.added) ? c.added : null;
|
|
937
|
+
if (!lines && st === 'A' && typeof c.content === 'string') lines = c.content.split('\n').map((text, i) => ({ line: i + 1, text }));
|
|
938
|
+
if (!lines) return `${c.path}: the lines this change added could not be read — an unread schema change is not an additive one`;
|
|
939
|
+
const m = sqlDestructive(lines.map((l) => l.text).join('\n'));
|
|
940
|
+
if (!m) return null;
|
|
941
|
+
const at = lines[m.line - 1];
|
|
942
|
+
return `${c.path}:${at ? at.line : '?'}: \`${m.statement}\` added`;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* #673: `git diff -U0` output for ONE file → the lines it added, [{ line, text }] with new-side line
|
|
947
|
+
* numbers read from each hunk header. Pure, so the shape is tested without git.
|
|
948
|
+
*/
|
|
949
|
+
function addedLinesFromDiff(diffText) {
|
|
950
|
+
const out = [];
|
|
951
|
+
let next = null;
|
|
952
|
+
for (const l of String(diffText || '').split('\n')) {
|
|
953
|
+
const h = /^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(l);
|
|
954
|
+
if (h) { next = Number(h[1]); continue; }
|
|
955
|
+
if (next === null) continue; // the file header, before the first hunk
|
|
956
|
+
if (l.startsWith('+')) { out.push({ line: next, text: l.slice(1) }); next += 1; }
|
|
957
|
+
else if (l.startsWith(' ')) next += 1; // context (none at -U0, kept for safety)
|
|
958
|
+
}
|
|
959
|
+
return out;
|
|
912
960
|
}
|
|
913
961
|
|
|
914
962
|
// ---- §6 condition 4: switch dependencies -------------------------------------------------------
|
|
@@ -1243,7 +1291,7 @@ function versionSourceOf(policy) {
|
|
|
1243
1291
|
}
|
|
1244
1292
|
|
|
1245
1293
|
/** The annotated tag's message — where the chosen bump, its reason and every checked condition are recorded. */
|
|
1246
|
-
function tagMessage(verdict, { sha, lastFinal }) {
|
|
1294
|
+
function tagMessage(verdict, { sha, lastFinal, checkedBy }) {
|
|
1247
1295
|
// #446: a fast-route final. Its subject deliberately does NOT end in "(colab release cut)", so no
|
|
1248
1296
|
// reader of candidates (cutCandidates, finalize's CUT_SUBJECT_SUFFIX) ever mistakes it for one.
|
|
1249
1297
|
const fast = !!verdict.final;
|
|
@@ -1253,6 +1301,8 @@ function tagMessage(verdict, { sha, lastFinal }) {
|
|
|
1253
1301
|
'',
|
|
1254
1302
|
`Commit: ${sha}`,
|
|
1255
1303
|
`Since: ${lastFinal}`,
|
|
1304
|
+
// #673: which colab decided — two channels reading one commit differently is then visible here.
|
|
1305
|
+
...(checkedBy ? [`Checked by: ${checkedBy}`] : []),
|
|
1256
1306
|
`Bump: ${verdict.bump}${verdict.overridden ? ` (overridden from ${verdict.overridden.from || 'no bump'} — reason: ${verdict.overridden.reason})` : ''}${verdict.signals ? ' (computed by --auto)' : ''}`,
|
|
1257
1307
|
'',
|
|
1258
1308
|
...(verdict.signals ? ['Signals (every input the bump read):', ...verdict.signals.lines.map((l) => `- ${l}`), ''] : []),
|
|
@@ -1281,7 +1331,7 @@ module.exports = {
|
|
|
1281
1331
|
isFastRoute, isLibraryRoute, decideManifestVersion, spacingVerdict, holdsVerdict, migrationHandoff,
|
|
1282
1332
|
parseVersion, formatVersion, candidateNumbers, nextCandidateNumber, decideVersion,
|
|
1283
1333
|
parseGuardOutput, exportsDiff, switchRemovalsSince, autoSignals, parseMigrationSection, decideAutoVersion, cadenceVerdict, qualifiedShaVerdict,
|
|
1284
|
-
fullSuiteVerdict, withoutOwnWorkflow, withoutSkippedOnlyWorkflows, verifyingRunsForCut, verifyingNote, isMigrationPath, schemaVerdict,
|
|
1334
|
+
fullSuiteVerdict, withoutOwnWorkflow, withoutSkippedOnlyWorkflows, verifyingRunsForCut, verifyingNote, isMigrationPath, schemaVerdict, addedLinesFromDiff,
|
|
1285
1335
|
parseSwitchMarkers, switchVerdict,
|
|
1286
1336
|
promotionVerdict, decide, tagMessage, versionSourceOf,
|
|
1287
1337
|
DOWNSTREAM_EVENTS, headCandidateVerdict, prereleaseArgs, finalReleaseArgs, handoffTrackingBody,
|
|
@@ -572,7 +572,9 @@ function migrationGrantVerdict({ paths, grant, since, layout }) {
|
|
|
572
572
|
// #671: fail closed where nothing could have been seen — an automatically deployed final never
|
|
573
573
|
// reads "nothing read" as "nothing changed". The way out is named in the detail, never implied —
|
|
574
574
|
// route-neutral: release finalize prints its own human command, and route deploy-tag-fast has none.
|
|
575
|
-
|
|
575
|
+
// #673: a schema applied inline by the server's own code is declarable too — as the FILE — and the
|
|
576
|
+
// detail names the grant command that clears its next change, so no one reaches for a raw tag.
|
|
577
|
+
const wayOut = 'declare where the schema lives as `migrations:` in .github/project.yml (project.schema.md `migrations`) — a migration directory (`migrations: [backend/migrations/]`) or, for a schema the server applies inline, the file itself (`migrations: [server/db.ts]`); a change under it then clears the usual way (COLAB_HUMAN=1 colab migration-grant <tracking issue> --branch <version>). Until then the final is a human act, not the grant\'s — and a repo with no database has no layout to declare, so its final stays one';
|
|
576
578
|
if (layout === false) return { ok: false, detail: `no migration was read since ${since || 'the first commit'}: no \`migrations:\` declared and no Laravel database/migrations/ or Prisma prisma/migrations/ directory at the candidate, so a migration elsewhere would be invisible — ${wayOut}` };
|
|
577
579
|
if (layout !== true) return { ok: false, unread: true, detail: `the tree at the candidate could not be read for a migration layout, so an empty migration list since ${since || 'the first commit'} is not evidence that none changed — ${wayOut}` };
|
|
578
580
|
return { ok: true, detail: `no migration file changed since ${since || 'the first commit'}` };
|
|
@@ -803,7 +805,7 @@ function earlyLine(early) {
|
|
|
803
805
|
}
|
|
804
806
|
|
|
805
807
|
/** The final tag's annotated message: which candidate, which period, every condition, who. */
|
|
806
|
-
function tagMessage(verdict, { candidate, period, actor }) {
|
|
808
|
+
function tagMessage(verdict, { candidate, period, actor, checkedBy }) {
|
|
807
809
|
return [
|
|
808
810
|
`${candidate.version} — release (colab release finalize)`,
|
|
809
811
|
'',
|
|
@@ -812,6 +814,7 @@ function tagMessage(verdict, { candidate, period, actor }) {
|
|
|
812
814
|
period ? (period.days === 0 ? 'Test period: none (release.test-period: 0d — the human final is the test)' : `Test period: ${period.start} -> ${period.endsAt}`) : null,
|
|
813
815
|
verdict.early ? `Early final: ${earlyLine(verdict.early)}` : null,
|
|
814
816
|
`Finalized by: ${actor}`,
|
|
817
|
+
checkedBy ? `Checked by: ${checkedBy}` : null, // #673: which colab decided
|
|
815
818
|
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,
|
|
816
819
|
'',
|
|
817
820
|
'Conditions (CONVENTIONS.md §6):',
|