mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-31 12:19:47 +02:00
uberf-7927: get rid of product id (#6375)
This commit is contained in:
@@ -17,7 +17,6 @@ import config from './config'
|
||||
*/
|
||||
export async function createPlatformClient (
|
||||
workspace: string,
|
||||
productId: string,
|
||||
timeout: number,
|
||||
reconnect?: (event: ClientConnectEvent) => void
|
||||
): Promise<Client> {
|
||||
@@ -33,8 +32,7 @@ export async function createPlatformClient (
|
||||
const token = generateToken(
|
||||
config.SystemEmail,
|
||||
{
|
||||
name: workspace,
|
||||
productId
|
||||
name: workspace
|
||||
},
|
||||
{ mode: 'github' }
|
||||
)
|
||||
|
||||
@@ -26,8 +26,6 @@ interface Config {
|
||||
|
||||
CollaboratorURL: string
|
||||
|
||||
ProductID: string
|
||||
|
||||
BotName: string
|
||||
|
||||
SentryDSN: string
|
||||
@@ -56,8 +54,6 @@ const envMap: { [key in keyof Config]: string } = {
|
||||
|
||||
CollaboratorURL: 'COLLABORATOR_URL',
|
||||
|
||||
ProductID: 'PRODUCT_ID',
|
||||
|
||||
SentryDSN: 'SENTRY_DSN',
|
||||
BrandingPath: 'BRANDING_PATH'
|
||||
}
|
||||
@@ -78,7 +74,6 @@ const required: Array<keyof Config> = [
|
||||
|
||||
'CollaboratorURL',
|
||||
|
||||
'ProductID',
|
||||
'BotName'
|
||||
]
|
||||
|
||||
@@ -106,8 +101,6 @@ const config: Config = (() => {
|
||||
|
||||
CollaboratorURL: process.env[envMap.CollaboratorURL],
|
||||
|
||||
ProductID: process.env[envMap.ProductID] ?? '',
|
||||
|
||||
SentryDSN: process.env[envMap.SentryDSN],
|
||||
BrandingPath: process.env[envMap.BrandingPath] ?? ''
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ export class PlatformWorker {
|
||||
} else {
|
||||
let client: Client | undefined
|
||||
try {
|
||||
client = await createPlatformClient(oldWorkspace, config.ProductID, 30000)
|
||||
client = await createPlatformClient(oldWorkspace, 30000)
|
||||
await this.removeInstallationFromWorkspace(oldWorker, installationId)
|
||||
await client.close()
|
||||
} catch (err: any) {
|
||||
@@ -290,7 +290,7 @@ export class PlatformWorker {
|
||||
} else {
|
||||
let client: Client | undefined
|
||||
try {
|
||||
client = await createPlatformClient(workspace, config.ProductID, 30000)
|
||||
client = await createPlatformClient(workspace, 30000)
|
||||
await GithubWorker.checkIntegrations(client, this.installations)
|
||||
await client.close()
|
||||
} catch (err: any) {
|
||||
@@ -388,7 +388,7 @@ export class PlatformWorker {
|
||||
platformClient = this.clients.get(payload.workspace)?.client
|
||||
if (platformClient === undefined) {
|
||||
shouldClose = true
|
||||
platformClient = await createPlatformClient(payload.workspace, config.ProductID, 30000)
|
||||
platformClient = await createPlatformClient(payload.workspace, 30000)
|
||||
}
|
||||
const client = new TxOperations(platformClient, payload.accountId)
|
||||
|
||||
@@ -657,8 +657,7 @@ export class PlatformWorker {
|
||||
const token = generateToken(
|
||||
config.SystemEmail,
|
||||
{
|
||||
name: workspace,
|
||||
productId: config.ProductID
|
||||
name: workspace
|
||||
},
|
||||
{ mode: 'github' }
|
||||
)
|
||||
@@ -697,7 +696,6 @@ export class PlatformWorker {
|
||||
this.installations,
|
||||
{
|
||||
name: workspace,
|
||||
productId: config.ProductID,
|
||||
workspaceUrl: workspaceInfo.workspace,
|
||||
workspaceName: workspace
|
||||
},
|
||||
|
||||
@@ -50,7 +50,6 @@ export const githubDerivedSyncVersion = 'v1'
|
||||
export interface Workspace {
|
||||
_id: string
|
||||
workspace: string
|
||||
productId: string
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1488,7 +1488,7 @@ export class GithubWorker implements IntegrationManager {
|
||||
ctx.info('Connecting to', { workspace: workspace.workspaceUrl, workspaceId: workspace.workspaceName })
|
||||
let client: Client | undefined
|
||||
try {
|
||||
client = await createPlatformClient(workspace.name, workspace.productId, 30000, (event: ClientConnectEvent) => {
|
||||
client = await createPlatformClient(workspace.name, 30000, (event: ClientConnectEvent) => {
|
||||
reconnect(workspace.name, event)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user