Skip to content

Commit

Permalink
Merge pull request #441 from guardian/ts/queue-url
Browse files Browse the repository at this point in the history
refactor: give branch protector queue url env var unique name
  • Loading branch information
tjsilver authored Nov 9, 2023
2 parents 268c9bd + 98a034c commit 98a391b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/branch-protector/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export async function getConfig() {
installationId: secretJson.installationId,
},
anghammaradSnsTopic: getEnvOrThrow('ANGHAMMARAD_SNS_ARN'),
queueUrl: getEnvOrThrow('QUEUE_URL'),
queueUrl: getEnvOrThrow('BRANCH_PROTECTOR_QUEUE_URL'),
};
return config;
}
12 changes: 6 additions & 6 deletions packages/cdk/lib/__snapshots__/service-catalogue.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13377,6 +13377,9 @@ spec:
"Ref": "AnghammaradSnsArn",
},
"APP": "branch-protector",
"BRANCH_PROTECTOR_QUEUE_URL": {
"Ref": "branchprotectorqueueEF5856E4",
},
"GITHUB_APP_SECRET": {
"Fn::Join": [
"-",
Expand Down Expand Up @@ -13522,9 +13525,6 @@ spec:
],
],
},
"QUEUE_URL": {
"Ref": "branchprotectorqueueEF5856E4",
},
"STACK": "deploy",
"STAGE": "TEST",
},
Expand Down Expand Up @@ -13978,16 +13978,16 @@ spec:
"Ref": "AnghammaradSnsArn",
},
"APP": "repocop",
"BRANCH_PROTECTOR_QUEUE_URL": {
"Ref": "branchprotectorqueueEF5856E4",
},
"DATABASE_HOSTNAME": {
"Fn::GetAtt": [
"PostgresInstance16DE4286E",
"Endpoint.Address",
],
},
"QUERY_LOGGING": "false",
"QUEUE_URL": {
"Ref": "branchprotectorqueueEF5856E4",
},
"STACK": "deploy",
"STAGE": "TEST",
},
Expand Down
4 changes: 2 additions & 2 deletions packages/cdk/lib/service-catalogue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ export class ServiceCatalogue extends GuStack {

// Set this to 'true' to enable SQL query logging
QUERY_LOGGING: 'false',
QUEUE_URL: branchProtectorQueue.queueUrl,
BRANCH_PROTECTOR_QUEUE_URL: branchProtectorQueue.queueUrl,
},
vpc,
securityGroups: [applicationToPostgresSecurityGroup],
Expand Down Expand Up @@ -688,7 +688,7 @@ export class ServiceCatalogue extends GuStack {
environment: {
GITHUB_APP_SECRET: branchProtectorGithubCredentials.secretName,
ANGHAMMARAD_SNS_ARN: anghammaradTopicParameter.valueAsString,
QUEUE_URL: branchProtectorQueue.queueUrl,
BRANCH_PROTECTOR_QUEUE_URL: branchProtectorQueue.queueUrl,
},
vpc,
timeout: Duration.minutes(1),
Expand Down
2 changes: 1 addition & 1 deletion packages/repocop/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export async function getConfig(): Promise<Config> {
anghammaradSnsTopic: getEnvOrThrow('ANGHAMMARAD_SNS_ARN'),
databaseConnectionString: await getDatabaseConnectionString(databaseConfig),
withQueryLogging: queryLogging,
queueUrl: getEnvOrThrow('QUEUE_URL'),
queueUrl: getEnvOrThrow('BRANCH_PROTECTOR_QUEUE_URL'),
enableMessaging: process.env.ENABLE_MESSAGING === 'false' ? false : true,
ignoredRepositoryPrefixes: [
// Visuals team
Expand Down
4 changes: 2 additions & 2 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ setup_environment() {

ANGHAMMARAD_SNS_ARN=$(aws ssm get-parameter --name /account/services/anghammarad.topic.arn --profile deployTools --region eu-west-1 | jq '.Parameter.Value' | tr -d '"')

QUEUE_URL=$(aws sqs get-queue-url --queue-name branch-protector-queue-CODE.fifo --profile deployTools --region eu-west-1 | jq '.QueueUrl' | tr -d '"')
BRANCH_PROTECTOR_QUEUE_URL=$(aws sqs get-queue-url --queue-name branch-protector-queue-CODE.fifo --profile deployTools --region eu-west-1 | jq '.QueueUrl' | tr -d '"')

github_info_url="https://github.com/settings/tokens?type=beta"

Expand All @@ -97,7 +97,7 @@ SNYK_TOKEN="
env_var_text="
GALAXIES_BUCKET=${GALAXIES_BUCKET}
ANGHAMMARAD_SNS_ARN=${ANGHAMMARAD_SNS_ARN}
QUEUE_URL=${QUEUE_URL}
BRANCH_PROTECTOR_QUEUE_URL=${BRANCH_PROTECTOR_QUEUE_URL}
"

# Check if .env.local file exists in ~/.gu/service_catalogue/
Expand Down

0 comments on commit 98a391b

Please sign in to comment.