@futurelastic/colab-handbook 1.18.0-rc.3 → 1.18.0-rc.5
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
|
@@ -34,6 +34,11 @@
|
|
|
34
34
|
# (A tag pushed or a Release published with GITHUB_TOKEN starts no other workflow, so a chained call is
|
|
35
35
|
# the reliable trigger — not `on: release`.) Nothing is published from an incomplete Release: the script
|
|
36
36
|
# names what is missing and uploads nothing.
|
|
37
|
+
# Chained from release-auto.yml, gate the build jobs and this one on its `downloads-tag` output, not on
|
|
38
|
+
# the run's own finalize tag (#669): `downloads-tag` also carries a final a PERSON tagged — early
|
|
39
|
+
# (`colab release finalize --early`, #627) or on `final: human` — which no run tags, and which the daily
|
|
40
|
+
# run hands on once the site's latest.json is behind it (creating its Release, so the build jobs have one
|
|
41
|
+
# to attach files to). release-auto.yml's "DOWNLOADS" header block shows the wiring.
|
|
37
42
|
# - By hand (Actions → Run workflow) with a tag: retries a failed publish, finishes a partial one (only the
|
|
38
43
|
# missing files are sent), re-checks a complete one. `dry_run` stages and lists — it uploads nothing.
|
|
39
44
|
# The project.yml, manifest, installers and script are read from THIS run's checkout: the tag's commit when
|
|
@@ -31,6 +31,11 @@
|
|
|
31
31
|
# comment above that job
|
|
32
32
|
# the daily schedule or a dispatch, and the same npm publish of the newest final on main
|
|
33
33
|
# npm `latest` is older than that final — a final tagged by hand (`final: human`, #612)
|
|
34
|
+
# project.yml declares `downloads:`, and the final this run tagged — or, on the daily
|
|
35
|
+
# this run tagged a final, or the daily schedule / a dispatch, the newest final on main
|
|
36
|
+
# schedule / a dispatch finds the site's (an early or `final: human` final a person
|
|
37
|
+
# latest.json older than the newest final tagged, #669) — handed to YOUR build + downloads
|
|
38
|
+
# jobs as `downloads-tag`; see "DOWNLOADS" below
|
|
34
39
|
# the cut tagged a FINAL — route deploy + health check (job `deploy`, #446) — see
|
|
35
40
|
# deploy-tag-fast only "DEPLOYING IN THIS RUN" below
|
|
36
41
|
# the cut tagged a FINAL — route published like any tag (Release marked latest, npm
|
|
@@ -126,6 +131,38 @@
|
|
|
126
131
|
# ends in `[publish]`. So a red INSIDE a `[publish]` step, or in the npm or deploy jobs (which never
|
|
127
132
|
# run without a tag), cannot be cured by a dry run — that stays a human ci-grant.
|
|
128
133
|
#
|
|
134
|
+
# DOWNLOADS — EVERY FINAL, NOT ONLY THE ONES THIS RUN TAGGED (#669). A repo whose finals carry files
|
|
135
|
+
# people install (docs/downloads.md, templates/publish-downloads.yml) builds them in jobs YOU add below
|
|
136
|
+
# `release`, and chains publish-downloads.yml after them. Gate both on the release job's
|
|
137
|
+
# `downloads-tag` output, never on the finalize step's own tag: a final a person tagged — early
|
|
138
|
+
# (`colab release finalize --early`, #627) or on `final: human` — is tagged by the CLI, not by this
|
|
139
|
+
# run, so a job gated on this run's tag never builds it, and a later run reads `already-final` and
|
|
140
|
+
# skips it again. `downloads-tag` is the final this run tagged, or — on the daily run and a dispatch —
|
|
141
|
+
# the newest final on main whose version the site's latest.json does not name yet (absent, or older);
|
|
142
|
+
# that swept final also gets its GitHub Release here, so your build jobs have one to attach files to.
|
|
143
|
+
# Empty when project.yml declares no `downloads:`, when the site already names that version or a newer
|
|
144
|
+
# one (a complete version sends nothing), and when the site cannot be read from this job's runner —
|
|
145
|
+
# a warning then, never a red run; the next daily run retries. The site is read at
|
|
146
|
+
# vars.DOWNLOADS_URL/<downloads.app>/latest.json FROM THE RELEASE JOB'S RUNNER: a site only a private
|
|
147
|
+
# network reaches needs the release job on a runner inside it (RUNNERS, below). The wiring:
|
|
148
|
+
#
|
|
149
|
+
# build-macos: # EDIT: one job per platform you build
|
|
150
|
+
# needs: release
|
|
151
|
+
# if: needs.release.outputs.downloads-tag != ''
|
|
152
|
+
# runs-on: macos-latest
|
|
153
|
+
# permissions: { contents: write }
|
|
154
|
+
# steps:
|
|
155
|
+
# - uses: actions/checkout@<sha>
|
|
156
|
+
# with: { ref: '${{ needs.release.outputs.downloads-tag }}' }
|
|
157
|
+
# - run: …build, then attach the files to the tag's Release (gh release upload … --clobber)
|
|
158
|
+
# env: { GH_TOKEN: '${{ github.token }}', TAG: '${{ needs.release.outputs.downloads-tag }}' }
|
|
159
|
+
# downloads:
|
|
160
|
+
# needs: [release, build-macos]
|
|
161
|
+
# if: needs.release.outputs.downloads-tag != ''
|
|
162
|
+
# uses: ./.github/workflows/publish-downloads.yml
|
|
163
|
+
# with: { tag: '${{ needs.release.outputs.downloads-tag }}' }
|
|
164
|
+
# secrets: inherit
|
|
165
|
+
#
|
|
129
166
|
# IT READS TAGS AND CREATES TAGS. IT NEVER WRITES A COMMIT. No step here commits; the refs
|
|
130
167
|
# pushed are the tags `colab release cut` / `colab release finalize` create (annotated, their
|
|
131
168
|
# checks recorded in the tag message) and — only on a repo granting unattended promotion — the
|
|
@@ -335,6 +372,10 @@ jobs:
|
|
|
335
372
|
# What the deploy job below needs (#446) — empty unless this run tagged a deploy-tag-fast final.
|
|
336
373
|
deploy-tag: ${{ steps.cut.outputs.final }}
|
|
337
374
|
health-url: ${{ steps.cut.outputs.health-url }}
|
|
375
|
+
# What YOUR build and downloads jobs gate on (#669) — empty unless project.yml declares `downloads:`
|
|
376
|
+
# and this run tagged a final, or the daily sweep found a final the site's latest.json lacks.
|
|
377
|
+
# See "DOWNLOADS" in the header.
|
|
378
|
+
downloads-tag: ${{ steps.downloads-target.outputs.tag }}
|
|
338
379
|
env:
|
|
339
380
|
GH_TOKEN: ${{ github.token }}
|
|
340
381
|
# #474: 'true' on a dry run — a dispatch on any ref other than main, or one with dry_run set.
|
|
@@ -475,7 +516,7 @@ jobs:
|
|
|
475
516
|
{
|
|
476
517
|
echo "### colab promote --auto"
|
|
477
518
|
echo
|
|
478
|
-
jq -r '.checks[]? | "- \(if .ok then "✓" else "✗" end) **\(.condition)** — \(.detail)"' "$OUT"
|
|
519
|
+
jq -r '.checks[]? | "- \(if .checked == false then "·" elif .ok then "✓" else "✗" end) **\(.condition)** — \(.detail)"' "$OUT"
|
|
479
520
|
echo
|
|
480
521
|
} >> "$GITHUB_STEP_SUMMARY"
|
|
481
522
|
if [ "${DRY_RUN:-false}" = "true" ]; then
|
|
@@ -544,7 +585,7 @@ jobs:
|
|
|
544
585
|
{
|
|
545
586
|
echo "### colab release cut --auto"
|
|
546
587
|
echo
|
|
547
|
-
jq -r '.checks[]? | "- \(if .ok then "✓" else "✗" end) **\(.condition)** — \(.detail)"' "$OUT"
|
|
588
|
+
jq -r '.checks[]? | "- \(if .checked == false then "·" elif .ok then "✓" else "✗" end) **\(.condition)** — \(.detail)"' "$OUT"
|
|
548
589
|
echo
|
|
549
590
|
} >> "$GITHUB_STEP_SUMMARY"
|
|
550
591
|
if [ "${DRY_RUN:-false}" = "true" ]; then
|
|
@@ -680,7 +721,7 @@ jobs:
|
|
|
680
721
|
{
|
|
681
722
|
echo "### colab release finalize --auto — $STATE"
|
|
682
723
|
echo
|
|
683
|
-
jq -r '.checks[]? | "- \(if .ok then "✓" else "✗" end) **\(.condition)** — \(.detail)"' "$OUT"
|
|
724
|
+
jq -r '.checks[]? | "- \(if .checked == false then "·" elif .ok then "✓" else "✗" end) **\(.condition)** — \(.detail)"' "$OUT"
|
|
684
725
|
echo
|
|
685
726
|
if [ -n "$WHY" ]; then echo "**Why no final:** $WHY"; echo; fi
|
|
686
727
|
if [ "$(jq -r '(.skipped // []) | length' "$OUT")" != "0" ]; then
|
|
@@ -776,12 +817,83 @@ jobs:
|
|
|
776
817
|
echo "package=$PACKAGE"
|
|
777
818
|
} >> "$GITHUB_OUTPUT"
|
|
778
819
|
|
|
779
|
-
#
|
|
780
|
-
#
|
|
781
|
-
|
|
782
|
-
|
|
820
|
+
# #669: which final YOUR build + downloads jobs get (`downloads-tag`, header "DOWNLOADS"). The final
|
|
821
|
+
# this run tagged, if any; else, on the daily run and a dispatch, the newest FINAL reachable from main
|
|
822
|
+
# when the site's latest.json does not name it yet (absent → never published, older → behind) — a
|
|
823
|
+
# final a person tagged (early, #627, or `final: human`) is never tagged by a run, so without this
|
|
824
|
+
# sweep it never reached the site. The site at that version or newer, no `downloads:` block, no
|
|
825
|
+
# DOWNLOADS_URL, or an unreadable site: nothing is handed on, and the step stays green.
|
|
826
|
+
- name: Read the downloads target [publish]
|
|
827
|
+
id: downloads-target
|
|
828
|
+
if: env.DRY_RUN != 'true' && (steps.cut.outputs.tag != '' || steps.finalize.outputs.tag != '' || (github.event_name == 'schedule' && env.RETRY_RUN != 'true') || github.event_name == 'workflow_dispatch')
|
|
783
829
|
env:
|
|
784
830
|
TAGS: ${{ steps.cut.outputs.tag }} ${{ steps.finalize.outputs.tag }}
|
|
831
|
+
SWEEP: ${{ (github.event_name == 'schedule' && env.RETRY_RUN != 'true') || github.event_name == 'workflow_dispatch' }}
|
|
832
|
+
DOWNLOADS_URL: ${{ vars.DOWNLOADS_URL }}
|
|
833
|
+
run: |
|
|
834
|
+
set -uo pipefail
|
|
835
|
+
# The `downloads:` block's `app:` — the same key publish-downloads.mjs reads. No block, no target.
|
|
836
|
+
APP="$(awk '
|
|
837
|
+
/^downloads:[ \t]*(#.*)?$/ { inb = 1; next }
|
|
838
|
+
inb && /^[^ \t#]/ { exit }
|
|
839
|
+
inb && /^[ \t]+app:/ { v = $0; sub(/^[ \t]+app:[ \t]*/, "", v); sub(/[ \t]+#.*$/, "", v); gsub(/["\047]/, "", v); sub(/[ \t]+$/, "", v); print v; exit }
|
|
840
|
+
' .github/project.yml 2> /dev/null)"
|
|
841
|
+
if [ -z "$APP" ]; then
|
|
842
|
+
echo "No downloads: block in .github/project.yml — no downloads target."
|
|
843
|
+
exit 0
|
|
844
|
+
fi
|
|
845
|
+
if ! [[ "$APP" =~ ^[a-z0-9][a-z0-9-]*$ ]]; then
|
|
846
|
+
echo "::warning::downloads.app '$APP' is not a valid app slug — nothing is handed to the downloads jobs"
|
|
847
|
+
exit 0
|
|
848
|
+
fi
|
|
849
|
+
OWN="$(tr ' ' '\n' <<< "$TAGS" | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n 1 || true)"
|
|
850
|
+
if [ -n "$OWN" ]; then
|
|
851
|
+
echo "tag=$OWN" >> "$GITHUB_OUTPUT"
|
|
852
|
+
echo "downloads: $OWN was tagged by this run — handing it to the build and downloads jobs" | tee -a "$GITHUB_STEP_SUMMARY"
|
|
853
|
+
exit 0
|
|
854
|
+
fi
|
|
855
|
+
[ "${SWEEP:-false}" = "true" ] || exit 0
|
|
856
|
+
FINAL="$(git tag --merged HEAD --list 'v*' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n 1 || true)"
|
|
857
|
+
if [ -z "$FINAL" ]; then
|
|
858
|
+
echo "downloads sweep: no final on main yet — nothing to publish"
|
|
859
|
+
exit 0
|
|
860
|
+
fi
|
|
861
|
+
if [ -z "${DOWNLOADS_URL:-}" ]; then
|
|
862
|
+
echo "::warning::downloads sweep: the DOWNLOADS_URL variable is not set on this repo — cannot read the site, so $FINAL is not handed on"
|
|
863
|
+
exit 0
|
|
864
|
+
fi
|
|
865
|
+
eval "$RETRY_TRANSIENT"
|
|
866
|
+
VERSION="${FINAL#v}"
|
|
867
|
+
URL="${DOWNLOADS_URL%/}/$APP/latest.json"
|
|
868
|
+
ERR="$RUNNER_TEMP/downloads-latest.err"
|
|
869
|
+
hand_on() {
|
|
870
|
+
{ echo "tag=$FINAL"; echo "swept=$FINAL"; } >> "$GITHUB_OUTPUT"
|
|
871
|
+
echo "downloads sweep: $1 — handing $FINAL to the build and downloads jobs (#669)" | tee -a "$GITHUB_STEP_SUMMARY"
|
|
872
|
+
}
|
|
873
|
+
if BODY="$(retry_transient curl -fsSL "$URL" 2> "$ERR")"; then
|
|
874
|
+
SITE="$(jq -r '.version // empty' <<< "$BODY" 2> /dev/null || true)"
|
|
875
|
+
if [ -z "$SITE" ]; then
|
|
876
|
+
echo "::warning::downloads sweep: $URL names no version — $FINAL is not handed on in this run"
|
|
877
|
+
elif [ "$SITE" = "$VERSION" ]; then
|
|
878
|
+
echo "downloads sweep: the site already names $VERSION — nothing to publish"
|
|
879
|
+
elif [ "$(printf '%s\n' "$SITE" "$VERSION" | sort -V | tail -n 1)" = "$SITE" ]; then
|
|
880
|
+
echo "downloads sweep: the site names $SITE, newer than $FINAL — nothing to publish" | tee -a "$GITHUB_STEP_SUMMARY"
|
|
881
|
+
else
|
|
882
|
+
hand_on "$FINAL is final on main but the site names $SITE"
|
|
883
|
+
fi
|
|
884
|
+
elif grep -q 'error: 404' "$ERR"; then
|
|
885
|
+
hand_on "$FINAL is final on main and the site has no latest.json for $APP"
|
|
886
|
+
else
|
|
887
|
+
echo "::warning::downloads sweep: could not read $URL from this runner ($(tail -n 1 "$ERR" 2> /dev/null)) — $FINAL is not handed on in this run; the next daily run retries"
|
|
888
|
+
fi
|
|
889
|
+
|
|
890
|
+
# Publishes every tag THIS run created — and a final the downloads sweep handed on (#669), which a
|
|
891
|
+
# person tagged and nothing published. In this run, never via a tag-push workflow: see "PUBLISHING
|
|
892
|
+
# HAPPENS IN THIS RUN" in the header.
|
|
893
|
+
- name: Publish GitHub Release (same run) [publish]
|
|
894
|
+
if: env.DRY_RUN != 'true' && (steps.cut.outputs.tag != '' || steps.finalize.outputs.tag != '' || steps.downloads-target.outputs.swept != '')
|
|
895
|
+
env:
|
|
896
|
+
TAGS: ${{ steps.cut.outputs.tag }} ${{ steps.finalize.outputs.tag }} ${{ steps.downloads-target.outputs.swept }}
|
|
785
897
|
run: |
|
|
786
898
|
set -euo pipefail
|
|
787
899
|
eval "$RETRY_TRANSIENT"
|
package/tools/colab
CHANGED
|
@@ -1311,7 +1311,9 @@ Refuses, naming each failed condition (all are reported, not just the first):
|
|
|
1311
1311
|
under a project.yml \`migrations:\` prefix) or an existing migration was
|
|
1312
1312
|
edited/deleted. Other layouts are not read — a declared migration in another
|
|
1313
1313
|
format is NAMED in the detail, and the release notes still owe the §6
|
|
1314
|
-
judgement on the diff
|
|
1314
|
+
judgement on the diff. When nothing was read — no default layout and no
|
|
1315
|
+
\`migrations:\` declared, or a declared migration in another format changed —
|
|
1316
|
+
the row prints · "not checked" (#670): it refuses nothing, and it is never a ✓
|
|
1315
1317
|
switch-dependencies a colab:switch marker is malformed, or a finished switch needs one that is not
|
|
1316
1318
|
manifest-version the tag does not equal the version a manifest declares (VERSION, package.json,
|
|
1317
1319
|
Cargo.toml [package], else [workspace.package] (#620), pyproject.toml
|
|
@@ -1470,9 +1472,14 @@ function measureCandidateConditions(repoAbs, { sha, lastFinal, at, readRuns, iss
|
|
|
1470
1472
|
// same one rule the ship gate reads (tools/lib/migration-paths.js), never a second regex.
|
|
1471
1473
|
const declared = migrationPaths.unionPaths(projectDoc(repoAbs), projectDocAt(repoAbs, sha));
|
|
1472
1474
|
const changes = releaseCutChanges(repoAbs, lastFinal, sha, declared);
|
|
1475
|
+
// #670: does a default layout exist at the candidate — anywhere in the tree, as the defaults are
|
|
1476
|
+
// matched (migration-paths.js isMigrationPath)? Without one and with nothing declared, the check
|
|
1477
|
+
// read nothing: "not checked", never a ✓. null = the tree could not be read, never "absent".
|
|
1478
|
+
const layoutR = git.git(['ls-tree', '-r', '-d', '--name-only', sha], repoAbs);
|
|
1479
|
+
const layout = layoutR.ok ? layoutR.stdout.split('\n').some((d) => d && migrationPaths.isMigrationPath(`${d}/`, [])) : null;
|
|
1473
1480
|
const schema = changes === null
|
|
1474
1481
|
? { ok: false, unread: true, detail: 'git diff failed — schema changes cannot be read' }
|
|
1475
|
-
: releaseCut.schemaVerdict(changes, lastFinal || 'the first commit', declared);
|
|
1482
|
+
: releaseCut.schemaVerdict(changes, lastFinal || 'the first commit', declared, layout);
|
|
1476
1483
|
// #441: every migration file since the last final, destructive or not — an operator-granted
|
|
1477
1484
|
// automatic final refuses an ungranted one (release-finalize.js migrationGrantVerdict).
|
|
1478
1485
|
const migrations = changes === null ? null : changes.filter((c) => releaseCut.isMigrationPath(c.path, declared)).map((c) => c.path);
|
|
@@ -1862,7 +1869,7 @@ function cmdReleaseCut(argv) {
|
|
|
1862
1869
|
for (const l of verdict.signals.lines) print(` · ${l}`);
|
|
1863
1870
|
}
|
|
1864
1871
|
const width = Math.max(...verdict.checks.map((c) => c.condition.length));
|
|
1865
|
-
for (const c of verdict.checks) print(` ${c.ok ? '✓' : '✗'} ${c.condition.padEnd(width)} ${c.detail}`);
|
|
1872
|
+
for (const c of verdict.checks) print(` ${c.checked === false ? '·' : c.ok ? '✓' : '✗'} ${c.condition.padEnd(width)} ${c.detail}`);
|
|
1866
1873
|
print('');
|
|
1867
1874
|
if (verdict.noop) {
|
|
1868
1875
|
print(fast
|
|
@@ -2379,7 +2386,7 @@ function cmdReleaseFinalize(argv) {
|
|
|
2379
2386
|
} else {
|
|
2380
2387
|
print(`colab release finalize${opts.auto ? ' --auto' : ''} — ${shortRepo(repoAbs)} (last final: ${lastFinal || 'none'}${cand ? `, candidate: ${cand.tag}` : ''})`);
|
|
2381
2388
|
const width = Math.max(...verdict.checks.map((c) => c.condition.length));
|
|
2382
|
-
for (const c of verdict.checks) print(` ${c.ok ? '✓' : (c.required ? '✗' : '·')} ${c.condition.padEnd(width)} ${c.detail}`);
|
|
2389
|
+
for (const c of verdict.checks) print(` ${c.checked === false ? '·' : c.ok ? '✓' : (c.required ? '✗' : '·')} ${c.condition.padEnd(width)} ${c.detail}`);
|
|
2383
2390
|
if (walk && skipped.length) {
|
|
2384
2391
|
print(' other open candidates:');
|
|
2385
2392
|
for (const x of skipped) print(` · ${x.tag}: ${x.state}${x.detail ? ` — ${x.detail}` : ''}`);
|
package/tools/lib/release-cut.js
CHANGED
|
@@ -854,8 +854,21 @@ function laravelUpBody(text) {
|
|
|
854
854
|
* — an edited or deleted migration counts as destructive, because rewriting history a database has
|
|
855
855
|
* already run is not an add. A false positive costs a human cutting the candidate; a false negative
|
|
856
856
|
* is the §6 judgement the release notes still owe (read the diff, not only this).
|
|
857
|
+
*
|
|
858
|
+
* #670: a third outcome beside ✓ and ✗ — NOT CHECKED, `{ ok: true, checked: false }`. It refuses
|
|
859
|
+
* nothing (an absent `migrations:` still changes no gate — project.schema.md `migrations`; for a
|
|
860
|
+
* DECLARED migration in an unread format, the #441 migration-grant check still holds an automatic
|
|
861
|
+
* final), but it is never printed as a green pass:
|
|
862
|
+
* a ✓ reading "other layouts are not read" was read as "no migration" by the human finalizing a
|
|
863
|
+
* release whose migrations sat in a directory this check never looked at. Two cases:
|
|
864
|
+
* - nothing declared and no default layout at the candidate (`layout` false) — nothing was read;
|
|
865
|
+
* - a declared migration in a format the heuristic does not read changed, and nothing it did read
|
|
866
|
+
* is destructive (a destructive read file is still ✗).
|
|
867
|
+
* `layout` = does `database/migrations/` or `prisma/migrations/` exist in the tree at the candidate:
|
|
868
|
+
* true / false / null (the tree could not be read — never "absent"). Undefined = a caller that does
|
|
869
|
+
* not measure it, read as today: present.
|
|
857
870
|
*/
|
|
858
|
-
function schemaVerdict(changes, since, declared) {
|
|
871
|
+
function schemaVerdict(changes, since, declared, layout) {
|
|
859
872
|
const inPaths = (changes || []).filter((c) => isMigrationPath(c.path, declared));
|
|
860
873
|
const migrations = inPaths.filter((c) => /\.(php|sql)$/.test(c.path));
|
|
861
874
|
// #383: a declared path widens what COUNTS as a migration, not what this heuristic can READ. A
|
|
@@ -867,10 +880,16 @@ function schemaVerdict(changes, since, declared) {
|
|
|
867
880
|
? inPaths.filter((c) => !/\.(php|sql)$/.test(c.path) && !migrationPaths.isMigrationPath(c.path, []))
|
|
868
881
|
: [];
|
|
869
882
|
const scope = `Laravel database/migrations + Prisma prisma/migrations${declared && declared.length ? ` + declared ${declared.join(', ')} (php/sql only)` : ''} — other layouts are not read`;
|
|
870
|
-
const
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
883
|
+
const hasDeclared = !!(declared && declared.length);
|
|
884
|
+
const notChecked = (why) => ({ ok: true, checked: false, detail: `not checked — ${why}` });
|
|
885
|
+
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
|
+
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) {
|
|
888
|
+
if (unread.length) return notChecked(unreadWhy());
|
|
889
|
+
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
|
+
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}`);
|
|
891
|
+
return { ok: true, detail: `no migration file changed since ${since} (${scope})` };
|
|
892
|
+
}
|
|
874
893
|
const findings = [];
|
|
875
894
|
for (const c of migrations) {
|
|
876
895
|
const st = String(c.status || '').charAt(0);
|
|
@@ -888,7 +907,8 @@ function schemaVerdict(changes, since, declared) {
|
|
|
888
907
|
if (findings.length) {
|
|
889
908
|
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('; ')}` };
|
|
890
909
|
}
|
|
891
|
-
|
|
910
|
+
if (unread.length) return notChecked(`${migrations.length} migration file(s) added since ${since}, none destructive — but ${unreadWhy()}`);
|
|
911
|
+
return { ok: true, detail: `${migrations.length} migration file(s) added since ${since}, none destructive (${scope})` };
|
|
892
912
|
}
|
|
893
913
|
|
|
894
914
|
// ---- §6 condition 4: switch dependencies -------------------------------------------------------
|
|
@@ -1165,7 +1185,12 @@ function decide(facts) {
|
|
|
1165
1185
|
|
|
1166
1186
|
for (const [condition, verdict] of [['ci-green', f.ci], ['full-suite', f.suite], ['schema-additive', f.schema], ['switch-dependencies', f.switches]]) {
|
|
1167
1187
|
if (!verdict) add(condition, false, 'not measured', true);
|
|
1168
|
-
else
|
|
1188
|
+
else {
|
|
1189
|
+
add(condition, verdict.ok, verdict.detail, isUnread(verdict));
|
|
1190
|
+
// #670: a not-checked verdict passes but is not a ✓ — the one optional field a row can carry,
|
|
1191
|
+
// present only then, so every other row (and `--json` on every other run) is unchanged.
|
|
1192
|
+
if (verdict.checked === false) checks[checks.length - 1].checked = false;
|
|
1193
|
+
}
|
|
1169
1194
|
}
|
|
1170
1195
|
|
|
1171
1196
|
// #610: a final needs the heavy lane green at its exact sha, under every integration profile. Only
|
|
@@ -713,6 +713,7 @@ function decide(facts) {
|
|
|
713
713
|
if (hv) add('heavy-lane', hv.ok, hv.detail);
|
|
714
714
|
for (const [condition, v] of [['schema-additive', f.schema], ['switch-dependencies', f.switches]]) {
|
|
715
715
|
add(condition, v && v.ok, v ? v.detail : 'not measured');
|
|
716
|
+
if (v && v.checked === false) checks[checks.length - 1].checked = false; // #670: passes, never a ✓
|
|
716
717
|
}
|
|
717
718
|
// #424: before any final — the tag equals the manifests, the commit is on trunk, the version outranks the latest final.
|
|
718
719
|
for (const c of releaseTag.preTagChecks({ tag: cand.version, manifests: f.manifests, ancestry: f.ancestry, tags: f.tags, trunk: 'main', versionSource: p.effective.versionSource === 'tag' ? 'tag' : 'manifest' })) add(c.condition, c.ok, c.detail);
|
|
@@ -802,7 +803,7 @@ function tagMessage(verdict, { candidate, period, actor }) {
|
|
|
802
803
|
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,
|
|
803
804
|
'',
|
|
804
805
|
'Conditions (CONVENTIONS.md §6):',
|
|
805
|
-
...verdict.checks.map((c) => `- ${c.condition}: ${c.ok ? 'ok' : (c.required ? 'FAILED' : 'informational')} — ${c.detail}`),
|
|
806
|
+
...verdict.checks.map((c) => `- ${c.condition}: ${c.checked === false ? 'not checked' : c.ok ? 'ok' : (c.required ? 'FAILED' : 'informational')} — ${c.detail}`),
|
|
806
807
|
].filter((l) => l !== null).join('\n') + '\n';
|
|
807
808
|
}
|
|
808
809
|
|