From 6d698e2cccc4ab05a335213573a111043661bc6a Mon Sep 17 00:00:00 2001 From: Maya Raman Date: Tue, 16 Apr 2024 09:48:03 -0400 Subject: [PATCH 1/4] DOP-4452: Add bucket routing rule to rehome Realm docs from /docs/realm to /docs/atlas/device-sdks (#1026) * adding bucket routing rule * bucket rules * prerpd * release preprd * taking back preprd * PREPRD AGAIN * back to preprd * let go of preprd --- infrastructure/ecs-main/buckets.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/infrastructure/ecs-main/buckets.yml b/infrastructure/ecs-main/buckets.yml index a476a5f8e..51a03e74a 100644 --- a/infrastructure/ecs-main/buckets.yml +++ b/infrastructure/ecs-main/buckets.yml @@ -84,6 +84,24 @@ Resources: Protocol: "https" HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/php-library/upcoming + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/realm/sdk + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/atlas/device-sdks/sdk + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/realm/web + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/atlas/device-sdks/web + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/realm/studio + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/atlas/device-sdks/studio DocAtlasBucket: Type: "AWS::S3::Bucket" Properties: From 61806991bc36cc2ecf9973859a7948d3d291a3b9 Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:50:58 -0400 Subject: [PATCH 2/4] DOP-4401-c: Add commit hash to path for Smoke Test Deploys (#1018) * DOP-4401-c initial changes * DOP-4414 undoing changes for testing * DOP-4401-c refactor pathprefix * DOP-4401-c playing with mut prefix * DOP-4401-c mut prefix * DOP-4401-c undoing pathprefix conditional * DOP-4401-c redoing path prefix conditional and populating pathPrefix * DOP-4401-c redoing path prefix conditional but depopulating path prefix * DOP-4401-c adding a space in next-gen-stage argument * DOP-4401-c pushing to preprd * DOP-4401-c removing from preprd * DOP-4401-c pushing to preprd * DOP-4401-c playing with pathprefix * DOP-4401-c playing with pathprefix * DOP-4401-c setting mutPrefix to prePrefix * DOP-4401-c adding slack deploy to the end of mutprefix * DOP-4401-c implementing changes test on 4414 * DOP-4401-c reverting conditional amended for testing --- src/job/jobHandler.ts | 1 + src/job/productionJobHandler.ts | 23 ++++++++--------------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/job/jobHandler.ts b/src/job/jobHandler.ts index f0f8743cb..5b5a7ae3a 100644 --- a/src/job/jobHandler.ts +++ b/src/job/jobHandler.ts @@ -153,6 +153,7 @@ export abstract class JobHandler { // TODO: Can empty string check be removed? if (pathPrefix || pathPrefix === '') { this.currJob.payload.pathPrefix = pathPrefix; + //sets mutPrefix to the full pathPrefix unless server user is in the path (I believe this only happens in a subset of cases when docs-worker-xlarge is the server-user) const mutPrefix = pathPrefix.split(`/${server_user}`)[0]; this.currJob.payload.mutPrefix = mutPrefix; } diff --git a/src/job/productionJobHandler.ts b/src/job/productionJobHandler.ts index 6190cc018..e1529b5c5 100644 --- a/src/job/productionJobHandler.ts +++ b/src/job/productionJobHandler.ts @@ -141,22 +141,15 @@ export class ProductionJobHandler extends JobHandler { } getPathPrefix(): string { - try { - if (this.currJob.payload.prefix && this.currJob.payload.prefix === '') { - return this.currJob.payload.urlSlug ?? ''; - } - if (this.currJob.payload.urlSlug) { - if (this.currJob.payload.urlSlug === '') { - return this.currJob.payload.prefix; - } else { - return `${this.currJob.payload.prefix}/${this.currJob.payload.urlSlug}`; - } - } - return this.currJob.payload.prefix; - } catch (error) { - this.logger.save(this.currJob._id, error).then(); - throw new InvalidJobError(error.message); + const prefix = this.currJob.payload.urlSlug + ? `${this.currJob.payload.prefix}/${this.currJob.payload.urlSlug}` + : this.currJob.payload.prefix; + if (this.currJob.payload.action == 'automatedTest') { + const titleArray = this.currJob.title.split(' '); + const commitHash = titleArray[titleArray.length - 5]; + return `${prefix}/smokeTests/${commitHash}`; } + return prefix; } private async purgePublishedContent(makefileOutput: Array): Promise { From f10440364b9c403701f8ef749f47fb4713d85998 Mon Sep 17 00:00:00 2001 From: rayangler <27821750+rayangler@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:47:33 -0400 Subject: [PATCH 3/4] Update Dockerfile --- Dockerfile | 4 ++-- Dockerfile.local | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 947f95652..632613602 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,8 +22,8 @@ RUN cd ./modules/oas-page-builder \ # where repo work will happen FROM ubuntu:20.04 ARG WORK_DIRECTORY=/home/docsworker-xlarge -ARG SNOOTY_PARSER_VERSION=0.16.5 -ARG SNOOTY_FRONTEND_VERSION=0.16.9 +ARG SNOOTY_PARSER_VERSION=0.16.6 +ARG SNOOTY_FRONTEND_VERSION=0.16.10 ARG MUT_VERSION=0.11.2 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH diff --git a/Dockerfile.local b/Dockerfile.local index 6f3fbaa5a..ed0ba4f53 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -1,8 +1,8 @@ FROM arm64v8/ubuntu:20.04 as initial ARG NPM_BASE_64_AUTH ARG NPM_EMAIL -ARG SNOOTY_PARSER_VERSION=0.16.5 -ARG SNOOTY_FRONTEND_VERSION=0.16.9 +ARG SNOOTY_PARSER_VERSION=0.16.6 +ARG SNOOTY_FRONTEND_VERSION=0.16.10 ARG MUT_VERSION=0.11.2 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From 5abe722d4b892f082c747b53f5b8ebb67ca3d6bb Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Thu, 18 Apr 2024 16:46:33 -0400 Subject: [PATCH 4/4] DOP-4481 hotfix (#1032) * DOP-4481-hotfix adding extra check * DOP-4481-hotfix push to preprd * DOP-4481-hotfix fix conditional * DOP-4481-hotfix fix conditional * DOP-4481-hotfix fix conditional * DOP-4481-hotfix cleaning --- src/services/slack.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/services/slack.ts b/src/services/slack.ts index 20803d268..e5483ec98 100644 --- a/src/services/slack.ts +++ b/src/services/slack.ts @@ -63,11 +63,10 @@ export class SlackConnector implements ISlackConnector { const inputMapping = { block_repo_option: 'repo_option', block_hash_option: 'hash_option', - block_deploy_option: 'deploy_option', }; // if deploy all was selected: - if (stateValues['block_deploy_option']['deploy_option']?.selected_option?.value == 'deploy_all') { + if (stateValues['block_deploy_option']?.deploy_option?.selected_option?.value == 'deploy_all') { if (!isAdmin) { throw new Error('User is not an admin and therefore not entitled to deploy all repos'); }