UBERF-10471: Fix Github miss status updates and allow to re-integrate existing repos (#8842)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2025-05-06 18:10:02 +05:00
committed by GitHub
parent 4007537b34
commit 58fc4453b4
6 changed files with 99 additions and 19 deletions
+2 -1
View File
@@ -370,12 +370,13 @@ export async function syncDerivedDocuments<T extends { url: string }> (
})
} else {
processed.add(existing._id)
if (!deepEqual(existing.external, r)) {
if (!deepEqual(existing.external, r) || existing.repository !== repo._id) {
// Only update if had changes.
await derivedClient.update(existing, {
external: r,
needSync: '', // We need to check if we had any changes.
derivedVersion: '',
repository: repo._id,
externalVersion: githubExternalSyncVersion,
lastModified: new Date(r.updatedAt ?? r.createdAt).getTime(),
...extra