[Blocker] Move EF Core migrations out of application startup
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start with LearnStack/Program.cs:57-70 and trace the current Database.MigrateAsync() startup path. Review how the deployment pipeline can run dotnet ef migrations bundle --self-contained before swap and how the health endpoint should report connectivity or pending migrations. Done means startup performs no schema changes, deployment applies migrations observably, and failures block the swap rather than crash the app.
Written by the indexing model from the issue text.
Description
Tier 1 — release blocker
Problem
Database.MigrateAsync() runs on every boot inside Program.cs and rethrows on failure, so a bad migration or a cold/throttled SQL connection takes the whole site down at startup. With more than one instance, migrations race against each other. This has already caused an Azure startup failure (commit 06b8f0a, "fix: add missing user display name migration").
Evidence
LearnStack/Program.cs:57-70
Proposed fix
- Generate a migration bundle in CI:
dotnet ef migrations bundle --self-contained. - Run the bundle as a deployment step against the target database, before the app is swapped in.
- Keep startup read-only — at most a
CanConnectAsynccheck wired into the health endpoint. - Optionally guard with a pending-migration check that fails the health probe rather than the process.
Acceptance criteria
- App startup performs no schema changes
- Deploy pipeline applies migrations as an explicit, observable step
- A failed migration blocks the swap instead of crashing production
- Dominant language
- HTML
- Stars
- 10
- Forks
- 0
- Avg merge
- 2h 35m
- Merged PRs (30d)
- 21
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from kasuken/LearnStack
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 91/100
kasuken/LearnStack#59 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
kasuken/LearnStack#72 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 30/100
kasuken/LearnStack#71 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
kasuken/LearnStack#70 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 45/100
kasuken/LearnStack#69 ·
Maintainers usually reply within 1 day
All issues in kasuken/LearnStack
Similar issues
-
found-by-agent
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
exanauts/SparseDirectSolver.jl#92 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
navikt/esyfo-narmesteleder#654 ·
Maintainers usually reply within 1 day
-
[Bug] remember() with special characters in namespace hangs until timeout instead of returning 400Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
MystenLabs/MemWal#1133 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Effect-TS/effect#8881 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Deltares/imod-python#1928 ·