UBERF-8587: Fix github auth and delete issues (#7174)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2024-11-14 23:30:42 +07:00
committed by GitHub
parent 5ea7ff2667
commit 63294b0c66
10 changed files with 90 additions and 111 deletions
+18 -30
View File
@@ -129,9 +129,7 @@ export class ProjectsSyncManager implements DocSyncManager {
await this.ctx.withLog(
'Create Milestone projectV2',
{},
async () => {
await this.createMilestone(container.container, container.project, okit, milestone, info)
},
() => this.createMilestone(container.container, container.project, okit, milestone, info),
{ label: milestone.label }
)
} catch (err: any) {
@@ -148,17 +146,9 @@ export class ProjectsSyncManager implements DocSyncManager {
let { projectStructure, wasUpdates } = await this.ctx.withLog(
'update project structure',
{},
async () =>
await syncRunner.exec(
m._id,
async () =>
await this.updateFieldMappings(
container.container,
container.project,
m,
container.project.mixinClass,
okit
)
() =>
syncRunner.exec(m._id, () =>
this.updateFieldMappings(container.container, container.project, m, container.project.mixinClass, okit)
),
{ label: milestone.label }
)
@@ -168,7 +158,7 @@ export class ProjectsSyncManager implements DocSyncManager {
projectStructure = (await this.ctx.withLog(
'update project structure(sync/second step)',
{},
async () => await this.queryProjectStructure(container.container, m),
() => this.queryProjectStructure(container.container, m),
{
label: m.label
}
@@ -340,7 +330,7 @@ export class ProjectsSyncManager implements DocSyncManager {
const projectStructure = (await this.ctx.withLog(
'update project structure(handleEvent)',
{ prj: project.name },
async () => await this.queryProjectStructure(integration, project)
() => this.queryProjectStructure(integration, project)
)) as GithubProjectV2
integration.projectStructure.set(project._id, projectStructure)
@@ -423,20 +413,18 @@ export class ProjectsSyncManager implements DocSyncManager {
let { projectStructure, wasUpdates } = await this.ctx.withLog(
'update project structure',
{ prj: prj.name },
async () => await this.updateFieldMappings(integration, prj, prj, prj.mixinClass, okit)
() => this.updateFieldMappings(integration, prj, prj, prj.mixinClass, okit)
)
// Check if we have any changes in project, during our inactivity.
await this.ctx.withLog('check project v2 changes:', { prj: prj.name }, async () => {
await this.checkChanges(projectStructure, prj, prj._id, integration, derivedClient)
})
await this.ctx.withLog('check project v2 changes:', { prj: prj.name }, () =>
this.checkChanges(projectStructure, prj, prj._id, integration, derivedClient)
)
// Retrieve updated field
if (wasUpdates) {
projectStructure = (await this.ctx.withLog(
'update project structure(second pass)',
{ prj: prj.name },
async () => await this.queryProjectStructure(integration, prj)
projectStructure = (await this.ctx.withLog('update project structure(second pass)', { prj: prj.name }, () =>
this.queryProjectStructure(integration, prj)
)) as GithubProjectV2
}
@@ -459,24 +447,24 @@ export class ProjectsSyncManager implements DocSyncManager {
let { projectStructure, wasUpdates } = await this.ctx.withLog(
'update project structure',
{ prj: m.label },
async () =>
await syncRunner.exec(
() =>
syncRunner.exec(
m._id,
async () => await this.updateFieldMappings(integration, prj, m, prj.mixinClass, okit)
)
)
// Check if we have any changes in project, during our inactivity.
await this.ctx.withLog('check project v2 changes', { prj: prj.name }, async () => {
await this.checkChanges(projectStructure, m, prj._id, integration, derivedClient)
})
await this.ctx.withLog('check project v2 changes', { prj: prj.name }, () =>
this.checkChanges(projectStructure, m, prj._id, integration, derivedClient)
)
// Retrieve updated field
if (wasUpdates) {
projectStructure = (await this.ctx.withLog(
'update project structure(second pass)',
{ prj: prj.name },
async () => await this.queryProjectStructure(integration, m)
() => this.queryProjectStructure(integration, m)
)) as GithubProjectV2
}