Commit 4e18e33
feat(repo-ui): broken repository recovery (#283 PR 5/7)
UX 哲学: 通常時は repository 一覧/詳細に installation 名を出さない (PR 4 の Vercel 哲学を継承)。canonical installation を失って `github_installation_id IS NULL` になった broken state の repository だけを救済導線として可視化する。
repositories list (settings/repositories):
- github_app モードかつ github_installation_id IS NULL の repository に "Needs reconnection" バッジ + tooltip
- 1-click "Reassign" ボタンで canonical reassignment helper を再実行
- 候補 1 件 → 自動 reassign + バッジ消失 (success toast)
- 候補 0 件 → "Reinstall the GitHub App and try again" (error toast)
- 候補 2+ 件 → "Disconnect unwanted installations to resolve" (error toast)
- loader が getIntegration().method を返し、columns が github_app モードのみバッジを出す
mutation (app/services/github-app-membership.server.ts):
- reassignBrokenRepository(orgId, repositoryId, source) helper を追加
- canonical reassignment helper と同じ eligibility ルール
- 結果を { reassigned | no_candidates | ambiguous | not_broken } の discriminated union で返す
- tenant first / shared second + audit log
route mutation wrapper (settings/repositories._index/mutations.server.ts):
- reassignBrokenRepositoryFromUI() で source='manual_reassign' を固定して呼ぶ
batch CLI (batch/commands/reassign-broken-repositories.ts):
- batch/cli.ts に `reassign-broken-repositories <orgId> [--repository <id>]` コマンド追加
- 全 broken repo を順次救済、結果を集計表示
- source='cli_repair'
tests (github-app-membership.server.test.ts):
- reassignBrokenRepository の 6 ケース追加 (1/0/2+ 候補, not_broken, suspended/uninitialized link 除外)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent ad26a55 commit 4e18e33
File tree
7 files changed
+554
-39
lines changed- app
- libs
- routes/$orgSlug/settings/repositories._index
- +components
- services
- batch
- commands
7 files changed
+554
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
Lines changed: 55 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
| 16 | + | |
13 | 17 | | |
| 18 | + | |
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
19 | 58 | | |
20 | 59 | | |
21 | 60 | | |
| |||
56 | 95 | | |
57 | 96 | | |
58 | 97 | | |
| 98 | + | |
59 | 99 | | |
60 | 100 | | |
61 | 101 | | |
| |||
86 | 126 | | |
87 | 127 | | |
88 | 128 | | |
89 | | - | |
| 129 | + | |
90 | 130 | | |
91 | 131 | | |
92 | 132 | | |
| 133 | + | |
93 | 134 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
103 | 147 | | |
104 | 148 | | |
105 | 149 | | |
| |||
Lines changed: 78 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
54 | 61 | | |
55 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
56 | 68 | | |
57 | 69 | | |
58 | 70 | | |
59 | 71 | | |
60 | 72 | | |
61 | 73 | | |
62 | 74 | | |
| 75 | + | |
63 | 76 | | |
64 | 77 | | |
65 | 78 | | |
| |||
80 | 93 | | |
81 | 94 | | |
82 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
83 | 101 | | |
84 | 102 | | |
85 | 103 | | |
| 104 | + | |
86 | 105 | | |
87 | 106 | | |
88 | 107 | | |
| |||
132 | 151 | | |
133 | 152 | | |
134 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
135 | 198 | | |
136 | 199 | | |
137 | 200 | | |
| |||
142 | 205 | | |
143 | 206 | | |
144 | 207 | | |
| 208 | + | |
145 | 209 | | |
146 | 210 | | |
147 | 211 | | |
148 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
149 | 216 | | |
150 | 217 | | |
151 | 218 | | |
| |||
0 commit comments