fix(member-profile): make backfill script prod-runnable + dry-run default#4161
Merged
fix(member-profile): make backfill script prod-runnable + dry-run default#4161
Conversation
…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>
b1b5491 to
562e38b
Compare
3 tasks
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>
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.
Summary
Three small fixes to the backfill script from #4157:
server/src/scripts/— the priorserver/scripts/path was excluded fromserver/tsconfig.json's include glob, so the script never compiled intodist/and was unreachable on prod. Confirmed viafly ssh(gotERR_MODULE_NOT_FOUND). All other prod-runnable backfills live underserver/src/scripts/.--applyto write). Security review nit; cheap insurance against operator wiring to the wrong DATABASE_URL.is_personal. Code review nit; future change that addsif (isPersonal) returnwill fail this test and have to revisit the rationale.Test plan
dist/scripts/backfill-primary-brand-domain.json prod; run viafly ssh console -a adcp-docs -C 'node /app/dist/scripts/backfill-primary-brand-domain.js'for dry-run, then--applyto write.🤖 Generated with Claude Code