Skip to content

Commit

Permalink
consolidate env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
mmeigs committed Nov 1, 2023
1 parent 079f0f7 commit d7b84a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 47 deletions.
10 changes: 2 additions & 8 deletions cdk-infra/lib/constructs/api/webhook-env-construct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { StringParameter } from 'aws-cdk-lib/aws-ssm';
import { Construct } from 'constructs';
import { getSsmPathPrefix } from '../../../utils/ssm';
import { getDashboardUrl } from '../../../utils/slack';
import { getEnv, getFeatureName } from '../../../utils/env';
import { getEnv } from '../../../utils/env';

interface WebhookEnvConstructProps {
jobsQueue: IQueue;
Expand All @@ -18,14 +18,8 @@ export class WebhookEnvConstruct extends Construct {

const ssmPrefix = getSsmPathPrefix();
const env = getEnv();
const featureName = getFeatureName();

// Create configurable feature flag that lives in parameter store.
const featureFlagMonorepoPath = new StringParameter(this, 'monorepoPathFeature', {
parameterName: `${ssmPrefix}/${featureName}/monorepo/path_feature`,
stringValue: env === 'dotcomstg' || env === 'stg' ? 'true' : 'false',
});

const featureFlagMonorepoPath = StringParameter.valueFromLookup(this, `${ssmPrefix}/flag/monorepo_path`);
const dbName = StringParameter.valueFromLookup(this, `${ssmPrefix}/atlas/dbname`);
const snootyDbName = StringParameter.valueFromLookup(this, `${ssmPrefix}/atlas/collections/snooty`);
const repoBranchesCollection = StringParameter.valueFromLookup(this, `${ssmPrefix}/atlas/collections/repo`);
Expand Down
39 changes: 0 additions & 39 deletions tests/data/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,43 +452,4 @@ export class TestDataProvider {
static getAggregationPipeline(matchConditions: { [k: string]: string }, projection?: { [k: string]: number }) {
return DocsetsRepository.getAggregationPipeline(matchConditions, projection);
}
// static getAggregationPipeline(matchConditions: { [k: string]: string }, projection?: { [k: string]: number }) {
// // Add prefix 'repo' to each field in matchConditions
// const formattedMatchConditions = Object.entries(matchConditions).reduce((acc, [key, val]) => {
// acc[`repo.${key}`] = val;
// return acc;
// }, {});

// return [
// // Stage 1: Unwind the repos array to create multiple documents for each referenced repo
// {
// $unwind: '$repos',
// },
// // Stage 2: Lookup to join with the repos_branches collection
// {
// $lookup: {
// from: 'repos_branches',
// localField: 'repos',
// foreignField: '_id',
// as: 'repo',
// },
// },
// // Stage 3: Match documents based on given field
// {
// $match: formattedMatchConditions,
// },
// // Stage 4: Merge/flatten repo into docset
// {
// $replaceRoot: { newRoot: { $mergeObjects: [{ $arrayElemAt: ['$repo', 0] }, '$$ROOT'] } },
// },
// // Stage 5: Exclude fields
// {
// $project: projection || {
// _id: 0,
// repos: 0,
// repo: 0,
// },
// },
// ];
// }
}

0 comments on commit d7b84a0

Please sign in to comment.