Commit d694641
feat(backend): add PermissionSyncSource to AccountToRepoPermission
- Adds `PermissionSyncSource` enum (`ACCOUNT_DRIVEN` / `REPO_DRIVEN`) and `source` field to `AccountToRepoPermission` table (non-nullable, defaults to `ACCOUNT_DRIVEN`)
- Both syncers now set `source` on all created permission records
- Repo-driven syncer uses `isPartialSync` flag (true for Bitbucket Cloud) to only delete `REPO_DRIVEN` records on cleanup, preserving `ACCOUNT_DRIVEN` records from the account syncer
- Adds `skipDuplicates: true` to repo-driven `createMany` to handle overlap between the two sync paths
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent adceff1 commit d694641
File tree
4 files changed
+44
-8
lines changed- packages
- backend/src/ee
- db/prisma
- migrations/20260224202008_add_source_field_to_account_to_repo_permission_table
4 files changed
+44
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| 312 | + | |
312 | 313 | | |
313 | 314 | | |
314 | 315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
188 | 194 | | |
189 | 195 | | |
190 | 196 | | |
| |||
213 | 219 | | |
214 | 220 | | |
215 | 221 | | |
216 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
217 | 225 | | |
218 | 226 | | |
219 | 227 | | |
| |||
237 | 245 | | |
238 | 246 | | |
239 | 247 | | |
240 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
241 | 251 | | |
242 | 252 | | |
243 | 253 | | |
| |||
273 | 283 | | |
274 | 284 | | |
275 | 285 | | |
276 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
277 | 292 | | |
278 | 293 | | |
279 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
280 | 297 | | |
281 | 298 | | |
282 | 299 | | |
| |||
286 | 303 | | |
287 | 304 | | |
288 | 305 | | |
289 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
290 | 311 | | |
291 | 312 | | |
292 | 313 | | |
293 | 314 | | |
294 | 315 | | |
295 | 316 | | |
296 | 317 | | |
| 318 | + | |
297 | 319 | | |
| 320 | + | |
298 | 321 | | |
299 | 322 | | |
300 | 323 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
393 | 398 | | |
394 | 399 | | |
395 | 400 | | |
| |||
399 | 404 | | |
400 | 405 | | |
401 | 406 | | |
| 407 | + | |
| 408 | + | |
402 | 409 | | |
403 | 410 | | |
404 | 411 | | |
| |||
0 commit comments