fix: apply migrations at runtime#195
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates container startup behavior around Prisma schema/application lifecycle, and also introduces a new “Beest” transcript configuration.
Changes:
- Add a new
Beesttranscript and register it in the transcript registry. - Update Docker image build/run steps to run
prisma generateat build time and runprisma db pushat container startup.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
nephthys/transcripts/transcripts/beest.py |
Adds a new transcript definition for the Beest program (channels, FAQ link, canned messages). |
nephthys/transcripts/__init__.py |
Registers the new Beest transcript in the exported transcript list. |
Dockerfile |
Moves Prisma workflow: generate at build; schema push at runtime before starting nephthys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| first_ticket_create: str = f""" | ||
| Heya! I'm an automation that assigns helpers to your question! First off, have you read the <{faq_link}|faq>, it answers a lot of common questions! | ||
| if your question has been answered, please hit the button below to mark it as resolved |
There was a problem hiding this comment.
first_ticket_create's triple-quoted string starts with a leading space before “Heya!” (line begins Heya!). That whitespace will be sent to Slack and may render awkwardly; consider removing the leading space (or using textwrap.dedent) so the message starts flush-left like the other transcripts.
| RUN prisma generate | ||
|
|
||
| CMD ["nephthys"] | ||
| CMD ["bash", "-c", "prisma db push && nephthys"] |
There was a problem hiding this comment.
The PR title mentions applying migrations at runtime, but the runtime command uses prisma db push, which is schema sync (not migrations) and can behave differently than prisma migrate deploy. Either switch to migrations (and run prisma migrate deploy here) or adjust the PR title/description to match what’s actually happening.
| RUN prisma generate | ||
|
|
||
| CMD ["nephthys"] | ||
| CMD ["bash", "-c", "prisma db push && nephthys"] |
There was a problem hiding this comment.
prisma generate is already run at build time, but prisma db push will (by default) run generators again on every container start. Consider adding --skip-generate to the runtime db push to reduce startup time and avoid redundant work.
| CMD ["bash", "-c", "prisma db push && nephthys"] | |
| CMD ["bash", "-c", "prisma db push --skip-generate && nephthys"] |
| from nephthys.transcripts.transcripts.beest import Beest | ||
| from nephthys.transcripts.transcripts.construct import Construct |
There was a problem hiding this comment.
This PR is titled around runtime migrations, but it also adds/introduces the Beest transcript import/registration. If that’s unrelated to the migration/runtime change, consider splitting it into a separate PR to keep the change focused and easier to review/revert.
No description provided.