Fix CI D1 migration timing issues for Email and OTP Login E2E tests
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 22/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- github-actions, sql, typescript
調査の方向性
Start with the CI workflow that creates the D1 database, runs 020_add_email_plugin.sql and 026_add_otp_login.sql, and deploys the preview, then compare it with the plugin-card lookup the tests depend on. Next, look at tests/e2e/29-email-plugin-settings.spec.ts and tests/e2e/44-otp-login-admin.spec.ts for the test.describe.skip markers. Done means the root cause is recorded, both suites run without the skip, and they pass across repeated CI runs.
索引モデルが issue の本文から書いたものです。
説明
Summary
Two E2E test suites are currently skipped due to D1 migration timing/propagation issues in CI:
tests/e2e/29-email-plugin-settings.spec.tstests/e2e/44-otp-login-admin.spec.ts
These tests pass locally but fail in CI even after migrations execute successfully.
Background
These tests were skipped in PR #581 to unblock the merge of the component-based plugin settings architecture feature. The tests verify:
-
Email Plugin Settings (
29-email-plugin-settings.spec.ts)- Navigation to email plugin settings from plugins page
- Display of email settings form with all fields (API key, from email, from name, etc.)
- Save settings functionality
- Required field validation
- Test email section display
-
OTP Login Admin (
44-otp-login-admin.spec.ts)- OTP Login plugin settings page loading
- Test email form display
- Email preview section display
- Code settings form display
- Quick links to related settings
- Email configuration status
- Features list display
- Save settings button
- Send test code functionality
Root Cause Investigation
The CI workflow:
- Creates a fresh D1 database for each PR
- Runs migrations (020_add_email_plugin.sql, 026_add_otp_login.sql)
- Deploys to Cloudflare Workers preview
- Runs E2E tests
Migrations execute successfully (confirmed by ✅ markers in CI logs), but the Email plugin card is not visible when tests run. This suggests a timing/propagation delay between:
- D1 migration completion
- Data being available to the Worker
Potential Solutions to Investigate
- Add delay after migrations - Wait for D1 propagation before running tests
- Verify data availability - Add a health check endpoint that confirms plugin data exists
- D1 eventual consistency - Research if D1 has eventual consistency behavior and workarounds
- Worker restart - Check if Worker needs restart/redeploy after migrations
- Database binding timing - Investigate if database bindings need time to propagate
Acceptance Criteria
- Identify root cause of D1 propagation delay
- Implement fix in CI workflow or application code
- Re-enable skipped tests by removing
test.describe.skip - Verify tests pass consistently in CI (run multiple times)
Related
- PR #581 - Original PR where tests were skipped
- Migrations:
020_add_email_plugin.sql,026_add_otp_login.sql
🤖 Generated with Claude Code
- 主要言語
- TypeScript
- スター
- 1.8k
- フォーク
- 219
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 67
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SonicJs-Org/sonicjs のほかの issue
-
bug(admin/users): server error returns bare alert HTML causing black-shape visual artifact対応中かも @lane711 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
SonicJs-Org/sonicjs#1211 ·
メンテナーはふだん 1 日以内に返信
-
area: api bug priority: P2
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
SonicJs-Org/sonicjs#1200 ·
メンテナーはふだん 1 日以内に返信
-
ResendProvider cannot send on Workers: unbound `fetch` stored as an instance property throws "Illegal invocation"対応中かも @lane711 が 23 日前に担当しました。 オープンarea: email bug priority: P1
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SonicJs-Org/sonicjs#1099 ·
メンテナーはふだん 1 日以内に返信
-
Email plugin settings are never read: loadDbEmailSettings queries a v2 `plugins` table that does not exist in v3対応中かも @lane711 が 23 日前に担当しました。 オープンarea: email bug priority: P1
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
SonicJs-Org/sonicjs#1098 ·
メンテナーはふだん 1 日以内に返信
-
area: documentation bug documentation priority: P2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SonicJs-Org/sonicjs#1012 ·
メンテナーはふだん 1 日以内に返信
SonicJs-Org/sonicjs の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
liberation-data/drivine#826 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
zhitongblog/solomd#623 ·
メンテナーはふだん 1 日以内に返信
-
aufwand: klein documentation Einsteiger-Familie freigegeben Haushalts-Admin
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
enhancement frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
openwallet-foundation/eudiplo#1600 ·
-
docs(website): add a GitLab CI/CD button next to the GitHub Action button on the homepage対応中かも @shryssssss-maker が今日担当しました。 オープンdocumentation enhancement first-timers-only good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
OWASP/cve-lite-cli#1739 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信