mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-30 11:49:42 +02:00
UBERF-11392: Fixes to statistics (#9138)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user