From ab53076269145db2b4612107be8528df73ff71a4 Mon Sep 17 00:00:00 2001 From: Brandon Ly Date: Wed, 22 May 2024 10:54:06 -0400 Subject: [PATCH 01/36] Pin Serverless to a specific version (#1045) pin Serverless to a specific version --- .github/workflows/deploy-prd-ecs.yml | 2 +- .github/workflows/deploy-stg-ecs.yml | 6 +++--- README.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-prd-ecs.yml b/.github/workflows/deploy-prd-ecs.yml index 61df05846..3f232cbeb 100644 --- a/.github/workflows/deploy-prd-ecs.yml +++ b/.github/workflows/deploy-prd-ecs.yml @@ -14,7 +14,7 @@ jobs: with: node-version: '18.x' - name: Install Serverless Framework - run: npm install -g serverless + run: npm install -g serverless@3 - name: Serverless AWS authentication run: sls config credentials --provider aws --key ${{ secrets.AWS_ACCESS_KEY_ID }} --secret ${{ secrets.AWS_SECRET_ACCESS_KEY }} - name: Configure AWS credentials diff --git a/.github/workflows/deploy-stg-ecs.yml b/.github/workflows/deploy-stg-ecs.yml index 2e0cfb462..37ed59875 100644 --- a/.github/workflows/deploy-stg-ecs.yml +++ b/.github/workflows/deploy-stg-ecs.yml @@ -1,8 +1,8 @@ on: push: branches: - - "main" - - "integration" + - 'main' + - 'integration' concurrency: group: environment-stg-${{ github.ref }} cancel-in-progress: true @@ -16,7 +16,7 @@ jobs: with: node-version: '18.x' - name: Install Serverless Framework - run: npm install -g serverless + run: npm install -g serverless@3 - name: Serverless AWS authentication run: sls config credentials --provider aws --key ${{ secrets.AWS_ACCESS_KEY_ID }} --secret ${{ secrets.AWS_SECRET_ACCESS_KEY }} - name: Configure AWS credentials diff --git a/README.md b/README.md index 4076e0470..917f19983 100644 --- a/README.md +++ b/README.md @@ -169,7 +169,7 @@ docs-worker-pool contains various triggers for release to higher environments. C #### Installation ```shell -npm install -g serverless +npm install -g serverless@3 ``` #### AWS Config From 0d087d86fb44f47e2783ce2a310a53d810742a2f Mon Sep 17 00:00:00 2001 From: Maya Raman Date: Thu, 23 May 2024 11:29:01 -0400 Subject: [PATCH 02/36] DOP-4589: Create bucket-level redirects for several versions (#1046) buckets commit --- infrastructure/ecs-main/buckets.yml | 70 ++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 7 deletions(-) diff --git a/infrastructure/ecs-main/buckets.yml b/infrastructure/ecs-main/buckets.yml index 1478c80a5..a00466b40 100644 --- a/infrastructure/ecs-main/buckets.yml +++ b/infrastructure/ecs-main/buckets.yml @@ -12,12 +12,24 @@ Resources: IndexDocument: index.html ErrorDocument: ${self:custom.site.errorDoc.${self:provider.stage}, null} RoutingRules: + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/stable + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/manual - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/master RedirectRule: Protocol: "https" HostName: ${self:custom.site.host.${self:provider.stage}} - ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/upcoming + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/manual + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/current + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/manual - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/atlas/cli/v1.3.0 RedirectRule: @@ -131,25 +143,31 @@ Resources: RedirectRule: Protocol: "https" HostName: ${self.custom.site.host.${self:provider.stage}} - ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/stable + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current - RoutingRuleCondition: - KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1.0 + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1 RedirectRule: Protocol: "https" HostName: ${self.custom.site.host.${self:provider.stage}} - ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/stable + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current - RoutingRuleCondition: - KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1 + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/stable RedirectRule: Protocol: "https" HostName: ${self.custom.site.host.${self:provider.stage}} - ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/stable + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/mongocli/v0. RedirectRule: Protocol: "https" HostName: ${self.custom.site.host.${self:provider.stage}} - ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/mongocli/stable + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/mongocli/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/mongocli/stable + RedirectRule: + Protocol: "https" + HostName: ${self.custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/mongocli/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/spark-connector/v1.1 RedirectRule: @@ -168,6 +186,24 @@ Resources: Protocol: "https" HostName: ${self.custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/spark-connector/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/ruby-driver/master + RedirectRule: + Protocol: "https" + HostName: ${self.custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/ruby-driver/upcoming + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/compass/beta + RedirectRule: + Protocol: "https" + HostName: ${self.custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/compass/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/compass/upcoming + RedirectRule: + Protocol: "https" + HostName: ${self.custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/compass/current DocAtlasBucket: Type: "AWS::S3::Bucket" Properties: @@ -180,6 +216,18 @@ Resources: WebsiteConfiguration: IndexDocument: index.html ErrorDocument: ${self:custom.site.errorDoc.${self:provider.stage}, null} + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/atlas/cli/stable + RedirectRule: + Protocol: "https" + HostName: ${self.custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/atlas/cli/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/atlas/atlas-operator/stable + RedirectRule: + Protocol: "https" + HostName: ${self.custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/atlas/atlas-operator/current CloudManagerBucket: Type: "AWS::S3::Bucket" Properties: @@ -270,6 +318,14 @@ Resources: WebsiteConfiguration: IndexDocument: index.html ErrorDocument: ${self:custom.site.errorDoc.${self:provider.stage}, null} + RoutingRules: + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/languages/scala/driver/master + RedirectRule: + Protocol: "https" + HostName: ${self.custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/languages/scala/driver/upcoming + DocsBucketPolicy: Type: AWS::S3::BucketPolicy From 4ac612426524118e908a66a6a5aaca5cd762bd29 Mon Sep 17 00:00:00 2001 From: Allison Reinheimer Moore Date: Thu, 23 May 2024 12:00:14 -0400 Subject: [PATCH 03/36] fix invalid formatting on buckets.yml --- infrastructure/ecs-main/buckets.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/infrastructure/ecs-main/buckets.yml b/infrastructure/ecs-main/buckets.yml index a00466b40..1847c6dab 100644 --- a/infrastructure/ecs-main/buckets.yml +++ b/infrastructure/ecs-main/buckets.yml @@ -216,14 +216,15 @@ Resources: WebsiteConfiguration: IndexDocument: index.html ErrorDocument: ${self:custom.site.errorDoc.${self:provider.stage}, null} - - RoutingRuleCondition: - KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/atlas/cli/stable + RoutingRules: + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/atlas/cli/stable RedirectRule: Protocol: "https" HostName: ${self.custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/atlas/cli/current - - RoutingRuleCondition: - KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/atlas/atlas-operator/stable + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/atlas/atlas-operator/stable RedirectRule: Protocol: "https" HostName: ${self.custom.site.host.${self:provider.stage}} From 3bd44b0c154af4c68df781c2b2002dcc25db8fdb Mon Sep 17 00:00:00 2001 From: Allison Reinheimer Moore Date: Thu, 23 May 2024 13:01:13 -0400 Subject: [PATCH 04/36] another dodgy one --- infrastructure/ecs-main/buckets.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/ecs-main/buckets.yml b/infrastructure/ecs-main/buckets.yml index 1847c6dab..4cd5445fd 100644 --- a/infrastructure/ecs-main/buckets.yml +++ b/infrastructure/ecs-main/buckets.yml @@ -322,7 +322,7 @@ Resources: RoutingRules: - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/languages/scala/driver/master - RedirectRule: + RedirectRule: Protocol: "https" HostName: ${self.custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/languages/scala/driver/upcoming From ca27322d24d1359ebe60da76d19ff344523f7e84 Mon Sep 17 00:00:00 2001 From: Allison Reinheimer Moore Date: Thu, 23 May 2024 13:40:32 -0400 Subject: [PATCH 05/36] fix variable --- infrastructure/ecs-main/buckets.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infrastructure/ecs-main/buckets.yml b/infrastructure/ecs-main/buckets.yml index 4cd5445fd..1be23452b 100644 --- a/infrastructure/ecs-main/buckets.yml +++ b/infrastructure/ecs-main/buckets.yml @@ -221,13 +221,13 @@ Resources: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/atlas/cli/stable RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/atlas/cli/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/atlas/atlas-operator/stable RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/atlas/atlas-operator/current CloudManagerBucket: Type: "AWS::S3::Bucket" From 56888282abd8cee28d55a6ddf2416eb3b3f0ac61 Mon Sep 17 00:00:00 2001 From: Allison Reinheimer Moore Date: Thu, 23 May 2024 13:41:37 -0400 Subject: [PATCH 06/36] fix syntax harder --- infrastructure/ecs-main/buckets.yml | 46 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/infrastructure/ecs-main/buckets.yml b/infrastructure/ecs-main/buckets.yml index 1be23452b..eb21ec6d5 100644 --- a/infrastructure/ecs-main/buckets.yml +++ b/infrastructure/ecs-main/buckets.yml @@ -76,133 +76,133 @@ Resources: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/v2.9 RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/v2.8 RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/v2.7 RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/v2.6 RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/v2.5 RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/v2.4 RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/v2.3 RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/v2.2 RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/v2.1 RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/v2.0 RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/v1.1 RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v0. RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1 RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/stable RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/mongocli/v0. RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/mongocli/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/mongocli/stable RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/mongocli/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/spark-connector/v1.1 RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/spark-connector/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/spark-connector/v2 RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/spark-connector/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/spark-connector/v3.0 RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/spark-connector/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/ruby-driver/master RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/ruby-driver/upcoming - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/compass/beta RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/compass/current - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/compass/upcoming RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/compass/current DocAtlasBucket: Type: "AWS::S3::Bucket" @@ -324,7 +324,7 @@ Resources: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/languages/scala/driver/master RedirectRule: Protocol: "https" - HostName: ${self.custom.site.host.${self:provider.stage}} + HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/languages/scala/driver/upcoming From 71b64c135b1c181730746f93127e8137ac7c02fa Mon Sep 17 00:00:00 2001 From: Seung Park Date: Tue, 28 May 2024 09:23:12 -0400 Subject: [PATCH 07/36] DOP-4669: add env var for enabling dark mode (#1047) add env var for enabling dark mode --- cdk-infra/lib/constructs/worker/worker-env-construct.ts | 2 ++ config/custom-environment-variables.json | 3 ++- infrastructure/ecs-main/ecs_service.yml | 2 ++ src/commands/src/helpers/dependency-helpers.ts | 3 ++- src/job/jobHandler.ts | 1 + tests/data/data.ts | 2 +- tests/utils/jobHandlerTestHelper.ts | 1 + 7 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cdk-infra/lib/constructs/worker/worker-env-construct.ts b/cdk-infra/lib/constructs/worker/worker-env-construct.ts index de91138ad..8da11d4b7 100644 --- a/cdk-infra/lib/constructs/worker/worker-env-construct.ts +++ b/cdk-infra/lib/constructs/worker/worker-env-construct.ts @@ -64,6 +64,7 @@ export class WorkerEnvConstruct extends Construct { const docsetsCollection = StringParameter.valueFromLookup(this, `${ssmPrefix}/atlas/collections/docsets`); const jobCollection = StringParameter.valueFromLookup(this, `${ssmPrefix}/atlas/collections/job/queue`); const gatsbyMarianUrl = StringParameter.valueFromLookup(this, `${ssmPrefix}/frontend/marian_url`); + const gatsbyEnableDarkMode = StringParameter.valueFromLookup(this, `${ssmPrefix}/frontend/enable_dark_mode`); const dbPassword = secureStrings['MONGO_ATLAS_PASSWORD']; this.environment = { @@ -101,6 +102,7 @@ export class WorkerEnvConstruct extends Construct { GATSBY_HIDE_UNIFIED_FOOTER_LOCALE: gatsbyHideUnifiedFooterLocale, GATSBY_MARIAN_URL: gatsbyMarianUrl, IS_FEATURE_BRANCH: getIsFeatureBranch(), + GATSBY_ENABLE_DARK_MODE: gatsbyEnableDarkMode, }; } } diff --git a/config/custom-environment-variables.json b/config/custom-environment-variables.json index 4503bd1b1..79cc86db2 100644 --- a/config/custom-environment-variables.json +++ b/config/custom-environment-variables.json @@ -34,5 +34,6 @@ "cdnClientID": "CDN_CLIENT_ID", "cdnClientSecret": "CDN_CLIENT_SECRET", "cdnInvalidatorServiceURL": "CDN_INVALIDATOR_SERVICE_URL", - "searchIndexBucket": "SEARCH_INDEX_BUCKET" + "searchIndexBucket": "SEARCH_INDEX_BUCKET", + "gatsbyEnableDarkMode": "GATSBY_ENABLE_DARK_MODE" } diff --git a/infrastructure/ecs-main/ecs_service.yml b/infrastructure/ecs-main/ecs_service.yml index 33fe2a34c..1716b2114 100644 --- a/infrastructure/ecs-main/ecs_service.yml +++ b/infrastructure/ecs-main/ecs_service.yml @@ -68,6 +68,8 @@ Resources: Value: ${self:custom.featureFlagSearchUI} - Name: GATSBY_MARIAN_URL Value: ${self:custom.gatsbyMarianURL} + - Name: GATSBY_ENABLE_DARK_MODE + Value: ${self:custom.gatsbyEnableDarkMode} - Name: GATSBY_HIDE_UNIFIED_FOOTER_LOCALE Value: ${self:custom.gatsbyHideUnifiedFooterLocale} - Name: FASTLY_MAIN_TOKEN diff --git a/src/commands/src/helpers/dependency-helpers.ts b/src/commands/src/helpers/dependency-helpers.ts index 7745326ba..2fe869938 100644 --- a/src/commands/src/helpers/dependency-helpers.ts +++ b/src/commands/src/helpers/dependency-helpers.ts @@ -36,7 +36,8 @@ async function createEnvProdFile({ GATSBY_MARIAN_URL=${process.env.GATSBY_MARIAN_URL} PATH_PREFIX=${prefix} ${patchId ? `PATCH_ID=${patchId}` : ''} - ${commitHash ? `COMMIT_HASH=${commitHash}` : ''}`, + ${commitHash ? `COMMIT_HASH=${commitHash}` : ''} + GATSBY_ENABLE_DARK_MODE=${process.env.GATSBY_ENABLE_DARK_MODE}`, 'utf8' ); } catch (e) { diff --git a/src/job/jobHandler.ts b/src/job/jobHandler.ts index 5b5a7ae3a..497bfa502 100644 --- a/src/job/jobHandler.ts +++ b/src/job/jobHandler.ts @@ -413,6 +413,7 @@ export abstract class JobHandler { GATSBY_TEST_SEARCH_UI: this._config.get('featureFlagSearchUI'), GATSBY_HIDE_UNIFIED_FOOTER_LOCALE: this._config.get('gatsbyHideUnifiedFooterLocale'), GATSBY_MARIAN_URL: this._config.get('gatsbyMarianURL'), + GATSBY_ENABLE_DARK_MODE: this._config.get('gatsbyEnableDarkMode'), }; for (const [envName, envValue] of Object.entries(snootyFrontEndVars)) { diff --git a/tests/data/data.ts b/tests/data/data.ts index b3e38483a..07da42860 100644 --- a/tests/data/data.ts +++ b/tests/data/data.ts @@ -176,7 +176,7 @@ export class TestDataProvider { } static getEnvVarsWithPathPrefixWithFlags(job: Job): string { - return `GATSBY_PARSER_USER=TestUser\nGATSBY_PARSER_BRANCH=${job.payload.branchName}\nPATH_PREFIX=${job.payload.pathPrefix}\nGATSBY_BASE_URL=test\nPREVIEW_BUILD_ENABLED=false\nGATSBY_TEST_SEARCH_UI=false\nGATSBY_HIDE_UNIFIED_FOOTER_LOCALE=true\nGATSBY_MARIAN_URL=test-url\n`; + return `GATSBY_PARSER_USER=TestUser\nGATSBY_PARSER_BRANCH=${job.payload.branchName}\nPATH_PREFIX=${job.payload.pathPrefix}\nGATSBY_BASE_URL=test\nPREVIEW_BUILD_ENABLED=false\nGATSBY_TEST_SEARCH_UI=false\nGATSBY_HIDE_UNIFIED_FOOTER_LOCALE=true\nGATSBY_MARIAN_URL=test-url\nGATSBY_ENABLE_DARK_MODE=true\n`; } static getPathPrefixCases(): Array { diff --git a/tests/utils/jobHandlerTestHelper.ts b/tests/utils/jobHandlerTestHelper.ts index bea195a47..0717f26d2 100644 --- a/tests/utils/jobHandlerTestHelper.ts +++ b/tests/utils/jobHandlerTestHelper.ts @@ -166,6 +166,7 @@ export class JobHandlerTestHelper { .calledWith(`repos/${this.job.payload.repoName}/worker.sh`) .mockReturnValue(nextGenEntry); this.config.get.calledWith('GATSBY_PARSER_USER').mockReturnValue('TestUser'); + this.config.get.calledWith('gatsbyEnableDarkMode').mockReturnValue('true'); this.jobCommandExecutor.execute.mockResolvedValue({ status: 'success', output: 'Great work', error: null }); } } From c436545fda471cbf13badc0f81e4b250fafeb997 Mon Sep 17 00:00:00 2001 From: Seung Park Date: Tue, 28 May 2024 10:38:09 -0400 Subject: [PATCH 08/36] DOP-4669: follow up - add custom env var to sls (#1048) add custom env var to sls --- infrastructure/ecs-main/serverless.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/infrastructure/ecs-main/serverless.yml b/infrastructure/ecs-main/serverless.yml index bbb1f8dfe..f3a25d85d 100644 --- a/infrastructure/ecs-main/serverless.yml +++ b/infrastructure/ecs-main/serverless.yml @@ -107,6 +107,7 @@ custom: gatsbyTestEmbedVersions: ${ssm:/env/${self:provider.stage}/docs/worker_pool/flag/embedded_versions} gatsbyHideUnifiedFooterLocale: ${ssm:/env/${self:provider.stage}/docs/worker_pool/flag/hide_locale} gatsbyMarianURL: ${ssm:/env/${self:provider.stage}/docs/worker_pool/frontend/marian_url} + gatsbyEnableDarkMode: ${ssm:/env/${self:provider.stage}/docs/worker_pool/frontend/enable_dark_mode} fastlyMainToken: ${ssm:/env/${self:provider.stage}/docs/worker_pool/fastly/docs/main/token} fastlyMainServiceId: ${ssm:/env/${self:provider.stage}/docs/worker_pool/fastly/docs/main/service_id} fastlyCloudManagerToken: ${ssm:/env/${self:provider.stage}/docs/worker_pool/fastly/docs/cloudmanager/token} From 575555853d359d330c595c76acc774efc22d8f4e Mon Sep 17 00:00:00 2001 From: rayangler <27821750+rayangler@users.noreply.github.com> Date: Fri, 31 May 2024 15:11:18 -0400 Subject: [PATCH 09/36] DOP-4602: Add feature flag to conditionally show WIP locales (#1052) --- cdk-infra/lib/constructs/worker/worker-env-construct.ts | 7 +++++++ config/custom-environment-variables.json | 1 + infrastructure/ecs-main/ecs_service.yml | 2 ++ infrastructure/ecs-main/serverless.yml | 1 + src/job/jobHandler.ts | 1 + tests/data/data.ts | 2 +- tests/utils/jobHandlerTestHelper.ts | 1 + 7 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cdk-infra/lib/constructs/worker/worker-env-construct.ts b/cdk-infra/lib/constructs/worker/worker-env-construct.ts index 8da11d4b7..9fb0a9778 100644 --- a/cdk-infra/lib/constructs/worker/worker-env-construct.ts +++ b/cdk-infra/lib/constructs/worker/worker-env-construct.ts @@ -65,6 +65,12 @@ export class WorkerEnvConstruct extends Construct { const jobCollection = StringParameter.valueFromLookup(this, `${ssmPrefix}/atlas/collections/job/queue`); const gatsbyMarianUrl = StringParameter.valueFromLookup(this, `${ssmPrefix}/frontend/marian_url`); const gatsbyEnableDarkMode = StringParameter.valueFromLookup(this, `${ssmPrefix}/frontend/enable_dark_mode`); + // Feature flag to render locales in the process of being translated. Might want to keep this while we continue to translate + // to new languages to avoid needing to keep moving this flag around + const gatsbyFeatureShowHiddenLocales = StringParameter.valueFromLookup( + this, + `${ssmPrefix}/flag/show_hidden_locales` + ); const dbPassword = secureStrings['MONGO_ATLAS_PASSWORD']; this.environment = { @@ -103,6 +109,7 @@ export class WorkerEnvConstruct extends Construct { GATSBY_MARIAN_URL: gatsbyMarianUrl, IS_FEATURE_BRANCH: getIsFeatureBranch(), GATSBY_ENABLE_DARK_MODE: gatsbyEnableDarkMode, + GATSBY_FEATURE_SHOW_HIDDEN_LOCALES: gatsbyFeatureShowHiddenLocales, }; } } diff --git a/config/custom-environment-variables.json b/config/custom-environment-variables.json index 79cc86db2..2eaf0c763 100644 --- a/config/custom-environment-variables.json +++ b/config/custom-environment-variables.json @@ -24,6 +24,7 @@ "featureFlagUpdatePages": "FEATURE_FLAG_UPDATE_PAGES", "featureFlagSearchUI": "GATSBY_TEST_SEARCH_UI", "gatsbyHideUnifiedFooterLocale": "GATSBY_HIDE_UNIFIED_FOOTER_LOCALE", + "gatsbyFeatureShowHiddenLocales": "GATSBY_FEATURE_SHOW_HIDDEN_LOCALES", "gatsbyMarianURL": "GATSBY_MARIAN_URL", "repoBranchesCollection": "REPO_BRANCHES_COL_NAME", "docsetsCollection": "DOCSETS_COL_NAME", diff --git a/infrastructure/ecs-main/ecs_service.yml b/infrastructure/ecs-main/ecs_service.yml index 1716b2114..ac3af22fa 100644 --- a/infrastructure/ecs-main/ecs_service.yml +++ b/infrastructure/ecs-main/ecs_service.yml @@ -70,6 +70,8 @@ Resources: Value: ${self:custom.gatsbyMarianURL} - Name: GATSBY_ENABLE_DARK_MODE Value: ${self:custom.gatsbyEnableDarkMode} + - Name: GATSBY_FEATURE_SHOW_HIDDEN_LOCALES + Value: ${self:custom.gatsbyFeatureShowHiddenLocales} - Name: GATSBY_HIDE_UNIFIED_FOOTER_LOCALE Value: ${self:custom.gatsbyHideUnifiedFooterLocale} - Name: FASTLY_MAIN_TOKEN diff --git a/infrastructure/ecs-main/serverless.yml b/infrastructure/ecs-main/serverless.yml index f3a25d85d..fc439bf9e 100644 --- a/infrastructure/ecs-main/serverless.yml +++ b/infrastructure/ecs-main/serverless.yml @@ -108,6 +108,7 @@ custom: gatsbyHideUnifiedFooterLocale: ${ssm:/env/${self:provider.stage}/docs/worker_pool/flag/hide_locale} gatsbyMarianURL: ${ssm:/env/${self:provider.stage}/docs/worker_pool/frontend/marian_url} gatsbyEnableDarkMode: ${ssm:/env/${self:provider.stage}/docs/worker_pool/frontend/enable_dark_mode} + gatsbyFeatureShowHiddenLocales: ${ssm:/env/${self:provider.stage}/docs/worker_pool/flag/show_hidden_locales} fastlyMainToken: ${ssm:/env/${self:provider.stage}/docs/worker_pool/fastly/docs/main/token} fastlyMainServiceId: ${ssm:/env/${self:provider.stage}/docs/worker_pool/fastly/docs/main/service_id} fastlyCloudManagerToken: ${ssm:/env/${self:provider.stage}/docs/worker_pool/fastly/docs/cloudmanager/token} diff --git a/src/job/jobHandler.ts b/src/job/jobHandler.ts index 497bfa502..4425d8d36 100644 --- a/src/job/jobHandler.ts +++ b/src/job/jobHandler.ts @@ -414,6 +414,7 @@ export abstract class JobHandler { GATSBY_HIDE_UNIFIED_FOOTER_LOCALE: this._config.get('gatsbyHideUnifiedFooterLocale'), GATSBY_MARIAN_URL: this._config.get('gatsbyMarianURL'), GATSBY_ENABLE_DARK_MODE: this._config.get('gatsbyEnableDarkMode'), + GATSBY_FEATURE_SHOW_HIDDEN_LOCALES: this._config.get('gatsbyFeatureShowHiddenLocales'), }; for (const [envName, envValue] of Object.entries(snootyFrontEndVars)) { diff --git a/tests/data/data.ts b/tests/data/data.ts index 07da42860..ff41bdf82 100644 --- a/tests/data/data.ts +++ b/tests/data/data.ts @@ -176,7 +176,7 @@ export class TestDataProvider { } static getEnvVarsWithPathPrefixWithFlags(job: Job): string { - return `GATSBY_PARSER_USER=TestUser\nGATSBY_PARSER_BRANCH=${job.payload.branchName}\nPATH_PREFIX=${job.payload.pathPrefix}\nGATSBY_BASE_URL=test\nPREVIEW_BUILD_ENABLED=false\nGATSBY_TEST_SEARCH_UI=false\nGATSBY_HIDE_UNIFIED_FOOTER_LOCALE=true\nGATSBY_MARIAN_URL=test-url\nGATSBY_ENABLE_DARK_MODE=true\n`; + return `GATSBY_PARSER_USER=TestUser\nGATSBY_PARSER_BRANCH=${job.payload.branchName}\nPATH_PREFIX=${job.payload.pathPrefix}\nGATSBY_BASE_URL=test\nPREVIEW_BUILD_ENABLED=false\nGATSBY_TEST_SEARCH_UI=false\nGATSBY_HIDE_UNIFIED_FOOTER_LOCALE=true\nGATSBY_MARIAN_URL=test-url\nGATSBY_ENABLE_DARK_MODE=true\nGATSBY_FEATURE_SHOW_HIDDEN_LOCALES=true\n`; } static getPathPrefixCases(): Array { diff --git a/tests/utils/jobHandlerTestHelper.ts b/tests/utils/jobHandlerTestHelper.ts index 0717f26d2..53b32ae79 100644 --- a/tests/utils/jobHandlerTestHelper.ts +++ b/tests/utils/jobHandlerTestHelper.ts @@ -167,6 +167,7 @@ export class JobHandlerTestHelper { .mockReturnValue(nextGenEntry); this.config.get.calledWith('GATSBY_PARSER_USER').mockReturnValue('TestUser'); this.config.get.calledWith('gatsbyEnableDarkMode').mockReturnValue('true'); + this.config.get.calledWith('gatsbyFeatureShowHiddenLocales').mockReturnValue('true'); this.jobCommandExecutor.execute.mockResolvedValue({ status: 'success', output: 'Great work', error: null }); } } From e08f5763811b177972b4a8180d9892292d6c46fe Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:28:09 -0400 Subject: [PATCH 10/36] Bump Parser and Frontend Versions --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e77c6b1a2..401e8b251 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.7 -ARG SNOOTY_FRONTEND_VERSION=0.16.14 +ARG SNOOTY_PARSER_VERSION=0.16.8 +ARG SNOOTY_FRONTEND_VERSION=0.16.15 ARG MUT_VERSION=0.11.2 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From 1f6bad55bc5877cca0ecac0a7337019c6c1a6bde Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Thu, 6 Jun 2024 17:25:06 -0400 Subject: [PATCH 11/36] Update Dockerfile.local --- Dockerfile.local | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.local b/Dockerfile.local index 985247dbe..58fe31645 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.7 -ARG SNOOTY_FRONTEND_VERSION=0.16.14 +ARG SNOOTY_PARSER_VERSION=0.16.7=8 +ARG SNOOTY_FRONTEND_VERSION=0.16.15 ARG MUT_VERSION=0.11.2 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From 16832bcc6026eee7a20e46ddf8da7c9132b69fda Mon Sep 17 00:00:00 2001 From: Maya Raman Date: Fri, 7 Jun 2024 12:47:29 -0400 Subject: [PATCH 12/36] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 401e8b251..b5dfff6d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN cd ./modules/oas-page-builder \ FROM ubuntu:20.04 ARG WORK_DIRECTORY=/home/docsworker-xlarge ARG SNOOTY_PARSER_VERSION=0.16.8 -ARG SNOOTY_FRONTEND_VERSION=0.16.15 +ARG SNOOTY_FRONTEND_VERSION=0.16.16 ARG MUT_VERSION=0.11.2 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From 628e92844ab45c2eb974009da70b45d8eaa84666 Mon Sep 17 00:00:00 2001 From: Caesar Bell Date: Thu, 13 Jun 2024 12:27:21 -0400 Subject: [PATCH 13/36] Update Dockerfile for release (#1056) * Update Dockerfile for release * :bookmark: Updates Dockfile and Dockerfile.local to have the same parser and front-end tag --------- Co-authored-by: Caesar Bell --- Dockerfile | 4 ++-- Dockerfile.local | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b5dfff6d3..d2606da5f 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.8 -ARG SNOOTY_FRONTEND_VERSION=0.16.16 +ARG SNOOTY_PARSER_VERSION=0.16.9 +ARG SNOOTY_FRONTEND_VERSION=0.16.17 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 58fe31645..ccd3c483d 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.7=8 -ARG SNOOTY_FRONTEND_VERSION=0.16.15 +ARG SNOOTY_PARSER_VERSION=0.16.9 +ARG SNOOTY_FRONTEND_VERSION=0.16.17 ARG MUT_VERSION=0.11.2 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From aac537e9b97992194b84b8903b40b37a50da7d54 Mon Sep 17 00:00:00 2001 From: rayangler <27821750+rayangler@users.noreply.github.com> Date: Fri, 14 Jun 2024 16:24:14 -0400 Subject: [PATCH 14/36] Bump frontend to v0.16.18 --- Dockerfile | 2 +- Dockerfile.local | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d2606da5f..27562f5f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN cd ./modules/oas-page-builder \ FROM ubuntu:20.04 ARG WORK_DIRECTORY=/home/docsworker-xlarge ARG SNOOTY_PARSER_VERSION=0.16.9 -ARG SNOOTY_FRONTEND_VERSION=0.16.17 +ARG SNOOTY_FRONTEND_VERSION=0.16.18 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 ccd3c483d..1e835e3fc 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -2,7 +2,7 @@ FROM arm64v8/ubuntu:20.04 as initial ARG NPM_BASE_64_AUTH ARG NPM_EMAIL ARG SNOOTY_PARSER_VERSION=0.16.9 -ARG SNOOTY_FRONTEND_VERSION=0.16.17 +ARG SNOOTY_FRONTEND_VERSION=0.16.18 ARG MUT_VERSION=0.11.2 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From 2844a9a8517732b4b04e62443afb69679152ded2 Mon Sep 17 00:00:00 2001 From: Allison Reinheimer Moore Date: Wed, 19 Jun 2024 11:44:54 -0400 Subject: [PATCH 15/36] DOP-4725: fix kuberentes links (#1053) * DOP-4725: fix kuberentes links * synchronize with the console settings --- infrastructure/ecs-main/buckets.yml | 142 ++++++++++++++++++++++------ 1 file changed, 113 insertions(+), 29 deletions(-) diff --git a/infrastructure/ecs-main/buckets.yml b/infrastructure/ecs-main/buckets.yml index eb21ec6d5..bf3272432 100644 --- a/infrastructure/ecs-main/buckets.yml +++ b/infrastructure/ecs-main/buckets.yml @@ -30,24 +30,6 @@ Resources: Protocol: "https" HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/manual - - RoutingRuleCondition: - KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/atlas/cli/v1.3.0 - RedirectRule: - Protocol: "https" - HostName: ${self:custom.site.host.${self:provider.stage}} - ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/atlas/cli/v1.3 - - RoutingRuleCondition: - KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/atlas/cli/v1.2 - RedirectRule: - Protocol: "https" - HostName: ${self:custom.site.host.${self:provider.stage}} - ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/atlas/cli/v1.2 - - RoutingRuleCondition: - KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/atlas/cli/v1.1 - RedirectRule: - Protocol: "https" - HostName: ${self:custom.site.host.${self:provider.stage}} - ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/atlas/cli/v1.1 - RoutingRuleCondition: KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/php-library/master RedirectRule: @@ -139,49 +121,151 @@ Resources: HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/bi-connector/current - RoutingRuleCondition: - KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v0. + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v0.8 RedirectRule: Protocol: "https" HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current - RoutingRuleCondition: - KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1 + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v0.9 RedirectRule: Protocol: "https" HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current - RoutingRuleCondition: - KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/stable + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v0.10 RedirectRule: Protocol: "https" HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current - RoutingRuleCondition: - KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/mongocli/v0. + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v0.11 RedirectRule: Protocol: "https" HostName: ${self:custom.site.host.${self:provider.stage}} - ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/mongocli/current + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current - RoutingRuleCondition: - KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/mongocli/stable + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v0.12 RedirectRule: Protocol: "https" HostName: ${self:custom.site.host.${self:provider.stage}} - ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/mongocli/current + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current - RoutingRuleCondition: - KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/spark-connector/v1.1 + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1.0 RedirectRule: Protocol: "https" HostName: ${self:custom.site.host.${self:provider.stage}} - ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/spark-connector/current + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1.3 + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1.4 + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1.5 + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1.6 + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1.7 + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1.8 + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1.9 + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1.10 + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1.11 + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1.12 + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1.13 + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1.14 + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1.15 + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1.16 + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/v1.17 + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/stable + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/kubernetes-operator/current + - RoutingRuleCondition: + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/mongocli/stable + RedirectRule: + Protocol: "https" + HostName: ${self:custom.site.host.${self:provider.stage}} + ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/mongocli/current - RoutingRuleCondition: - KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/spark-connector/v2 + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/spark-connector/v1.1.1 RedirectRule: Protocol: "https" HostName: ${self:custom.site.host.${self:provider.stage}} ReplaceKeyPrefixWith: ${self:custom.site.prefix.${self:provider.stage}}/spark-connector/current - RoutingRuleCondition: - KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/spark-connector/v3.0 + KeyPrefixEquals: ${self:custom.site.prefix.${self:provider.stage}}/spark-connector/v2.0 RedirectRule: Protocol: "https" HostName: ${self:custom.site.host.${self:provider.stage}} From 60bb7fa23be90405f14480ddfa92ca1472f75564 Mon Sep 17 00:00:00 2001 From: rayangler <27821750+rayangler@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:23:08 -0400 Subject: [PATCH 16/36] Bump parser and frontend versions --- Dockerfile | 4 ++-- Dockerfile.local | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 27562f5f1..19d501ee9 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.9 -ARG SNOOTY_FRONTEND_VERSION=0.16.18 +ARG SNOOTY_PARSER_VERSION=0.16.10 +ARG SNOOTY_FRONTEND_VERSION=0.16.19 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 1e835e3fc..a5b909b5f 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.9 -ARG SNOOTY_FRONTEND_VERSION=0.16.18 +ARG SNOOTY_PARSER_VERSION=0.16.10 +ARG SNOOTY_FRONTEND_VERSION=0.16.19 ARG MUT_VERSION=0.11.2 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From 8aff996750f4d6531fed158830805a839636dd97 Mon Sep 17 00:00:00 2001 From: rayangler <27821750+rayangler@users.noreply.github.com> Date: Fri, 21 Jun 2024 11:20:47 -0400 Subject: [PATCH 17/36] Bump frontend and mut versions --- Dockerfile | 4 ++-- Dockerfile.local | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 19d501ee9..031eecf5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,8 @@ RUN cd ./modules/oas-page-builder \ FROM ubuntu:20.04 ARG WORK_DIRECTORY=/home/docsworker-xlarge ARG SNOOTY_PARSER_VERSION=0.16.10 -ARG SNOOTY_FRONTEND_VERSION=0.16.19 -ARG MUT_VERSION=0.11.2 +ARG SNOOTY_FRONTEND_VERSION=0.16.20 +ARG MUT_VERSION=0.11.3 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH ARG NPM_EMAIL diff --git a/Dockerfile.local b/Dockerfile.local index a5b909b5f..14cf2fecf 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -2,8 +2,8 @@ FROM arm64v8/ubuntu:20.04 as initial ARG NPM_BASE_64_AUTH ARG NPM_EMAIL ARG SNOOTY_PARSER_VERSION=0.16.10 -ARG SNOOTY_FRONTEND_VERSION=0.16.19 -ARG MUT_VERSION=0.11.2 +ARG SNOOTY_FRONTEND_VERSION=0.16.20 +ARG MUT_VERSION=0.11.3 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH ARG NPM_EMAIL From 365e6b7efcc44e6ade4cbefaeb2acf8c5aa6dfff Mon Sep 17 00:00:00 2001 From: Seung Park Date: Wed, 26 Jun 2024 10:27:05 -0400 Subject: [PATCH 18/36] DOP-4758: pull rstspec from tagged version (#1057) * test getting rstspec from parser version in dockerfile * test with logs * fix log * remove log * remove logs * revert test change for makefiles * provide fallback * remove rstspec flag --- src/commands/src/shared/next-gen-parse.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/commands/src/shared/next-gen-parse.ts b/src/commands/src/shared/next-gen-parse.ts index 70bba49d7..b61990ce1 100644 --- a/src/commands/src/shared/next-gen-parse.ts +++ b/src/commands/src/shared/next-gen-parse.ts @@ -3,7 +3,6 @@ import { Job } from '../../../entities/job'; import { getDirectory } from '../../../job/jobHandler'; import { CliCommandResponse, ExecuteCommandError, executeCliCommand } from '../helpers'; -const RSTSPEC_FLAG = '--rstspec=https://raw.githubusercontent.com/mongodb/snooty-parser/latest/snooty/rstspec.toml'; interface NextGenParseParams { job: Job; patchId?: string; @@ -22,7 +21,6 @@ export async function nextGenParse({ job, patchId, isProd }: NextGenParseParams) commandArgs.push('--patch'); commandArgs.push(patchId); } - commandArgs.push(RSTSPEC_FLAG); // Not currently used in production builds, adding functionality // now so that it is available when it is. From b87084d48c9fce7f63d360fb38e0f39b29e1b694 Mon Sep 17 00:00:00 2001 From: mmeigs Date: Thu, 27 Jun 2024 11:18:52 -0400 Subject: [PATCH 19/36] Release v1.5.19 - snooty v0.16.21, parser v0.16.11 (#1059) * update - snooty v0.16.21, parser v0.16.11 * update parser version --- Dockerfile | 4 ++-- Dockerfile.local | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 031eecf5d..7be340915 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.10 -ARG SNOOTY_FRONTEND_VERSION=0.16.20 +ARG SNOOTY_PARSER_VERSION=0.16.12 +ARG SNOOTY_FRONTEND_VERSION=0.16.21 ARG MUT_VERSION=0.11.3 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH diff --git a/Dockerfile.local b/Dockerfile.local index 14cf2fecf..7c73c94c5 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.10 -ARG SNOOTY_FRONTEND_VERSION=0.16.20 +ARG SNOOTY_PARSER_VERSION=0.16.12 +ARG SNOOTY_FRONTEND_VERSION=0.16.21 ARG MUT_VERSION=0.11.3 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From 797f754893c82472fad7122c1e349402952b35ec Mon Sep 17 00:00:00 2001 From: mmeigs Date: Thu, 27 Jun 2024 15:46:11 -0400 Subject: [PATCH 20/36] Hotfix: Release 1.5.19 (#1060) * update - snooty v0.16.21, parser v0.16.11 * update parser version * hotfix new snooty version --- Dockerfile | 2 +- Dockerfile.local | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7be340915..4ec5364bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN cd ./modules/oas-page-builder \ FROM ubuntu:20.04 ARG WORK_DIRECTORY=/home/docsworker-xlarge ARG SNOOTY_PARSER_VERSION=0.16.12 -ARG SNOOTY_FRONTEND_VERSION=0.16.21 +ARG SNOOTY_FRONTEND_VERSION=0.16.22 ARG MUT_VERSION=0.11.3 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH diff --git a/Dockerfile.local b/Dockerfile.local index 7c73c94c5..c0b548382 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -2,7 +2,7 @@ FROM arm64v8/ubuntu:20.04 as initial ARG NPM_BASE_64_AUTH ARG NPM_EMAIL ARG SNOOTY_PARSER_VERSION=0.16.12 -ARG SNOOTY_FRONTEND_VERSION=0.16.21 +ARG SNOOTY_FRONTEND_VERSION=0.16.22 ARG MUT_VERSION=0.11.3 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From 53b797871254f83566bda8d38b8e5052076e2757 Mon Sep 17 00:00:00 2001 From: Caesar Bell Date: Wed, 10 Jul 2024 11:55:18 -0400 Subject: [PATCH 21/36] :wrench: DOP-0000 updated the versions (#1062) Co-authored-by: Caesar Bell --- Dockerfile | 4 ++-- Dockerfile.local | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4ec5364bd..1dd14093f 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.12 -ARG SNOOTY_FRONTEND_VERSION=0.16.22 +ARG SNOOTY_PARSER_VERSION=0.16.13 +ARG SNOOTY_FRONTEND_VERSION=0.16.23 ARG MUT_VERSION=0.11.3 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH diff --git a/Dockerfile.local b/Dockerfile.local index c0b548382..cf69b1a1f 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.12 -ARG SNOOTY_FRONTEND_VERSION=0.16.22 +ARG SNOOTY_PARSER_VERSION=0.16.13 +ARG SNOOTY_FRONTEND_VERSION=0.16.23 ARG MUT_VERSION=0.11.3 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From 787bf0f78e5c881e0a4e44463297d5fe7f470530 Mon Sep 17 00:00:00 2001 From: Maya Raman Date: Wed, 17 Jul 2024 14:45:57 -0400 Subject: [PATCH 22/36] Update Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1dd14093f..56d367995 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.13 -ARG SNOOTY_FRONTEND_VERSION=0.16.23 +ARG SNOOTY_PARSER_VERSION=0.16.14 +ARG SNOOTY_FRONTEND_VERSION=0.16.24 ARG MUT_VERSION=0.11.3 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From 2684af3eb004b936ef3f997164ed97b88843bad9 Mon Sep 17 00:00:00 2001 From: mmeigs Date: Thu, 25 Jul 2024 11:59:46 -0400 Subject: [PATCH 23/36] Release v1.5.23 (#1064) * upgrade snooty for hotfix * version * dockerfiles updated * change version in package json --- Dockerfile | 6 +++--- Dockerfile.local | 6 +++--- package.json | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 56d367995..7c10bb562 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,9 +22,9 @@ 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.14 -ARG SNOOTY_FRONTEND_VERSION=0.16.24 -ARG MUT_VERSION=0.11.3 +ARG SNOOTY_PARSER_VERSION=0.16.15 +ARG SNOOTY_FRONTEND_VERSION=0.16.26 +ARG MUT_VERSION=0.11.4 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH ARG NPM_EMAIL diff --git a/Dockerfile.local b/Dockerfile.local index cf69b1a1f..e4cabfe8b 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -1,9 +1,9 @@ FROM arm64v8/ubuntu:20.04 as initial ARG NPM_BASE_64_AUTH ARG NPM_EMAIL -ARG SNOOTY_PARSER_VERSION=0.16.13 -ARG SNOOTY_FRONTEND_VERSION=0.16.23 -ARG MUT_VERSION=0.11.3 +ARG SNOOTY_PARSER_VERSION=0.16.15 +ARG SNOOTY_FRONTEND_VERSION=0.16.26 +ARG MUT_VERSION=0.11.4 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH ARG NPM_EMAIL diff --git a/package.json b/package.json index 4bceb6ed7..46ab68394 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "workerpool", - "version": "1.0.0", + "version": "1.5.23", "description": "Worker Pool Basic Implementation", "main": "index.js", "scripts": { From 4d25f38c2f2a5574971ae236d4294a88bd20a74b Mon Sep 17 00:00:00 2001 From: Brandon Ly Date: Thu, 1 Aug 2024 11:05:44 -0500 Subject: [PATCH 24/36] Update Dockerfile (#1066) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7c10bb562..a4c17d3ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN cd ./modules/oas-page-builder \ FROM ubuntu:20.04 ARG WORK_DIRECTORY=/home/docsworker-xlarge ARG SNOOTY_PARSER_VERSION=0.16.15 -ARG SNOOTY_FRONTEND_VERSION=0.16.26 +ARG SNOOTY_FRONTEND_VERSION=0.16.27 ARG MUT_VERSION=0.11.4 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From 98dbde7ddb833737db0ddbcb78fa0ec7cb917b6d Mon Sep 17 00:00:00 2001 From: Brandon Ly Date: Tue, 6 Aug 2024 16:10:54 -0500 Subject: [PATCH 25/36] [DOP-4876]: Add deprecation warning message to Autobuilder staging builds (#1067) --- api/controllers/v2/jobs.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/controllers/v2/jobs.ts b/api/controllers/v2/jobs.ts index a5339346b..eebb51a00 100644 --- a/api/controllers/v2/jobs.ts +++ b/api/controllers/v2/jobs.ts @@ -110,11 +110,15 @@ function prepProgressMessage( status: string, errorReason: string ): string { - const msg = `Your Job (<${jobUrl}${jobId}|${jobTitle}>) `; const env = c.get('env'); + const deprecationWarning = + env === 'prd' + ? 'The Autobuilder for staging will be deprecated by Sept. 30th. Please reach out to #ask-docs-platform on questions on how to migrate to Netlify for staging builds.' + : ''; + const msg = `Your Job (<${jobUrl}${jobId}|${jobTitle}>) `; switch (status) { case 'inQueue': - return msg + 'has successfully been added to the ' + env + ' queue.'; + return msg + `has successfully been added to the ${env} queue. ${deprecationWarning}`; case 'inProgress': return msg + 'is now being processed.'; case 'completed': From 01c3a3914cce064bc0f6b704ed20895c5eae8971 Mon Sep 17 00:00:00 2001 From: Seung Park Date: Thu, 8 Aug 2024 10:33:39 -0400 Subject: [PATCH 26/36] update snooty frontend version --- Dockerfile | 2 +- Dockerfile.local | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a4c17d3ee..eb353b00e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN cd ./modules/oas-page-builder \ FROM ubuntu:20.04 ARG WORK_DIRECTORY=/home/docsworker-xlarge ARG SNOOTY_PARSER_VERSION=0.16.15 -ARG SNOOTY_FRONTEND_VERSION=0.16.27 +ARG SNOOTY_FRONTEND_VERSION=0.16.28 ARG MUT_VERSION=0.11.4 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH diff --git a/Dockerfile.local b/Dockerfile.local index e4cabfe8b..c013648a8 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -2,7 +2,7 @@ FROM arm64v8/ubuntu:20.04 as initial ARG NPM_BASE_64_AUTH ARG NPM_EMAIL ARG SNOOTY_PARSER_VERSION=0.16.15 -ARG SNOOTY_FRONTEND_VERSION=0.16.26 +ARG SNOOTY_FRONTEND_VERSION=0.16.28 ARG MUT_VERSION=0.11.4 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From b505e30d263929e0166ac4118d6516b17dcd3315 Mon Sep 17 00:00:00 2001 From: mmeigs Date: Thu, 15 Aug 2024 11:58:39 -0400 Subject: [PATCH 27/36] update to v1.5.26 --- Dockerfile | 4 ++-- Dockerfile.local | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index eb353b00e..db913269e 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.15 -ARG SNOOTY_FRONTEND_VERSION=0.16.28 +ARG SNOOTY_PARSER_VERSION=0.17.0 +ARG SNOOTY_FRONTEND_VERSION=0.17.0 ARG MUT_VERSION=0.11.4 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH diff --git a/Dockerfile.local b/Dockerfile.local index c013648a8..67554fe1c 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.15 -ARG SNOOTY_FRONTEND_VERSION=0.16.28 +ARG SNOOTY_PARSER_VERSION=0.17.0 +ARG SNOOTY_FRONTEND_VERSION=0.17.0 ARG MUT_VERSION=0.11.4 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH diff --git a/package.json b/package.json index 46ab68394..8cd8952fa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "workerpool", - "version": "1.5.23", + "version": "1.5.26", "description": "Worker Pool Basic Implementation", "main": "index.js", "scripts": { From b19d22ac2f6bb871df38240170af74976f681e2e Mon Sep 17 00:00:00 2001 From: rayangler <27821750+rayangler@users.noreply.github.com> Date: Thu, 22 Aug 2024 14:40:15 -0400 Subject: [PATCH 28/36] Bump Dockerfiles --- Dockerfile | 2 +- Dockerfile.local | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index db913269e..92a9d0901 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN cd ./modules/oas-page-builder \ FROM ubuntu:20.04 ARG WORK_DIRECTORY=/home/docsworker-xlarge ARG SNOOTY_PARSER_VERSION=0.17.0 -ARG SNOOTY_FRONTEND_VERSION=0.17.0 +ARG SNOOTY_FRONTEND_VERSION=0.17.1 ARG MUT_VERSION=0.11.4 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH diff --git a/Dockerfile.local b/Dockerfile.local index 67554fe1c..137f7d513 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -2,7 +2,7 @@ FROM arm64v8/ubuntu:20.04 as initial ARG NPM_BASE_64_AUTH ARG NPM_EMAIL ARG SNOOTY_PARSER_VERSION=0.17.0 -ARG SNOOTY_FRONTEND_VERSION=0.17.0 +ARG SNOOTY_FRONTEND_VERSION=0.17.1 ARG MUT_VERSION=0.11.4 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From 0cc9d4821fa10373c88e34e5033e05c50d908c43 Mon Sep 17 00:00:00 2001 From: Brandon Ly Date: Fri, 30 Aug 2024 10:57:24 -0500 Subject: [PATCH 29/36] Bump frontend version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 92a9d0901..a790be376 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN cd ./modules/oas-page-builder \ FROM ubuntu:20.04 ARG WORK_DIRECTORY=/home/docsworker-xlarge ARG SNOOTY_PARSER_VERSION=0.17.0 -ARG SNOOTY_FRONTEND_VERSION=0.17.1 +ARG SNOOTY_FRONTEND_VERSION=0.17.2 ARG MUT_VERSION=0.11.4 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From 6fd5a5e9f092ecf81a68ebc9eee2d8c4f1720218 Mon Sep 17 00:00:00 2001 From: Brandon Ly Date: Fri, 30 Aug 2024 10:57:43 -0500 Subject: [PATCH 30/36] Bump frontend version --- Dockerfile.local | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.local b/Dockerfile.local index 137f7d513..1957a6146 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -2,7 +2,7 @@ FROM arm64v8/ubuntu:20.04 as initial ARG NPM_BASE_64_AUTH ARG NPM_EMAIL ARG SNOOTY_PARSER_VERSION=0.17.0 -ARG SNOOTY_FRONTEND_VERSION=0.17.1 +ARG SNOOTY_FRONTEND_VERSION=0.17.2 ARG MUT_VERSION=0.11.4 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From e7e63b3742f0b86e523444604bdccb788e0bab8c Mon Sep 17 00:00:00 2001 From: Seung Park Date: Thu, 5 Sep 2024 09:19:52 -0400 Subject: [PATCH 31/36] update parser+frontend versions --- Dockerfile | 4 ++-- Dockerfile.local | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index a790be376..95ae55639 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.17.0 -ARG SNOOTY_FRONTEND_VERSION=0.17.2 +ARG SNOOTY_PARSER_VERSION=0.17.1 +ARG SNOOTY_FRONTEND_VERSION=0.17.3 ARG MUT_VERSION=0.11.4 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH diff --git a/Dockerfile.local b/Dockerfile.local index 1957a6146..fadc912cc 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.17.0 -ARG SNOOTY_FRONTEND_VERSION=0.17.2 +ARG SNOOTY_PARSER_VERSION=0.17.1 +ARG SNOOTY_FRONTEND_VERSION=0.17.3 ARG MUT_VERSION=0.11.4 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From 74efc3d41435e89599a107fdd87933d0a84dbeb6 Mon Sep 17 00:00:00 2001 From: Seung Park Date: Thu, 5 Sep 2024 11:26:20 -0400 Subject: [PATCH 32/36] update frontend version --- Dockerfile | 2 +- Dockerfile.local | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 95ae55639..3b7661cd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN cd ./modules/oas-page-builder \ FROM ubuntu:20.04 ARG WORK_DIRECTORY=/home/docsworker-xlarge ARG SNOOTY_PARSER_VERSION=0.17.1 -ARG SNOOTY_FRONTEND_VERSION=0.17.3 +ARG SNOOTY_FRONTEND_VERSION=0.17.4 ARG MUT_VERSION=0.11.4 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH diff --git a/Dockerfile.local b/Dockerfile.local index fadc912cc..39c9b11b0 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -2,7 +2,7 @@ FROM arm64v8/ubuntu:20.04 as initial ARG NPM_BASE_64_AUTH ARG NPM_EMAIL ARG SNOOTY_PARSER_VERSION=0.17.1 -ARG SNOOTY_FRONTEND_VERSION=0.17.3 +ARG SNOOTY_FRONTEND_VERSION=0.17.4 ARG MUT_VERSION=0.11.4 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From 706f7de7ba49676889857e732ac905c5de03073e Mon Sep 17 00:00:00 2001 From: mmeigs Date: Thu, 5 Sep 2024 13:35:37 -0400 Subject: [PATCH 33/36] package.json v1.5.28 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8cd8952fa..48401ca27 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "workerpool", - "version": "1.5.26", + "version": "1.5.28", "description": "Worker Pool Basic Implementation", "main": "index.js", "scripts": { From 65b4f0eb3932aab396d0d2a5433a093448445f3a Mon Sep 17 00:00:00 2001 From: mmeigs Date: Thu, 5 Sep 2024 13:37:25 -0400 Subject: [PATCH 34/36] v1.5.29 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 48401ca27..e3bbb7368 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "workerpool", - "version": "1.5.28", + "version": "1.5.29", "description": "Worker Pool Basic Implementation", "main": "index.js", "scripts": { From 708cbfda970d30205a3f21fafdb08bb7b97813e8 Mon Sep 17 00:00:00 2001 From: rayangler <27821750+rayangler@users.noreply.github.com> Date: Wed, 11 Sep 2024 10:55:35 -0400 Subject: [PATCH 35/36] Bump frontend version --- Dockerfile | 2 +- Dockerfile.local | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3b7661cd3..b28e67166 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN cd ./modules/oas-page-builder \ FROM ubuntu:20.04 ARG WORK_DIRECTORY=/home/docsworker-xlarge ARG SNOOTY_PARSER_VERSION=0.17.1 -ARG SNOOTY_FRONTEND_VERSION=0.17.4 +ARG SNOOTY_FRONTEND_VERSION=0.17.5 ARG MUT_VERSION=0.11.4 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH diff --git a/Dockerfile.local b/Dockerfile.local index 39c9b11b0..ae5e88adb 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -2,7 +2,7 @@ FROM arm64v8/ubuntu:20.04 as initial ARG NPM_BASE_64_AUTH ARG NPM_EMAIL ARG SNOOTY_PARSER_VERSION=0.17.1 -ARG SNOOTY_FRONTEND_VERSION=0.17.4 +ARG SNOOTY_FRONTEND_VERSION=0.17.5 ARG MUT_VERSION=0.11.4 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH From 7d36348fa6484f01d3f2cad202ec334d9a547fba Mon Sep 17 00:00:00 2001 From: Brandon Ly Date: Thu, 12 Sep 2024 16:02:33 -0500 Subject: [PATCH 36/36] Disable Autobuilder for Writer's Staging (#1068) * Disable autobuilder for staging * Remove trigger build from v1 as well --- api/controllers/v1/github.ts | 71 ++------------------ api/controllers/v2/github.ts | 127 +---------------------------------- 2 files changed, 7 insertions(+), 191 deletions(-) diff --git a/api/controllers/v1/github.ts b/api/controllers/v1/github.ts index f743e65b8..ae821b23a 100644 --- a/api/controllers/v1/github.ts +++ b/api/controllers/v1/github.ts @@ -7,6 +7,7 @@ import { markBuildArtifactsForDeletion, validateJsonWebhook } from '../../handle import { DocsetsRepository } from '../../../src/repositories/docsetsRepository'; import { ReposBranchesDocsetsDocument } from '../../../modules/persistence/src/services/metadata/repos_branches'; import { PushEvent } from '@octokit/webhooks-types'; +import { APIGatewayProxyResult } from 'aws-lambda'; async function prepGithubPushPayload( githubEvent: any, @@ -61,75 +62,11 @@ async function prepGithubPushPayload( }; } -export const TriggerBuild = async (event: any = {}, context: any = {}): Promise => { - const client = new mongodb.MongoClient(c.get('dbUrl')); - await client.connect(); - const db = client.db(c.get('dbName')); - const consoleLogger = new ConsoleLogger(); - const jobRepository = new JobRepository(db, c, consoleLogger); - const repoBranchesRepository = new RepoBranchesRepository(db, c, consoleLogger); - const docsetsRepository = new DocsetsRepository(db, c, consoleLogger); - - if (!validateJsonWebhook(event, c.get('githubSecret'))) { - const errMsg = "X-Hub-Signature incorrect. Github webhook token doesn't match"; - return { - statusCode: 401, - headers: { 'Content-Type': 'text/plain' }, - body: errMsg, - }; - } - if (!event.body) { - const err = 'Trigger build does not have a body in event payload'; - consoleLogger.error('TriggerBuildError', err); - return { - statusCode: 400, - headers: { 'Content-Type': 'text/plain' }, - body: err, - }; - } - - let body: PushEvent; - try { - body = JSON.parse(event.body) as PushEvent; - } catch (e) { - consoleLogger.error('[TriggerBuild]', `ERROR! Could not parse event.body ${e}`); - console.log(`event: ${event} and event body: ${event.body}`); - return { - statusCode: 502, - headers: { 'Content-Type': 'text/plain' }, - body: ' ERROR! Could not parse event.body', - }; - } - - if (body.deleted) { - return { - statusCode: 200, - headers: { 'Content-Type': 'text/plain' }, - body: 'Job Ignored (Deletion)', - }; - } - - const env = c.get('env'); - const repoInfo = await docsetsRepository.getRepo(body.repository.name); - const jobPrefix = repoInfo?.prefix ? repoInfo['prefix'][env] : ''; - // TODO: Make job be of type Job - const job = await prepGithubPushPayload(body, repoBranchesRepository, jobPrefix, repoInfo); - try { - consoleLogger.info(job.title, 'Creating Job'); - const jobId = await jobRepository.insertJob(job, c.get('jobsQueueUrl')); - consoleLogger.info(job.title, `Created Job ${jobId}`); - } catch (err) { - return { - statusCode: 500, - headers: { 'Content-Type': 'text/plain' }, - body: err, - }; - } +export const TriggerBuild = async (): Promise => { return { - statusCode: 202, + statusCode: 404, headers: { 'Content-Type': 'text/plain' }, - body: 'Job Queued', + body: 'The Autobuilder is currently disabled for staging. Please use Netlify instead.', }; }; - export const MarkBuildArtifactsForDeletion = markBuildArtifactsForDeletion; diff --git a/api/controllers/v2/github.ts b/api/controllers/v2/github.ts index c97823694..52a5f44b1 100644 --- a/api/controllers/v2/github.ts +++ b/api/controllers/v2/github.ts @@ -10,10 +10,7 @@ import { ProjectsRepository } from '../../../src/repositories/projectsRepository import { EnhancedJob, EnhancedPayload, JobStatus } from '../../../src/entities/job'; import { markBuildArtifactsForDeletion, validateJsonWebhook } from '../../handlers/github'; import { DocsetsRepository } from '../../../src/repositories/docsetsRepository'; -import { getMonorepoPaths } from '../../../src/monorepo'; -import { getUpdatedFilePaths } from '../../../src/monorepo/utils/path-utils'; import { ReposBranchesDocsetsDocument } from '../../../modules/persistence/src/services/metadata/repos_branches'; -import { MONOREPO_NAME } from '../../../src/monorepo/utils/monorepo-constants'; const SMOKETEST_SITES = [ 'docs-landing', @@ -241,129 +238,11 @@ export const triggerSmokeTestAutomatedBuild = async (event: APIGatewayEvent): Pr } }; -export const TriggerBuild = async (event: APIGatewayEvent): Promise => { - const client = new mongodb.MongoClient(c.get('dbUrl')); - await client.connect(); - const db = client.db(c.get('dbName')); - const consoleLogger = new ConsoleLogger(); - const jobRepository = new JobRepository(db, c, consoleLogger); - const repoBranchesRepository = new RepoBranchesRepository(db, c, consoleLogger); - const docsetsRepository = new DocsetsRepository(db, c, consoleLogger); - - if (!event.body) { - const err = 'Trigger build does not have a body in event payload'; - return { - statusCode: 400, - headers: { 'Content-Type': 'text/plain' }, - body: err, - }; - } - - if (!validateJsonWebhook(event, c.get('githubSecret'))) { - const errMsg = "X-Hub-Signature incorrect. Github webhook token doesn't match"; - return { - statusCode: 401, - headers: { 'Content-Type': 'text/plain' }, - body: errMsg, - }; - } - let body: PushEvent; - try { - body = JSON.parse(event.body) as PushEvent; - } catch (e) { - console.log('[TriggerBuild]: ERROR! Could not parse event.body', e); - return { - statusCode: 502, - headers: { 'Content-Type': 'text/plain' }, - body: ' ERROR! Could not parse event.body', - }; - } - - if (body.deleted) { - return { - statusCode: 200, - headers: { 'Content-Type': 'text/plain' }, - body: 'Job Ignored (Deletion)', - }; - } - - const env = c.get('env'); - - async function createAndInsertJob(path?: string) { - const repo = body.repository; - const repoInfo = await docsetsRepository.getRepo(repo.name, path); - const jobPrefix = repoInfo?.prefix ? repoInfo['prefix'][env] : ''; - const jobTitle = repo.full_name; - const payload = await createPayload({ - repoName: repo.name, - prefix: jobPrefix, - repoBranchesRepository, - repoInfo, - githubEvent: body, - }); - - const job = await prepGithubPushPayload(body, payload, jobTitle); - - consoleLogger.info(job.title, 'Creating Job'); - const jobId = await jobRepository.insertJob(job, c.get('jobsQueueUrl')); - jobRepository.notify(jobId, c.get('jobUpdatesQueueUrl'), JobStatus.inQueue, 0); - consoleLogger.info(job.title, `Created Job ${jobId}`); - } - - if (process.env.FEATURE_FLAG_MONOREPO_PATH === 'true' && body.repository.name === MONOREPO_NAME) { - let monorepoPaths: string[] = []; - try { - if (body.head_commit && body.repository.owner.name) { - monorepoPaths = await getMonorepoPaths({ - commitSha: body.head_commit.id, - repoName: body.repository.name, - ownerName: body.repository.owner.name, - updatedFilePaths: getUpdatedFilePaths(body.head_commit), - }); - consoleLogger.info(body.repository.full_name, `Monorepo Paths with new changes: ${monorepoPaths}`); - } - } catch (error) { - consoleLogger.warn('Warning, attempting to get monorepo paths caused an error', error); - } - - /* Create and insert Job for each monorepo project that has changes */ - for (const path of monorepoPaths) { - consoleLogger.info(body.repository.full_name, `Create Job for Monorepo directory: /${path}`); - // TODO: Deal with nested monorepo projects - /* For now, we will ignore nested monorepo projects until necessary */ - if (path.split('/').length > 1) continue; - - try { - await createAndInsertJob(path); - } catch (err) { - return { - statusCode: 500, - headers: { 'Content-Type': 'text/plain' }, - body: err, - }; - } - } - - return { - statusCode: 202, - headers: { 'Content-Type': 'text/plain' }, - body: 'Jobs Queued', - }; - } - - try { - await createAndInsertJob(); - } catch (err) { - return { - statusCode: 500, - headers: { 'Content-Type': 'text/plain' }, - body: err, - }; - } +export const TriggerBuild = async (): Promise => { return { - statusCode: 202, + statusCode: 404, headers: { 'Content-Type': 'text/plain' }, - body: 'Job Queued', + body: 'The Autobuilder is currently disabled for staging. Please use Netlify instead.', }; };