Repository navigation
ποΈ Load subjects in the setup Job on every deploy - #564
Merged
Merged
Conversation
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>
kirkkwang
approved these changes
Nov 5, 2026
2 tasks
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.
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 untilSubjectImporter.importwas run by hand (#551). The setup Job now loads them after migrations on every deploy.Worth arguing with
find_or_create_by, so it only adds subjects newly listed inconfig/subjects.yamland 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