diff --git a/.github/workflows/pullRequests.yml b/.github/workflows/pullRequests.yml index fcce580576f..d9e3f796256 100644 --- a/.github/workflows/pullRequests.yml +++ b/.github/workflows/pullRequests.yml @@ -183,6 +183,7 @@ jobs: env: NODE_OPTIONS: '--max_old_space_size=4096' YARN_ENABLE_IMMUTABLE_INSTALLS: false + AWS_REGION: eu-central-1 steps: - uses: actions/setup-node@v4 with: @@ -245,6 +246,7 @@ jobs: env: NODE_OPTIONS: '--max_old_space_size=4096' YARN_ENABLE_IMMUTABLE_INSTALLS: false + AWS_REGION: eu-central-1 steps: - uses: actions/setup-node@v4 with: @@ -306,6 +308,7 @@ jobs: env: NODE_OPTIONS: '--max_old_space_size=4096' YARN_ENABLE_IMMUTABLE_INSTALLS: false + AWS_REGION: eu-central-1 AWS_ELASTIC_SEARCH_DOMAIN_NAME: ${{ secrets.AWS_ELASTIC_SEARCH_DOMAIN_NAME }} ELASTIC_SEARCH_ENDPOINT: ${{ secrets.ELASTIC_SEARCH_ENDPOINT }} ELASTIC_SEARCH_INDEX_PREFIX: ${{ matrix.package.id }} @@ -378,6 +381,7 @@ jobs: env: NODE_OPTIONS: '--max_old_space_size=4096' YARN_ENABLE_IMMUTABLE_INSTALLS: false + AWS_REGION: eu-central-1 AWS_ELASTIC_SEARCH_DOMAIN_NAME: ${{ secrets.AWS_OPEN_SEARCH_DOMAIN_NAME }} ELASTIC_SEARCH_ENDPOINT: ${{ secrets.OPEN_SEARCH_ENDPOINT }} ELASTIC_SEARCH_INDEX_PREFIX: ${{ matrix.package.id }} diff --git a/.github/workflows/pushDev.yml b/.github/workflows/pushDev.yml index 67bc5881bdc..baecf806069 100644 --- a/.github/workflows/pushDev.yml +++ b/.github/workflows/pushDev.yml @@ -149,6 +149,7 @@ jobs: env: NODE_OPTIONS: '--max_old_space_size=4096' YARN_ENABLE_IMMUTABLE_INSTALLS: false + AWS_REGION: eu-central-1 steps: - uses: actions/setup-node@v4 with: @@ -211,6 +212,7 @@ jobs: env: NODE_OPTIONS: '--max_old_space_size=4096' YARN_ENABLE_IMMUTABLE_INSTALLS: false + AWS_REGION: eu-central-1 steps: - uses: actions/setup-node@v4 with: @@ -272,6 +274,7 @@ jobs: env: NODE_OPTIONS: '--max_old_space_size=4096' YARN_ENABLE_IMMUTABLE_INSTALLS: false + AWS_REGION: eu-central-1 AWS_ELASTIC_SEARCH_DOMAIN_NAME: ${{ secrets.AWS_ELASTIC_SEARCH_DOMAIN_NAME }} ELASTIC_SEARCH_ENDPOINT: ${{ secrets.ELASTIC_SEARCH_ENDPOINT }} ELASTIC_SEARCH_INDEX_PREFIX: ${{ matrix.package.id }} @@ -343,6 +346,7 @@ jobs: env: NODE_OPTIONS: '--max_old_space_size=4096' YARN_ENABLE_IMMUTABLE_INSTALLS: false + AWS_REGION: eu-central-1 AWS_ELASTIC_SEARCH_DOMAIN_NAME: ${{ secrets.AWS_OPEN_SEARCH_DOMAIN_NAME }} ELASTIC_SEARCH_ENDPOINT: ${{ secrets.OPEN_SEARCH_ENDPOINT }} ELASTIC_SEARCH_INDEX_PREFIX: ${{ matrix.package.id }} @@ -481,8 +485,8 @@ jobs: npx create-webiny-project@local-npm new-webiny-project --tag local-npm --no-interactive --assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}' - --template-options '{"region":"${{ env.AWS_REGION - }}","storageOperations":"ddb"}' + --template-options + '{"region":"eu-central-1","storageOperations":"ddb"}' - name: Print CLI version working-directory: new-webiny-project run: yarn webiny --version @@ -688,8 +692,8 @@ jobs: npx create-webiny-project@local-npm new-webiny-project --tag local-npm --no-interactive --assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}' - --template-options '{"region":"${{ env.AWS_REGION - }}","storageOperations":"ddb-es"}' + --template-options + '{"region":"eu-central-1","storageOperations":"ddb-es"}' - name: Print CLI version working-directory: new-webiny-project run: yarn webiny --version @@ -900,8 +904,8 @@ jobs: npx create-webiny-project@local-npm new-webiny-project --tag local-npm --no-interactive --assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}' - --template-options '{"region":"${{ env.AWS_REGION - }}","storageOperations":"ddb-os"}' + --template-options + '{"region":"eu-central-1","storageOperations":"ddb-os"}' - name: Print CLI version working-directory: new-webiny-project run: yarn webiny --version diff --git a/.github/workflows/pushNext.yml b/.github/workflows/pushNext.yml index b9949c4a0eb..4faab0d7c08 100644 --- a/.github/workflows/pushNext.yml +++ b/.github/workflows/pushNext.yml @@ -149,6 +149,7 @@ jobs: env: NODE_OPTIONS: '--max_old_space_size=4096' YARN_ENABLE_IMMUTABLE_INSTALLS: false + AWS_REGION: eu-central-1 steps: - uses: actions/setup-node@v4 with: @@ -211,6 +212,7 @@ jobs: env: NODE_OPTIONS: '--max_old_space_size=4096' YARN_ENABLE_IMMUTABLE_INSTALLS: false + AWS_REGION: eu-central-1 steps: - uses: actions/setup-node@v4 with: @@ -272,6 +274,7 @@ jobs: env: NODE_OPTIONS: '--max_old_space_size=4096' YARN_ENABLE_IMMUTABLE_INSTALLS: false + AWS_REGION: eu-central-1 AWS_ELASTIC_SEARCH_DOMAIN_NAME: ${{ secrets.AWS_ELASTIC_SEARCH_DOMAIN_NAME }} ELASTIC_SEARCH_ENDPOINT: ${{ secrets.ELASTIC_SEARCH_ENDPOINT }} ELASTIC_SEARCH_INDEX_PREFIX: ${{ matrix.package.id }} @@ -343,6 +346,7 @@ jobs: env: NODE_OPTIONS: '--max_old_space_size=4096' YARN_ENABLE_IMMUTABLE_INSTALLS: false + AWS_REGION: eu-central-1 AWS_ELASTIC_SEARCH_DOMAIN_NAME: ${{ secrets.AWS_OPEN_SEARCH_DOMAIN_NAME }} ELASTIC_SEARCH_ENDPOINT: ${{ secrets.OPEN_SEARCH_ENDPOINT }} ELASTIC_SEARCH_INDEX_PREFIX: ${{ matrix.package.id }} @@ -481,8 +485,8 @@ jobs: npx create-webiny-project@local-npm new-webiny-project --tag local-npm --no-interactive --assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}' - --template-options '{"region":"${{ env.AWS_REGION - }}","storageOperations":"ddb"}' + --template-options + '{"region":"eu-central-1","storageOperations":"ddb"}' - name: Print CLI version working-directory: new-webiny-project run: yarn webiny --version @@ -688,8 +692,8 @@ jobs: npx create-webiny-project@local-npm new-webiny-project --tag local-npm --no-interactive --assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}' - --template-options '{"region":"${{ env.AWS_REGION - }}","storageOperations":"ddb-es"}' + --template-options + '{"region":"eu-central-1","storageOperations":"ddb-es"}' - name: Print CLI version working-directory: new-webiny-project run: yarn webiny --version @@ -900,8 +904,8 @@ jobs: npx create-webiny-project@local-npm new-webiny-project --tag local-npm --no-interactive --assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}' - --template-options '{"region":"${{ env.AWS_REGION - }}","storageOperations":"ddb-os"}' + --template-options + '{"region":"eu-central-1","storageOperations":"ddb-os"}' - name: Print CLI version working-directory: new-webiny-project run: yarn webiny --version diff --git a/.github/workflows/wac/pullRequests.wac.ts b/.github/workflows/wac/pullRequests.wac.ts index a1ccd08b64e..11db0527b32 100644 --- a/.github/workflows/wac/pullRequests.wac.ts +++ b/.github/workflows/wac/pullRequests.wac.ts @@ -1,6 +1,11 @@ import { createWorkflow, NormalJob } from "github-actions-wac"; import { createJob } from "./jobs"; -import { NODE_VERSION, BUILD_PACKAGES_RUNNER, listPackagesWithJestTests } from "./utils"; +import { + NODE_VERSION, + BUILD_PACKAGES_RUNNER, + listPackagesWithJestTests, + AWS_REGION +} from "./utils"; import { createGlobalBuildCacheSteps, createInstallBuildSteps, @@ -18,7 +23,7 @@ const globalBuildCacheSteps = createGlobalBuildCacheSteps({ workingDirectory: DI const runBuildCacheSteps = createRunBuildCacheSteps({ workingDirectory: DIR_WEBINY_JS }); const createJestTestsJob = (storage: string | null) => { - const env: Record = {}; + const env: Record = { AWS_REGION }; if (storage) { if (storage === "ddb-es") { @@ -292,7 +297,7 @@ export const pullRequests = createWorkflow({ }, { name: "Create a new Webiny project", - run: 'npx create-webiny-project@local-npm test-project --tag local-npm --no-interactive --assign-to-yarnrc \'{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}\' --template-options \'{"region":"eu-central-1"}\'\n' + run: `npx create-webiny-project@local-npm test-project --tag local-npm --no-interactive --assign-to-yarnrc \'{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}\' --template-options \'{"region":"${AWS_REGION}"}\'\n` } ] }) diff --git a/.github/workflows/wac/pullRequestsCommandCypress.wac.ts b/.github/workflows/wac/pullRequestsCommandCypress.wac.ts index aa7392c87c9..8f90cbe5614 100644 --- a/.github/workflows/wac/pullRequestsCommandCypress.wac.ts +++ b/.github/workflows/wac/pullRequestsCommandCypress.wac.ts @@ -7,7 +7,7 @@ import { createGlobalBuildCacheSteps, createRunBuildCacheSteps } from "./steps"; -import { NODE_OPTIONS, NODE_VERSION, BUILD_PACKAGES_RUNNER } from "./utils"; +import { NODE_OPTIONS, NODE_VERSION, BUILD_PACKAGES_RUNNER, AWS_REGION } from "./utils"; import { createJob, createValidateWorkflowsJob } from "./jobs"; // Will print "next" or "dev". Important for caching (via actions/cache). @@ -212,7 +212,7 @@ export const pullRequestsCommandCypress = createWorkflow({ on: "issue_comment", env: { NODE_OPTIONS, - AWS_REGION: "eu-central-1" + AWS_REGION }, jobs: { checkComment: createJob({ diff --git a/.github/workflows/wac/push.wac.ts b/.github/workflows/wac/push.wac.ts index 023ea26e7da..504758d830f 100644 --- a/.github/workflows/wac/push.wac.ts +++ b/.github/workflows/wac/push.wac.ts @@ -1,5 +1,10 @@ import { createWorkflow, NormalJob } from "github-actions-wac"; -import { BUILD_PACKAGES_RUNNER, listPackagesWithJestTests, NODE_VERSION } from "./utils"; +import { + AWS_REGION, + BUILD_PACKAGES_RUNNER, + listPackagesWithJestTests, + NODE_VERSION +} from "./utils"; import { createJob } from "./jobs"; import { createDeployWebinySteps, @@ -126,7 +131,7 @@ const createPushWorkflow = (branchName: string) => { }, { name: "Create a new Webiny project", - run: `npx create-webiny-project@local-npm ${DIR_TEST_PROJECT} --tag local-npm --no-interactive --assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}' --template-options '{"region":"$\{{ env.AWS_REGION }}","storageOperations":"${dbSetup}"}' + run: `npx create-webiny-project@local-npm ${DIR_TEST_PROJECT} --tag local-npm --no-interactive --assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}' --template-options '{"region":"${AWS_REGION}","storageOperations":"${dbSetup}"}' ` }, { @@ -214,9 +219,7 @@ const createPushWorkflow = (branchName: string) => { }; const createJestTestsJob = (storage: string | null) => { - const env: Record = { - region: "${{ secrets.AWS_REGION }}" - }; + const env: Record = { AWS_REGION }; if (storage) { if (storage === "ddb-es") { diff --git a/packages/api-headless-cms-ddb-es/__tests__/graphql/index/mocks/mappingsSnapshot.ts b/packages/api-headless-cms-ddb-es/__tests__/graphql/index/mocks/mappingsSnapshot.ts index 3c28e4562cf..7eecb0a9ec0 100644 --- a/packages/api-headless-cms-ddb-es/__tests__/graphql/index/mocks/mappingsSnapshot.ts +++ b/packages/api-headless-cms-ddb-es/__tests__/graphql/index/mocks/mappingsSnapshot.ts @@ -2,6 +2,15 @@ export const createMappingsSnapshot = () => { return { mappings: { dynamic_templates: [ + { + ids: { + match: "^id|entryId$", + mapping: { + type: "string", + keyword: true + } + } + }, { dates: { match: "^createdOn|savedOn|publishedOn$", diff --git a/packages/api-headless-cms-import-export/__tests__/tasks/importFromUrlController.test.ts b/packages/api-headless-cms-import-export/__tests__/tasks/importFromUrlController.test.ts index 25ea499c60b..92a30a7862d 100644 --- a/packages/api-headless-cms-import-export/__tests__/tasks/importFromUrlController.test.ts +++ b/packages/api-headless-cms-import-export/__tests__/tasks/importFromUrlController.test.ts @@ -11,6 +11,8 @@ import { import { categoryModel } from "~tests/helpers/models"; import { NonEmptyArray } from "@webiny/api/types"; +jest.setTimeout(60000); + describe("import from url controller", () => { let context: Context; diff --git a/packages/api-headless-cms-import-export/__tests__/tasks/utils/helpers/matchKeyOrAlias.test.ts b/packages/api-headless-cms-import-export/__tests__/tasks/utils/helpers/matchKeyOrAlias.test.ts index 8987d44311e..07cf38d0ca5 100644 --- a/packages/api-headless-cms-import-export/__tests__/tasks/utils/helpers/matchKeyOrAlias.test.ts +++ b/packages/api-headless-cms-import-export/__tests__/tasks/utils/helpers/matchKeyOrAlias.test.ts @@ -4,6 +4,10 @@ import { GenericRecord } from "@webiny/api/types"; const cloudfrontUrl = "https://d1zqvydzhnfn89.cloudfront.net"; describe("match key or alias", () => { + beforeEach(() => { + process.env.DEBUG = "true"; + }); + it("should log an error when given an invalid URL", () => { const errors: any[] = []; console.error = (...args: any[]) => {