Skip to content

Commit

Permalink
Merge branch 'main' into DOP-4549
Browse files Browse the repository at this point in the history
  • Loading branch information
anabellabuckvar authored Apr 18, 2024
2 parents ecb6914 + 5abe722 commit 61dd3ea
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.local
Original file line number Diff line number Diff line change
@@ -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
Expand Down
18 changes: 18 additions & 0 deletions infrastructure/ecs-main/buckets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/job/jobHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
23 changes: 8 additions & 15 deletions src/job/productionJobHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>): Promise<void> {
Expand Down
3 changes: 1 addition & 2 deletions src/services/slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit 61dd3ea

Please sign in to comment.