Skip to content

fix(member-profile): make backfill script prod-runnable + dry-run default#4161

Merged
bokelley merged 1 commit intomainfrom
bokelley/backfill-script-prod-runnable
May 6, 2026
Merged

fix(member-profile): make backfill script prod-runnable + dry-run default#4161
bokelley merged 1 commit intomainfrom
bokelley/backfill-script-prod-runnable

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

@bokelley bokelley commented May 6, 2026

Summary

Three small fixes to the backfill script from #4157:

  • Move to server/src/scripts/ — the prior server/scripts/ path was excluded from server/tsconfig.json's include glob, so the script never compiled into dist/ and was unreachable on prod. Confirmed via fly ssh (got ERR_MODULE_NOT_FOUND). All other prod-runnable backfills live under server/src/scripts/.
  • Default to dry-run (require explicit --apply to write). Security review nit; cheap insurance against operator wiring to the wrong DATABASE_URL.
  • Personal-org test — pins the explicit decision that brand-identity auto-populate is NOT gated on is_personal. Code review nit; future change that adds if (isPersonal) return will fail this test and have to revisit the rationale.

Test plan

  • Local integration suite passes (6 tests)
  • Typecheck clean
  • After merge: deploy lands dist/scripts/backfill-primary-brand-domain.js on prod; run via fly ssh console -a adcp-docs -C 'node /app/dist/scripts/backfill-primary-brand-domain.js' for dry-run, then --apply to write.

🤖 Generated with Claude Code

…ault

- Move script to server/src/scripts/ so it compiles into dist/scripts/ and
  ships to prod (the prior server/scripts/ path was excluded from the
  tsconfig include glob, so the script never reached the container).
- Default to dry-run; require explicit --apply to write. Cheap insurance
  against an operator running it wired to the wrong DATABASE_URL.
- Add a personal-org test pinning that brand-identity auto-populate is
  intentionally not gated on is_personal. (Brand identity ≠ org-membership
  inference; the squeeze-prevention concern lives in the latter.)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bokelley bokelley force-pushed the bokelley/backfill-script-prod-runnable branch from b1b5491 to 562e38b Compare May 6, 2026 16:27
@bokelley bokelley merged commit e6911f2 into main May 6, 2026
13 checks passed
@bokelley bokelley deleted the bokelley/backfill-script-prod-runnable branch May 6, 2026 16:30
bokelley added a commit that referenced this pull request May 6, 2026
Other prod-runnable scripts in server/src/scripts/ call
initializeDatabase(getDatabaseConfig()) before getPool(); this one was
missing it and crashed on first run. Closes the loop on PR #4161.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bokelley added a commit that referenced this pull request May 6, 2026
…in (#4163)

Other prod-runnable scripts in server/src/scripts/ call
initializeDatabase(getDatabaseConfig()) before getPool(); this one was
missing it and crashed on first run. Closes the loop on PR #4161.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant