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
+7 -16
View File
@@ -86,18 +86,9 @@ export async function start (ctx: MeasureContext, brandingMap: BrandingMap): Pro
body: req.body
})
ctx.info('map-installation', {
workspace: decodedToken.workspace.name,
installationid: payloadData.installationId
})
await ctx.withLog('map-installation', {}, async (ctx) => {
await worker.mapInstallation(
ctx,
decodedToken.workspace.name,
payloadData.installationId,
payloadData.accountId
)
})
await ctx.with('map-installation', {}, (ctx) =>
worker.mapInstallation(ctx, decodedToken.workspace.name, payloadData.installationId, payloadData.accountId)
)
res.status(200)
res.json({})
} catch (err: any) {
@@ -136,7 +127,7 @@ export async function start (ctx: MeasureContext, brandingMap: BrandingMap): Pro
code: payloadData.code,
state: payloadData.state
})
await ctx.withLog('request-github-access-token', {}, async (ctx) => {
await ctx.with('request-github-access-token', {}, async (ctx) => {
await worker.requestGithubAccessToken({
workspace: decodedToken.workspace.name,
accountId: payloadData.accountId,
@@ -172,9 +163,9 @@ export async function start (ctx: MeasureContext, brandingMap: BrandingMap): Pro
workspace: decodedToken.workspace.name,
installationId: payloadData.installationId
})
await ctx.withLog('remove-installation', {}, async (ctx) => {
await worker.removeInstallation(ctx, decodedToken.workspace.name, payloadData.installationId)
})
await ctx.with('remove-installation', {}, (ctx) =>
worker.removeInstallation(ctx, decodedToken.workspace.name, payloadData.installationId)
)
res.status(200)
res.json({})
} catch (err: any) {