From 50a685ab7613d85c8fd1aec36533b12ea441daf2 Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Mon, 18 Mar 2024 11:26:39 -0400 Subject: [PATCH] DOP-4414 testing jobupdates queue --- api/controllers/v2/github.ts | 6 +++--- cdk-infra/lib/constructs/api/webhook-api-construct.ts | 1 + src/repositories/docsetsRepository.ts | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/controllers/v2/github.ts b/api/controllers/v2/github.ts index fc43e0d3b..2156c6234 100644 --- a/api/controllers/v2/github.ts +++ b/api/controllers/v2/github.ts @@ -120,6 +120,7 @@ export const triggerSmokeTestAutomatedBuild = async (event: APIGatewayEvent): Pr //add docs_metadata to config const projectsRepository = new ProjectsRepository(client.db('docs_metadata'), c, consoleLogger); const repoBranchesRepository = new RepoBranchesRepository(db, c, consoleLogger); + const docsetsRepository = new DocsetsRepository(db, c, consoleLogger); if (!event.body) { const err = 'Trigger build does not have a body in event payload'; @@ -196,8 +197,6 @@ export const triggerSmokeTestAutomatedBuild = async (event: APIGatewayEvent): Pr const repoName = SMOKETEST_SITES[s]; const jobTitle = 'Smoke Test ' + repoName; let repoInfo, projectEntry, repoOwner; - const docsetsRepository = new DocsetsRepository(db, c, consoleLogger); - // if (repoName == 'docs') return docsetsRepository.getRepo(repoName); try { repoInfo = await docsetsRepository.getRepo(repoName); @@ -215,7 +214,8 @@ export const triggerSmokeTestAutomatedBuild = async (event: APIGatewayEvent): Pr } const jobPrefix = repoInfo?.prefix ? repoInfo['prefix'][env] : ''; - //add commit hash to jobPrefix here? + + //add commit hash here //const newHead = body.workflow_run.head_sha; const payload = await createPayload(repoName, true, jobPrefix, repoBranchesRepository, repoInfo, '', repoOwner); diff --git a/cdk-infra/lib/constructs/api/webhook-api-construct.ts b/cdk-infra/lib/constructs/api/webhook-api-construct.ts index ee9469a6c..10862f6b8 100644 --- a/cdk-infra/lib/constructs/api/webhook-api-construct.ts +++ b/cdk-infra/lib/constructs/api/webhook-api-construct.ts @@ -196,6 +196,7 @@ export class WebhookApiConstruct extends Construct { // grant permission for lambdas to enqueue messages to the job updates queue jobUpdatesQueue.grantSendMessages(slackTriggerLambda); + jobUpdatesQueue.grantSendMessages(githubSmokeTestBuildLambda); jobUpdatesQueue.grantSendMessages(githubTriggerLambda); jobUpdatesQueue.grantSendMessages(triggerLocalBuildLambda); diff --git a/src/repositories/docsetsRepository.ts b/src/repositories/docsetsRepository.ts index c483bfe89..9a04c1740 100644 --- a/src/repositories/docsetsRepository.ts +++ b/src/repositories/docsetsRepository.ts @@ -78,7 +78,6 @@ export class DocsetsRepository extends BaseRepository { directory ? `with directory: /${directory}` : '' }`; this._logger.info(this._repoName, msg); - return this._repoName; } return res?.[0]; }