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 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: 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 { diff --git a/src/services/slack.ts b/src/services/slack.ts index bfc448e77..0d75bdfa4 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'); }