UBERF-11392: Fixes to statistics (#9138)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2025-05-30 09:58:02 +07:00
committed by GitHub
parent 73f7cfc11b
commit 6f26cf0511
46 changed files with 549 additions and 414 deletions
+24 -17
View File
@@ -282,16 +282,21 @@ export class PlatformWorker {
}
ctx.info('add integration', { workspace, installationId, accountId })
await ctx.with('add integration', { workspace, installationId, accountId }, async (ctx) => {
await accountsClient.createIntegration({
kind: 'github',
workspaceUuid: record.workspace,
socialId: record.accountId,
data: { installationId: record.installationId }
})
await ctx.with(
'add integration',
{},
async (ctx) => {
await accountsClient.createIntegration({
kind: 'github',
workspaceUuid: record.workspace,
socialId: record.accountId,
data: { installationId: record.installationId }
})
this.integrations.push(record)
})
this.integrations.push(record)
},
{ workspace, installationId, accountId }
)
// We need to query installations to be sure we have it, in case event is delayed or not received.
await this.updateInstallation(installationId)
@@ -491,14 +496,16 @@ export class PlatformWorker {
if (!revoke) {
const personSpace = await client.findOne(contact.class.PersonSpace, { person: person._id })
if (personSpace !== undefined && person.personUuid !== undefined) {
await createNotification(client, person, {
user: person.personUuid,
space: personSpace._id,
message: github.string.AuthenticatedWithGithub,
props: {
login: update.login
}
})
if (update.login != null) {
await createNotification(client, person, {
user: person.personUuid,
space: personSpace._id,
message: github.string.AuthenticatedWithGithub,
props: {
login: update.login
}
})
}
}
if (dta?._id !== undefined) {
@@ -887,7 +887,7 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan
try {
const response: any = await this.ctx.with(
'graphql.listIssue',
{ prj: prj.name, repo: repo.name },
{},
() =>
integration.octokit.graphql(
`query listIssues {
+6 -4
View File
@@ -1557,7 +1557,7 @@ export class GithubWorker implements IntegrationManager {
}
await this.ctx.withLog(
'external sync',
{ installation: integration.installationName, workspace: this.workspace.uuid },
{},
async () => {
const enabled = integration.enabled && integration.octokit !== undefined
@@ -1652,13 +1652,15 @@ export class GithubWorker implements IntegrationManager {
}
await this.ctx.withLog(
'external sync',
{ _class: _class.join(', '), workspace: this.workspace.uuid },
{ _class: _class.join(', ') },
async () => {
await mapper.externalFullSync(integration, derivedClient, _projects, _repositories)
}
},
{ installation: integration.installationName, workspace: this.workspace.uuid }
)
}
}
},
{ installation: integration.installationName, workspace: this.workspace.uuid }
)
}
}