Repository navigation
fix(platform): enforce GitHub authority in the schema, require platform 0.23.0 in the CLI - #356
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://fix-github-authority-constraints-void-cloud.voidzero-docs.workers.dev (commit 921455e)This URL reflects your latest Preview deploymentPreview Deployments by commit
View all previews: View all previews ↗ |
cd5c125 to
1485a5e
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
1 similar comment
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
eb902f9 to
690f41b
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
690f41b to
065a3f2
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
065a3f2 to
174470c
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
174470c to
496f11f
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
496f11f to
fb553bd
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
fb553bd to
200c2a1
Compare
GitHub connections now require an authorizer and a repository id, and a user who still authorizes a connection can no longer be deleted silently. The migration first removes connections that lack authority and cancels their active builds, so it applies cleanly to older data, and runtime null handling for these columns is removed. A personal installation converted into an organization now drops its owner. Upgrades from 0.10.14 and 0.20.1 must now pass through a later release; 0.23.0 and 0.24.0 installations can upgrade directly. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The drain audit test took the last row of an unordered operator_events read. Each audit row is inserted and then updated with its outcome, so on a reused PostgreSQL table its physical position can differ from request order. Read the rows by creation time instead. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Installation memberships and join codes always carry the GitHub account that proved them. Webhook responses return only `buildIds`. GitHub Actions OIDC tokens and workflow_run events must carry `run_attempt`, which GitHub always sends. Deploy tokens must be bound to a build or a CI credential. The build scheduler cancels a queued build without a branch instead of using the connection branch. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The CLI checks the platform version from public discovery once per process and stops with an upgrade message on a platform older than 0.23.0, or on one that answers discovery with 404. Other unusable discovery answers let the request run. Login still works on older platforms. Hosted deploys now report their release version. Fallbacks for responses that older platforms sent are removed, including deploy streams without a deployment receipt and build log pages without logsComplete. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A JSON deploy keeps writing to the database until its NDJSON body is read. A test that checked only the status left that deploy running into the next test, where its project-then-deployment row locks deadlocked with the deployment-then-project deletes in clearTables on PostgreSQL. The integration setup now reads every unread deploy stream after each test, and cancels receipt streams, which only poll. A PostgreSQL-only regression test leaves a deploy unread while it holds the project lock. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
200c2a1 to
921455e
Compare
Why
#355 (released in v0.22.0) moved the data to the current GitHub authority model and removed the code for the old shapes. This PR makes the schema enforce that model, so those shapes can no longer come back.
Migration 0057
FK: NO ACTION.
deleteUseris the only code that deletes ausersrow, and it removes every connection the user authorized first (cancelling builds). With CASCADE, a connection that escaped that cleanup would disappear without cancelling its builds. With NO ACTION, that case fails loudly.Code
upsertGitHubInstallationclearsuser_idwhen the incoming account type isOrganization(a personal account converted into an organization).repositoryIdtypes, the null-repository fail-closed branches, and the?? 'unknown'authorizer fallback.Removed compatibility paths
Each path was checked against current code and every rollback target (0.20.3 – 0.24.0). No writer uses it.
stringaccount id./github/join/completerejects a join code without one. The column stays nullable: the schema-compat job runs the deployed runtime's tests, and they still insert rows without it.buildIdin webhook responsesbuildIds. The ingress relay passes the body through, and GitHub ignores it.run_attemptnull handlingrun_attempt. Aworkflow_runevent without it is ignored. The build column stays nullable, because container builds have no attempt.buildorcredentialbuildand lives at most 65 minutes. CI credential tokens carrycredential.Kept on purpose: the claim-time instance-type fill-in. Without it, one queued row without an instance type would block the build queue.
CLI minimum platform version
feat(void): thevoidCLI requires platform 0.23.0 or newer (MIN_PLATFORM_VERSIONinpackages/void/src/cli/client.ts).PLATFORM_VERSIONfrompackages/platform/package.json(platform/scripts/platform-version.ts). Release order: deploy hosted prod, then publish npm (platform/meta/operations.md).void connectskip the check, so users can still sign in to an older platform. Platform upgrade, status, rollback, domain activation, and operator commands do not usePlatformClient, so they keep working on older runtimes.x-void-deployment-idreceipt (server change a98803f, in 0.23.0). A 200 deploy response without a receipt now fails with "Platform returned no deployment receipt."logsComplete(server change c37e951, in 0.23.0).nullstill means "cannot prove completion".cname_targeton domain statusidonwhoamiroleon read pathsrepository_idon GitHub connectionsseq, and heartbeatstatusplus the observation pageheartbeatcame in 21d4ec4, after 0.23.0. These stay optional.recoveryAtis sent only while a lease exists.logsComplete === undefined: operator commands skip the version check, and servers before 0.20.0 omit it.void platform domainhandling of a 404 from runtimes before 0.22.0 (a management command).deploymentExecution: 1, so the installer bindsDEPLOYMENTS_QUEUE, and every hosted wrangler environment binds it too. The inline stream without a receipt runs only when that binding is missing.Compatibility edges
authorized_by_user_iddeleteUsercleans connections firstThe digests match the runtimes published to npm (
@void/platform0.23.0 and 0.24.0). Self-hosted installs on 0.10.14 or 0.20.1 must upgrade through a release from 0.20.3 to 0.24.0 first.Not in this PR
Organization⇒user_id IS NULL) waits for a later release. The rollback targets 0.20.3–0.24.0 still run the old upsert, which keepsuser_idon a User→Organization conversion and would violate the CHECK. It can land once every rollback target contains the upsert fix above.github_installation_members.github_account_id NOT NULLwaits for the same reason: the deployed runtime's tests still insert rows without it.Test deadlock on PostgreSQL
test(platform): both failed v0.24.0 publish runs stopped inplatform-ci / schema-compatondeploy-direct-r2.test.tswith40P01 deadlock detected.TRUNCATEstill deadlocked in a local reproduction, and changing only the cleanup would still let the leaked deploy write into the next test.unread-deploy-cleanup.test.tsholds a deploy at its project lock and leaves it unread. Before the fix it failed 3/3 with40P01; after, it passed 3/3. It is skipped on PGlite.deploy-direct-r2.test.tson Postgres: 4/6 runs deadlock with the old setup, 0/8 with the new one.Also
test(platform): the Sandbox drain audit test readoperator_eventswithoutORDER BY. Each audit row is inserted and then updated, so on a reused Postgres table its physical position can change. The test now reads by creation time. Production already sorts these rows.Verification
vp run check✓,vp lint✓,vp run lint:platform✓,vp fmt --check✓vp test run: 678 files (1 skipped: the Postgres-only regression on PGlite), 12732 passed, 27 skipped.vp run test --base origin/main: selected all 678 files; 12732 passed, 27 skipped.9ef5d5b5(platform 0.24.0), migrated + seeded, then this branch's migrations + fixture verify, then the baseline's API integration tests on Postgres in UTC: 99/99 files, 2344 tests passed.api-health"relation already exists",platform-email-bootstrap:125) also happen on plain main in the same setup; plain main also hit theoperator-operationsSandbox drain read that the second commit fixes.api.void.cloudpasses the check (then 401 for a bogus token); a fake 0.22.0 platform stops with the minimum-version error and gets no API call; a fake 0.23.0 platform passes.db:generatereports no changes.🤖 Generated with Claude Code