Repository navigation
#2199 を実装する(スプリント lfactory3-6) - #2533
Merged
Merged
Conversation
…er の配線だけにする(#2199 の R20・R02) - requireEnv の 5 つの写しを src/env.ts へ寄せる - createApiApp・jsonLogger・webOriginFromEnv を app.ts、depsFromEnv を auth/deps.ts、 progressStoreFromEnv を progress/deps.ts へ移し、index.ts・runs/deps.ts・handlers/ どうしが handlers/ を読まない形にする - テストは createApiApp の import 元だけを替える(期待値は変えない) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…9・R10・R11・R17・R18・R19) - AccountStore・AccountPatch・ConditionFailedError と新しい AccountUpdate を accounts/port.ts へ移す - updateAccount の 5 つの位置引数を AccountUpdate 1 つにする - DynamoAccountStore.transact が履歴を受け取り、items → 履歴 → after の順に並べる - AccountPatch の列を PATCH_COLUMNS の表で回す(プレースホルダは :plan・:mode のまま) - 鍵の頭を USER_PREFIX・ACCOUNT_PREFIX と userPk・accountPk にまとめる - AccountService の 4 つの再試行を retryOnConflict、3 つの条件の失敗の読み替えを writeOr にし、hist を消す - store.test.ts は import 元と updateAccount の呼び出しの形だけを替える(期待値は変えない) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…13・R03・R12) - validateSeatType を accounts/service.ts に置き、teams.ts と accounts.ts の 3 つの経路が使う(文言は同じ) - 「チームなら席を読んで詳細の本文を作る」を views.ts の accountDetailBody にし、3 つの経路が使う - github-oidc/app.ts の /token と /userinfo が githubUser を使う(判定の条件は同じ) - auth/verify.ts の IdP の判定を idpFromUsername に出す(判定の順序は同じ) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- RequireLogin(context.tsx)で App.tsx のログインの後の枠を包み、12 画面の hasToken と /login への転送を消す - usePolled の enabled の引数を消す(呼ぶ画面はすべて token の有無を渡していただけ) - 「呼んで、失敗なら画面の文を出す」を useAttempt(context.tsx)にし、判定表の対象の try/catch を置き換える - 席の種類の <option> を SeatTypeOptions(parts.tsx)にし、TeamPage と NewTeamPage が使う Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…の R16) 11 のテストに写っていた読み込みの 4 行を関数スコープの fixture check_module にする。 テストの関数の数と、確かめる入力・期待値の組は変えない(46 passed のまま)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
takemi-ohama
marked this pull request as ready for review
November 5, 2026 02:41
This was referenced Nov 5, 2026
Merged
Merged
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.
factory の API と画面で、同じ役割の処理を 1 か所へ寄せるリファクタリングです(#2199)。API ではアカウントの保存の契約を独立したファイルへ分け、画面ではログインの確認・失敗の表示・席の種類の選択肢を共通の部品にしました。動作は変えていません。
利用者向けの変化
移行の手順
変更の要点
env.tsの 1 つにまとめた。handlers/には、ハンドラーの配線だけを置くport.tsに分け、重複していた書き込みの処理を寄せた。DynamoDB のキーと属性の形は変えていないfactory/web/src/pages/parts.tsx・factory/web/src/poll.ts)にまとめ、各ページはそれを呼ぶ形にしたscripts/tests/test_check_markdown_links.pyで、スクリプトの読み込みを fixture にまとめた変更は 41 ファイルで、654 行の追加と 702 行の削除です。
テスト
issues/issue-2199-design.mdに名前の出るテストのうち、4 件が HEAD で照合に失敗して止まったstore.test.tsの既存テストが通ることで確かめるとしている設計と違う点
factory/api/src/handlers/api.tsとしている。実装ではhandlers/api.tsは Lambda の handler の配線だけを持ち、Hono のアプリはfactory/api/src/app.ts、認証の依存の組み立てはfactory/api/src/auth/deps.tsにある。この PR では表を直していないfactory/の外の差分はscripts/tests/test_check_markdown_links.pyだけ)に従い、#2199 の確定仕様化(plan-to-spec)でapp.tsの行とともに直すfactory/api/src/accounts/store.tsの 1 行だけで示している。実装では保存の契約(AccountStore・AccountPatch・AccountUpdate・ConditionFailedError)がfactory/api/src/accounts/port.tsへ移り、store.tsは DynamoDB の実装だけを持つ。この PR では表を直していないaccounts/port.tsの行を足す提案 20 件の扱い(受け入れ条件 1)
設計文書(コミット 7bcb889 の
issues/issue-2199-design.mdの「20 件の判定表」)の扱いどおりに実装した。適用した 19 件の置き場は、本番のタグndf--v10.27.21で名前が実在することを確かめた。テストが落ちて戻した件は無い。accounts/service.tsのvalidateSeatTypehandlers/は配線だけ。createApiAppはapp.tsgithub-oidc/app.tsのgithubUseraccounts/store.tsのtransactに履歴の行の展開を寄せた(R09 と同じ)pages/parts.tsxのSeatTypeOptionsaccounts/service.tsのretryOnConflictaccounts/port.tsaccounts/store.tsのPATCH_COLUMNSaccounts/service.tsのwriteOrauth/verify.tsのidpFromUsernameroutes/views.tsのaccountDetailBodyRequireLoginuseAttemptscripts/tests/test_check_markdown_links.pyの fixturehistを消しHistoryRecordで書くAccountUpdateaccounts/store.tsのuserPkと鍵の頭の定数factory/api/src/env.tsのrequireEnv適用 19 件・採らない 1 件。この節はマージの後、リリース後テスト(#2548 (comment) )の指摘で足した。
モード: standard / 通した工程: 実装 → 完了判定 → Pull Request
🤖 Generated with Claude Code