diff --git a/api/controllers/v2/github.ts b/api/controllers/v2/github.ts index 7c479ac29..db4880496 100644 --- a/api/controllers/v2/github.ts +++ b/api/controllers/v2/github.ts @@ -119,7 +119,7 @@ export const triggerSmokeTestAutomatedBuild = async (event: APIGatewayEvent): Pr const db = client.db(c.get('dbName')); const consoleLogger = new ConsoleLogger(); const jobRepository = new JobRepository(db, c, consoleLogger); - const projectsRepository = new ProjectsRepository(client.db('docs_metadata'), c, consoleLogger); + const projectsRepository = new ProjectsRepository(client.db(process.env.METADATA_DB_NAME), c, consoleLogger); const repoBranchesRepository = new RepoBranchesRepository(db, c, consoleLogger); const docsetsRepository = new DocsetsRepository(db, c, consoleLogger); diff --git a/infrastructure/ecs-main/ecs_service.yml b/infrastructure/ecs-main/ecs_service.yml index 2fdad6e1d..1bb6a5333 100644 --- a/infrastructure/ecs-main/ecs_service.yml +++ b/infrastructure/ecs-main/ecs_service.yml @@ -50,6 +50,8 @@ Resources: Value: ${self:custom.repoBranchesCollection} - Name: DOCSETS_COL_NAME Value: ${self:custom.docsetsCollection} + - Name: PROJECTS_COL_NAME + Value: ${self:custom.projectsCollection} - Name: NPM_BASE_64_AUTH Value: ${self:custom.npmBase64Auth} - Name: NPM_EMAIL diff --git a/serverless.yml b/serverless.yml index 66a398034..3299feee3 100644 --- a/serverless.yml +++ b/serverless.yml @@ -57,6 +57,7 @@ custom: entitlementCollection: ${ssm:/env/${self:provider.stage}/docs/worker_pool/atlas/collections/user/entitlements} repoBranchesCollection: ${ssm:/env/${self:provider.stage}/docs/worker_pool/atlas/collections/repo} docsetsCollection: ${ssm:/env/${self:provider.stage}/docs/worker_pool/atlas/collections/docsets} + projectsCollection: ${ssm:/env/${self:provider.stage}/docs/worker_pool/atlas/collections/projects} githubSecret: ${ssm:/env/${self:provider.stage}/docs/worker_pool/github/webhook/secret} githubDeletionSecret: ${ssm:/env/${self:provider.stage}/docs/worker_pool/github/webhook/deletionSecret} githubBotPW: ${ssm:/env/${self:provider.stage}/docs/worker_pool/github/bot/password} @@ -110,6 +111,7 @@ webhook-env-core: &webhook-env-core GITHUB_BOT_PASSWORD: ${self:custom.githubBotPW} REPO_BRANCHES_COL_NAME: ${self:custom.repoBranchesCollection} DOCSETS_COL_NAME: ${self:custom.docsetsCollection} + PROJECTS_COL_NAME: ${self:custom.projectsCollection} SLACK_SECRET: ${self:custom.slackSecret} SLACK_TOKEN: ${self:custom.slackAuthToken} SNOOTY_SECRET: ${self:custom.snootySecret} diff --git a/src/repositories/projectsRepository.ts b/src/repositories/projectsRepository.ts index ea5085549..f51912835 100644 --- a/src/repositories/projectsRepository.ts +++ b/src/repositories/projectsRepository.ts @@ -5,7 +5,7 @@ import { ILogger } from '../services/logger'; //Project information from docs_metadata.projects for parser builds. -const projectsCollectionName = process.env.PROJECTS_COL_NAME || 'projects'; +const projectsCollectionName = process.env.PROJECTS_COL_NAME || ''; export class ProjectsRepository extends BaseRepository { constructor(db: mongodb.Db, config: IConfig, logger: ILogger) {