|
| 1 | +# Upgrade-source gate — the v18 → v19 SOURCE upgrade, walked the way a real |
| 2 | +# 18.x user walks it, against this checkout's packed tarballs, with no model key. |
| 3 | +# |
| 4 | +# Every upgrade-path defect found on the GA path passed its own unit tests and |
| 5 | +# was caught only by a hand-run acceptance: the migration tool's tests use |
| 6 | +# stacks written as literals, while a user's project is the template's |
| 7 | +# `exportsOf(…)` wiring over barrels, with a database an 18.x install wrote. |
| 8 | +# The two neighbouring gates cover other ground: `scaffold-e2e.yml` builds and |
| 9 | +# boots a NEW scaffold, and `upgrade-harness-optin.yml` boots an 18.0 DATABASE |
| 10 | +# on main; neither runs the source migration. |
| 11 | +# |
| 12 | +# The job and its assertions live in `packages/qa/upgrade-source/run.mjs` |
| 13 | +# (header: what is walked, and how an assertion that waits on an open card is |
| 14 | +# reported); the committed 18.6.0 project and the database the PUBLISHED 18.6.0 |
| 15 | +# CLI wrote for it sit beside it, with their provenance. The install step is |
| 16 | +# scaffold-e2e.yml's: this checkout's publishable packages packed with |
| 17 | +# `scripts/publish-smoke-pack.mjs`, and the project's `@objectstack/*` pins |
| 18 | +# moved to that version and resolved through the project's own pnpm overrides. |
| 19 | +# |
| 20 | +# NOT a required check, and green: no assertion waits on an open card. A red |
| 21 | +# reads UNEXPECTED unless its `waitsOn` card is open and the red is that card's |
| 22 | +# own failure (run.mjs header). It joins the required set only by a later, |
| 23 | +# deliberate edit of `scripts/check-required-contexts.mjs`. |
| 24 | +# |
| 25 | +# Every step below is part of an install/build/migrate/boot pipeline, not a |
| 26 | +# named local verification script a dev pre-runs with `pnpm check:x` — there is |
| 27 | +# no check family here to discover, deliberately (the scaffold-e2e.yml shape): |
| 28 | +# dispatch-gates: no-check-families -- steps are an e2e pipeline, not named local checks |
| 29 | + |
| 30 | +name: Upgrade Source Gate |
| 31 | + |
| 32 | +on: |
| 33 | + pull_request: |
| 34 | + # Every input the walk runs through, by the step that reads it. A step's |
| 35 | + # code missing here lets a PR change what the walk asserts without the walk |
| 36 | + # running on it. |
| 37 | + paths: |
| 38 | + # `os migrate meta` (--write, --stored), `os migrate apply`, `os migrate |
| 39 | + # protocol`, the source writer, and the schema migration they share. |
| 40 | + - 'packages/cli/**/migrate*' |
| 41 | + - 'packages/cli/**/migrate*/**' |
| 42 | + - 'packages/cli/src/utils/authored-source-*' |
| 43 | + - 'packages/cli/src/utils/schema-migrate.ts' |
| 44 | + # `os validate` / `os build`, and the protocol-range check both run. |
| 45 | + - 'packages/cli/src/commands/validate.ts' |
| 46 | + - 'packages/cli/src/commands/build.ts' |
| 47 | + - 'packages/cli/src/commands/compile.ts' |
| 48 | + - 'packages/cli/src/utils/protocol-version-gap.ts' |
| 49 | + # T2: the dry run's own-field-row list (`ownFieldRowNarrowing`). |
| 50 | + - 'packages/cli/src/utils/own-field-row-narrowing.ts' |
| 51 | + # The ADR-0087 conversion table (its entries, `conversions/entries/NN/*`) |
| 52 | + # and the migration chain and registry that replay it. |
| 53 | + - 'packages/spec/src/conversions/**' |
| 54 | + - 'packages/spec/src/**/migrations/**' |
| 55 | + # The stored-row conversion `--stored` and the boot apply to sys_metadata. |
| 56 | + - 'packages/metadata-protocol/src/stored-migration.ts' |
| 57 | + - 'packages/metadata-protocol/src/protocol-stored-*' |
| 58 | + # B5 and B6: the runtime field axis the boot's reads and writes go through |
| 59 | + # (the set's own field row against viewAllFields / Modify All). |
| 60 | + - 'packages/plugins/plugin-security/src/permission-evaluator.ts' |
| 61 | + - 'packages/plugins/plugin-security/src/field-masker.ts' |
| 62 | + - 'packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts' |
| 63 | + - 'packages/core/src/security/effective-object-permissions.ts' |
| 64 | + # The template a user's project starts from. |
| 65 | + - 'packages/cli/src/commands/init.ts' |
| 66 | + - 'packages/create-objectstack/**' |
| 67 | + # How the walk installs this checkout: the packer and the workspace setup. |
| 68 | + - 'scripts/publish-smoke-pack.mjs' |
| 69 | + - '.github/actions/setup-workspace/**' |
| 70 | + # The gate itself. |
| 71 | + - 'packages/qa/upgrade-source/**' |
| 72 | + - '.github/workflows/upgrade-source-gate.yml' |
| 73 | + schedule: |
| 74 | + - cron: '41 4 * * *' |
| 75 | + workflow_dispatch: |
| 76 | + |
| 77 | +permissions: |
| 78 | + contents: read |
| 79 | + |
| 80 | +# A newer run for the same pull request supersedes this one; the schedule and |
| 81 | +# dispatch runs share a group keyed on their own event and wait for each other |
| 82 | +# (scaffold-e2e.yml's shape). |
| 83 | +concurrency: |
| 84 | + group: upgrade-source-gate-${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.event.after || github.ref }} |
| 85 | + cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 86 | + |
| 87 | +jobs: |
| 88 | + upgrade-source: |
| 89 | + name: v18 → v19 source upgrade |
| 90 | + runs-on: ubuntu-latest |
| 91 | + timeout-minutes: 45 |
| 92 | + steps: |
| 93 | + - name: Checkout repository |
| 94 | + uses: actions/checkout@v7 |
| 95 | + |
| 96 | + - name: Setup workspace |
| 97 | + uses: ./.github/actions/setup-workspace |
| 98 | + |
| 99 | + - name: Setup turbo cache |
| 100 | + uses: actions/cache@v6 |
| 101 | + with: |
| 102 | + path: .turbo/cache |
| 103 | + key: ${{ runner.os }}-turbo-${{ github.job }}-${{ github.sha }} |
| 104 | + restore-keys: | |
| 105 | + ${{ runner.os }}-turbo-${{ github.job }}- |
| 106 | + ${{ runner.os }}-turbo- |
| 107 | +
|
| 108 | + # The runner's pure judgements, on fixtures, before anything is built. |
| 109 | + - name: Self-test the runner |
| 110 | + run: node packages/qa/upgrade-source/run.mjs --self-test |
| 111 | + |
| 112 | + # The build set is read off the fixture's own package.json, never a hand |
| 113 | + # list: each `@objectstack/*` dependency it declares, with turbo's |
| 114 | + # `^build` bringing that package's workspace dependencies along. |
| 115 | + - name: Build the framework the fixture depends on |
| 116 | + run: | |
| 117 | + FILTERS=$(node -p ' |
| 118 | + const pkg = require("./packages/qa/upgrade-source/fixture-18.6.0/package.json"); |
| 119 | + const names = [pkg.dependencies, pkg.devDependencies] |
| 120 | + .flatMap((deps) => Object.keys(deps ?? {})) |
| 121 | + .filter((name) => name.startsWith("@objectstack/")); |
| 122 | + if (names.length === 0) throw new Error("the fixture declares no @objectstack/* dependency"); |
| 123 | + names.map((name) => "--filter=" + name).join(" "); |
| 124 | + ') |
| 125 | + echo "turbo run build $FILTERS" |
| 126 | + # shellcheck disable=SC2086 # FILTERS is a word list on purpose. |
| 127 | + pnpm exec turbo run build $FILTERS |
| 128 | +
|
| 129 | + - name: Pack this checkout's publishable packages |
| 130 | + run: node scripts/publish-smoke-pack.mjs "$RUNNER_TEMP/tarballs" |
| 131 | + |
| 132 | + # Template wiring (migrate meta --write, re-run, range, validate, build), |
| 133 | + # the 18.6.0 database (migrate apply, the protocol-19 switch, --stored), |
| 134 | + # the boot and its reads, then the helper-built wiring. The summary lists |
| 135 | + # every assertion, and names the card each red waits on. |
| 136 | + # GITHUB_TOKEN reads (only) the state of each card an expected red waits |
| 137 | + # on: a red is excused only while its card reads open. |
| 138 | + - name: Walk the v18 → v19 upgrade |
| 139 | + env: |
| 140 | + GITHUB_TOKEN: ${{ github.token }} |
| 141 | + run: node packages/qa/upgrade-source/run.mjs --tarballs "$RUNNER_TEMP/tarballs" --work "$RUNNER_TEMP/upgrade-source" |
| 142 | + |
| 143 | + - name: Upload the walk's logs |
| 144 | + if: always() |
| 145 | + uses: actions/upload-artifact@v7 |
| 146 | + with: |
| 147 | + name: upgrade-source-logs |
| 148 | + path: | |
| 149 | + ${{ runner.temp }}/upgrade-source/logs |
| 150 | + ${{ runner.temp }}/upgrade-source/results.json |
| 151 | + if-no-files-found: ignore |
| 152 | + retention-days: 14 |
0 commit comments