Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Blocker] Move EF Core migrations out of application startup

オープン
#41 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp

調査の方向性

LearnStack/Program.cs:57-70 から始め、現在の Database.MigrateAsync() の起動パスを追跡します。deployment pipeline が swap の前に dotnet ef migrations bundle --self-contained を実行できる方法と、health endpoint が接続性または保留中の migration を報告する方法を確認します。完了の条件は、起動時にスキーマ変更を行わず、deployment が migration を観測可能な形で適用し、失敗時にアプリをクラッシュさせるのではなく swap をブロックすることです。

索引モデルが issue の本文から書いたものです。

説明

enhancement

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
  1. Generate a migration bundle in CI: dotnet ef migrations bundle --self-contained.
  2. Run the bundle as a deployment step against the target database, before the app is swapped in.
  3. Keep startup read-only — at most a CanConnectAsync check wired into the health endpoint.
  4. 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
主要言語
HTML
スター
10
フォーク
0
平均マージ
2時間 35分
マージ済み PR(30日)
21

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

kasuken/LearnStack のほかの issue

kasuken/LearnStack の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。