Repository navigation
bench: read-only CI database role, commits.branch, develop-only reads - #149
Merged
Merged
Conversation
Migration 011 creates bench_ci_read, an IAM-auth Postgres user with SELECT on the six data tables, read-only transactions, a 60 s statement timeout and a 16-connection cap. provision.sh adds GitHubBenchmarkReadRole, which scopes rds-db:connect to that user and trusts vortex-data/vortex on any branch and on its own pull requests, so benchmark CI can diff its numbers against the published ones. Migration 012 adds commits.branch, NOT NULL DEFAULT 'develop'. Every existing row was ingested from develop, which is the only branch the ingest role trusts, so the default backfills them correctly, and the current writer keeps working without sending the column. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UeniBAnpRTzETB7g2Hnzj8 Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Every read of commits now goes through a develop-only filter (web/lib/branch.ts): commit windows, chart seeds, group rows and summaries. Query-measurement paths that skip the commits join check the row's commit is on develop. Numbers ingested from another branch can no longer reach the site. Requires migration 012 to be applied first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UeniBAnpRTzETB7g2Hnzj8 Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Bench preview for |
robert3005
reviewed
Oct 30, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UeniBAnpRTzETB7g2Hnzj8 Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
robert3005
approved these changes
Oct 30, 2026
🔦 Lighthouse audit
Run |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
Do not merge until migrations 011 and 012 are applied to production. The web change queries
commits.branch, which only exists after 012, and merging deploys the site.What
Lets
vortex-data/vortexCI read the benchmark database to diff its numbers against the published ones, and records which branch each commit's numbers came from.1. Read-only CI role
migrations/011_ci_read_role.sql(requires-superuser) creates the Postgres userbench_ci_read:rds_iam, with no password.SELECTon the six data tables, plus default privileges so futuremigratortables are granted too. No access to_applied_migrations.default_transaction_read_only = on,statement_timeout = 60s,idle_in_transaction_session_timeout = 60s,CONNECTION LIMIT 16.bench_readbecause that user has to keep password auth for Vercel, and on RDS anrds_iammember can't use a password.infra/provision.shaddsGitHubBenchmarkReadRole:rds-db:connectonbench_ci_readonly.repo:vortex-data/vortex:ref:refs/heads/*andrepo:vortex-data/vortex:pull_request, so PR benchmark runs can use it. Fork PRs get no OIDC token.--print-trust readprints the policy without touching AWS.2.
commits.branchmigrations/012_commit_branch.sql(applied bymigrator) addsbranch TEXT NOT NULL DEFAULT 'develop'and an index on(branch, timestamp DESC, commit_sha DESC).develop, the only branch the ingest role trusts, so the default is correct for them.scripts/post-ingest.py) doesn't send a branch, so it keeps writingdeveloprows unchanged.3. Website reads only
developweb/lib/branch.tssetsREAD_BRANCH = 'develop'.commitsinqueries.tsandsummary.tsis filtered by it: commit windows, chart seeds, group rows and summaries.commitsjoin check the row's commit is ondevelop.LEFT JOIN, so orphan rows still show (the documented fail-visible behaviour).Deploy order
uv run --no-project scripts/migrate-schema.py apply. This applies 011 and 012.infra/provision.shto createGitHubBenchmarkReadRole.gh variable set GH_BENCH_READ_ROLE_ARN --repo vortex-data/vortex --body <arn>.Checks
bun run --cwd bench/web testagainst Postgres 16tsc --noEmit,bun run biome ci benchinfra/tests(trust policies, including the new read role)scripts/tests/test_migrate_schema.pymigratorrefused 011, master applied it,migratorapplied 012.bench_ci_readcould read; inserts and ledger access were refusedNot verified:
Generated by Claude Code