Skip to content

Commit cdfe878

Browse files
sametbasbugclaude
andcommitted
Put the config guard inside the build that people actually run
Removing the GitHub vars from the wrangler files left `production:config:check` still expecting them, and I found that by looking rather than by running anything — the guard is not part of `npm run build`, so a full green local run proves nothing about it. That is exactly how the Google callback slipped through on 10 August: the deploy failed in CI, production sat on new schema with old code until a second deploy landed. Twice is a pattern, and the pattern is not carelessness — it is a check that only ever runs somewhere I am not. So it moves into `build`, right after `orbit:validate`: before the slow asset work, so a config mistake fails in seconds rather than after a full site build. The guard itself now expects one callback and no owner ID, matching the configs. The comment about deriving the URL from `expected.origin` stays, because the reason survives the second provider leaving: a literal string would compare equal in precisely the case worth catching, live and dark-launch crossed. Local proof: `npm run build` end to end, now including 78 config assertions. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 7f11c5f commit cdfe878

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"type": "module",
1717
"scripts": {
1818
"dev": "astro dev",
19-
"build": "npm run test:d1 && npm run orbit:test && npm run orbit:validate && npm run og:generate && astro build && npm run site:test && npm run browser:test",
19+
"build": "npm run test:d1 && npm run orbit:test && npm run orbit:validate && npm run production:config:check && npm run og:generate && astro build && npm run site:test && npm run browser:test",
2020
"worker:build": "astro build --config astro.worker.config.mjs && wrangler deploy --dry-run --config wrangler.jsonc --outdir dist/worker",
2121
"worker:build:staging": "ORBIT_SITE_URL=https://orbit-v6-staging.samett33710.workers.dev ORBIT_NOINDEX=true astro build --config astro.worker.config.mjs && node scripts/orbit-staging-assets.mjs && wrangler deploy --dry-run --config wrangler.staging.jsonc --outdir dist/worker-staging",
2222
"worker:assets:production:live": "ORBIT_SITE_URL=https://orbit.sametbasbug.dev ORBIT_NOINDEX=false astro build --config astro.worker.config.mjs",

‎scripts/orbit-production-config-tests.mjs‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ const expectedTopLevelKeys = [
108108

109109
const expectedCommonVars = {
110110
ORBIT_ENVIRONMENT: 'production',
111-
ORBIT_PLATFORM_OWNER_GITHUB_ID: '126420524',
112111
ORBIT_BACKUP_ENABLED: 'true',
113112
ORBIT_MEDIA_ENABLED: 'true',
114113
/* Kayıt kapısı. Davet sistemi emekliye ayrıldı ve kapı açıldı; bu değer
@@ -205,14 +204,10 @@ function validateConfig(config, expected) {
205204
ORBIT_ENVIRONMENT: 'production',
206205
ORBIT_DEPLOYMENT_MODE: expected.mode,
207206
ORBIT_ALLOWED_ORIGIN: expected.origin,
208-
/* İki sağlayıcı, iki dönüş adresi. GitHub'ınki GEÇİCİ — mevcut
209-
* hesapların Google'ı bağlaması bitince o satır da bu liste de
210-
* kısalacak. Adresler kaynağa değil `expected.origin`e bağlı, çünkü
211-
* yanlış olabilecek tek şey buranın canlı ile dark-launch arasında
212-
* karışması. */
213-
ORBIT_GITHUB_CALLBACK_URL: `${expected.origin}/v1/auth/github/callback`,
207+
/* Adres kaynağa değil `expected.origin`e bağlı, çünkü yanlış
208+
* olabilecek tek şey buranın canlı ile dark-launch arasında
209+
* karışması — elle yazılmış bir dize tam o durumda eşit çıkardı. */
214210
ORBIT_GOOGLE_CALLBACK_URL: `${expected.origin}/v1/auth/google/callback`,
215-
ORBIT_PLATFORM_OWNER_GITHUB_ID: '126420524',
216211
ORBIT_OPEN_REGISTRATION: 'true',
217212
ORBIT_BACKUP_ENABLED: 'true',
218213
ORBIT_MEDIA_ENABLED: 'true',
@@ -232,7 +227,6 @@ function normalizeModeDifferences(config) {
232227
delete normalized.workers_dev;
233228
delete normalized.vars.ORBIT_DEPLOYMENT_MODE;
234229
delete normalized.vars.ORBIT_ALLOWED_ORIGIN;
235-
delete normalized.vars.ORBIT_GITHUB_CALLBACK_URL;
236230
delete normalized.vars.ORBIT_GOOGLE_CALLBACK_URL;
237231
return normalized;
238232
}

0 commit comments

Comments
 (0)