UBERF-8053: Github fixes (#6554)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2024-09-13 15:25:17 +05:00
committed by GitHub
parent 227c5cba56
commit 52e930cd07
12 changed files with 166 additions and 121 deletions
+14 -3
View File
@@ -16,15 +16,15 @@ import core, {
Type,
toIdMap
} from '@hcengineering/core'
import { PlatformError, unknownStatus } from '@hcengineering/platform'
import task, { TaskType, calculateStatuses, createState, findStatusAttr } from '@hcengineering/task'
import tracker, { IssueStatus } from '@hcengineering/tracker'
import github, {
DocSyncInfo,
GithubIntegrationRepository,
GithubIssueStateReason,
GithubProject
} from '@hcengineering/github'
import { PlatformError, unknownStatus } from '@hcengineering/platform'
import task, { TaskType, calculateStatuses, createState, findStatusAttr } from '@hcengineering/task'
import tracker, { IssueStatus } from '@hcengineering/tracker'
import { deepEqual } from 'fast-equals'
import { IntegrationManager, githubExternalSyncVersion } from '../types'
import { GithubDataType } from './githubTypes'
@@ -411,3 +411,14 @@ export function compareMarkdown (a: string, b: string): boolean {
return na === nb
}
export async function syncChilds (info: DocSyncInfo, client: TxOperations, derivedClient: TxOperations): Promise<void> {
const childInfos = await client.findAll(github.class.DocSyncInfo, { parent: info.url.toLowerCase() })
if (childInfos.length > 0) {
const ops = derivedClient.apply()
for (const child of childInfos) {
await ops?.update(child, { needSync: '' })
}
await ops.commit()
}
}