Verwaiste Repo-Platzhalter blockieren keine Zuordnung mehr
Ein in Gitea geloeschtes Org-Repo liess sein unverknuepftes Projekt-Dokument liegen. Der Unique-Index auf repoFullName ignoriert Gross-/Kleinschreibung, darum scheiterte beim Zuweisen eines gleich benannten neuen Repos das Umbenennen des Projekts; alle Pushes landeten im Platzhalter ohne Ticket, also ohne Arbeitsblatt und ohne Push-Zeitmail (WEBklar/Schmacko-napf). - repoMove: vor dem Umbenennen ein unverknuepftes fremdes Dokument mit dem Zielnamen entfernen (verknuepfte bleiben unangetastet) - Webhook repository/deleted: unverknuepfte Platzhalter des geloeschten Repos entfernen, nur wenn Gitea das Repo wirklich nicht mehr kennt Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a64a996291
commit
6718018211
5 files changed
+132
-7
No files matched your search
@@ -37,7 +37,11 @@ before(async () => {
|
||||
gitea = await startFakeGitea({ repos: [] })
|
||||
aw = await startFakeAppwrite({
|
||||
seed: {
|
||||
websiteProjects: [],
|
||||
websiteProjects: [
|
||||
{ $id: 'waise', repoFullName: 'WEBklar/schmacko-napf', projectName: 'schmacko-napf', ticketId: '', customerId: '' },
|
||||
{ $id: 'verknuepft', repoFullName: 'WEBklar/mit-ticket', projectName: 'mit-ticket', ticketId: 't-9' },
|
||||
{ $id: 'lebt', repoFullName: 'WEBklar/lebt-noch', projectName: 'lebt-noch' },
|
||||
],
|
||||
employees: [{ $id: 'k', displayName: 'Kenso Grimm', shortcode: 'KNSO', email: 'kenso@webklar.com' }],
|
||||
},
|
||||
})
|
||||
@@ -173,3 +177,19 @@ test('Job: Appwrite-Fehler bricht den Lauf ab, ohne zu werfen', async () => {
|
||||
} finally { console.error = silent }
|
||||
assert.ok(awUrl)
|
||||
})
|
||||
|
||||
test('repository/deleted entfernt das unverknuepfte Platzhalter-Dokument, verknuepfte und lebende bleiben', async () => {
|
||||
gitea.addRepo({ full_name: 'WEBklar/lebt-noch' })
|
||||
const del = (full) => hook('repository', { ...created(full), action: 'deleted', sender: { login: 'ANDJ' } })
|
||||
|
||||
const r = await del('WEBklar/schmacko-napf')
|
||||
assert.equal(r.status, 200)
|
||||
assert.equal(r.body.removed, 1)
|
||||
assert.equal(aw.get('websiteProjects', 'waise'), undefined)
|
||||
|
||||
assert.equal((await del('WEBklar/mit-ticket')).body.removed, 0)
|
||||
assert.ok(aw.get('websiteProjects', 'verknuepft'))
|
||||
|
||||
assert.equal((await del('WEBklar/lebt-noch')).body.removed, 0)
|
||||
assert.ok(aw.get('websiteProjects', 'lebt'))
|
||||
})
|
||||
Reference in new issue
Block a user