Skip to content

πŸ—ƒοΈ Load subjects in the setup Job on every deploy - #564

Merged
ShanaLMoore merged 1 commit into
mainfrom
i556-load-subjects-on-deploy
Nov 5, 2026
Merged

ShanaLMoore merged 1 commit into
mainfrom
i556-load-subjects-on-deploy

Conversation

@ShanaLMoore

Copy link
Copy Markdown
Contributor

Closes #556

Why

viva-production launched with 0 subjects: they only came from db:seed, which aborts in production, so every upload would have failed until SubjectImporter.import was run by hand (#551). The setup Job now loads them after migrations on every deploy.

Worth arguing with

  • Runs on every deploy, not just the first: the importer uses find_or_create_by, so it only adds subjects newly listed in config/subjects.yaml and never removes any.

Testing

rails runner 'SubjectImporter.import' locally (14 subjects, rerun is a no-op). Parsed the Job template: the command is ... db:migrate assets:precompile && bundle exec rails runner 'SubjectImporter.import' && echo SETUP COMPLETE. Confirm on the next friends deploy that the setup Job completes.

πŸ€– Generated with Claude Code

viva-production launched with no subjects: they only came from db:seed,
which aborts in production, so every CSV upload would have failed until
SubjectImporter.import was run by hand. The importer only creates
missing subjects, so running it on each deploy is safe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ShanaLMoore ShanaLMoore added Bug πŸ› Something isn't working Backend VIVA labels Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Test Results

139 tests  Β±0   139 βœ… Β±0   0s ⏱️ Β±0s
  1 suites Β±0     0 πŸ’€ Β±0 
  1 files   Β±0     0 ❌ Β±0 

Results for commit 307925d. ± Comparison against base commit bdcfdad.

@ShanaLMoore
ShanaLMoore merged commit 480ffae into main Nov 5, 2026
10 checks passed
@ShanaLMoore
ShanaLMoore deleted the i556-load-subjects-on-deploy branch November 5, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backend Bug πŸ› Something isn't working VIVA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Load subjects in the setup Job on every deploy

2 participants