From a0288cd57c6138e7a97d9cb43e2f952f26f75e40 Mon Sep 17 00:00:00 2001 From: Nathan Curtis Date: Tue, 22 Oct 2024 15:43:26 -0700 Subject: [PATCH 1/6] [TEST] changing something trivial so we can trigger the PR flow --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9a9d6b70..d8c115b5 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Repository for the Microservices API backend of the TerraMatch service TBD. The ApiGateway has been tested to be at least functional on AWS. Tooling around deployment will be handled in a future ticket. + # Database work For now, Laravel is the source of truth for all things related to the DB schema. As such, TypeORM is not allowed to modify the schema, and is expected to interface with exactly the schema that is managed by Laravel. This note is included in user.entity.ts, From 50b873e6390676f1867f902f6b0b3df298a0c617 Mon Sep 17 00:00:00 2001 From: Nathan Curtis Date: Tue, 22 Oct 2024 15:46:58 -0700 Subject: [PATCH 2/6] [TEST] make sure we're using the CDK from the package.json --- apps/api-gateway/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api-gateway/package.json b/apps/api-gateway/package.json index 0e6987f8..4b376b84 100644 --- a/apps/api-gateway/package.json +++ b/apps/api-gateway/package.json @@ -6,7 +6,7 @@ }, "scripts": { "build-local-proxy": "(cd lambda/local-proxy; npm run build)", - "synth-local": "cdk synth --no-staging --quiet", + "synth-local": "npx cdk synth --no-staging --quiet", "build": "npm run build-local-proxy && npm run synth-local", "serve": "DOCKER_HOST=unix://$HOME/.docker/run/docker.sock sam local start-api -t ./cdk.out/ApiGatewayStack.template.json -p 4000" }, From 49f0e99fd34f66ce562ec6a8e35f82fe80c7a0ab Mon Sep 17 00:00:00 2001 From: Nathan Curtis Date: Tue, 22 Oct 2024 15:53:51 -0700 Subject: [PATCH 3/6] [TEST] Try moving the docker compose to after build. --- .github/workflows/pull-request.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 18c0224c..9e536061 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -18,17 +18,11 @@ jobs: with: fetch-depth: 0 - - uses: KengoTODA/actions-setup-docker-compose@v1 - with: - version: '2.29.1' - # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - - run: docker-compose up -d - # Cache node_modules - uses: actions/setup-node@v4 with: @@ -45,4 +39,10 @@ jobs: # NX_CLOUD_DISTRIBUTED_EXECUTION=false from this command. - run: NX_CLOUD_DISTRIBUTED_EXECUTION=false npx nx affected -t lint build + - uses: KengoTODA/actions-setup-docker-compose@v1 + with: + version: '2.29.1' + + - run: docker-compose up -d + - run: NX_CLOUD_DISTRIBUTED_EXECUTION=false npx nx run-many -t test --coverage --passWithNoTests From 6bf9fb44d01919924bfce7878f7b5ffecd1f083e Mon Sep 17 00:00:00 2001 From: Nathan Curtis Date: Tue, 22 Oct 2024 15:57:46 -0700 Subject: [PATCH 4/6] [TEST] Try disabling the npm cache --- .github/workflows/pull-request.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 9e536061..38706304 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -24,10 +24,10 @@ jobs: - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: 'npm' +# - uses: actions/setup-node@v4 +# with: +# node-version: 20 +# cache: 'npm' - run: npm ci --legacy-peer-deps && (cd apps/api-gateway; npm ci) && (cd apps/api-gateway/lambda/local-proxy; npm ci) From 0fb19cdc919cb1d25e58dc6d618a7cd086ef0c80 Mon Sep 17 00:00:00 2001 From: Nathan Curtis Date: Tue, 22 Oct 2024 16:00:40 -0700 Subject: [PATCH 5/6] [TEST] Try doing run-many on lint / build too --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 38706304..9b518a67 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -37,7 +37,7 @@ jobs: # cacheable. Since the codebase is currently small, we can get away without distribution, but once # it grows, we'll want to look into what it will take to make the api gateway build cacheable and remove # NX_CLOUD_DISTRIBUTED_EXECUTION=false from this command. - - run: NX_CLOUD_DISTRIBUTED_EXECUTION=false npx nx affected -t lint build + - run: NX_CLOUD_DISTRIBUTED_EXECUTION=false npx nx run-many -t lint build - uses: KengoTODA/actions-setup-docker-compose@v1 with: From ce4037f0a39d797bd7c6b15052453df8f967d126 Mon Sep 17 00:00:00 2001 From: Nathan Curtis Date: Tue, 22 Oct 2024 16:03:34 -0700 Subject: [PATCH 6/6] [TEST] Try using npm i instead of ci --- .github/workflows/pull-request.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 9b518a67..aa6e2c5b 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -24,12 +24,12 @@ jobs: - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules -# - uses: actions/setup-node@v4 -# with: -# node-version: 20 -# cache: 'npm' + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' - - run: npm ci --legacy-peer-deps && (cd apps/api-gateway; npm ci) && (cd apps/api-gateway/lambda/local-proxy; npm ci) + - run: npm i --legacy-peer-deps && (cd apps/api-gateway; npm i) && (cd apps/api-gateway/lambda/local-proxy; npm i) - uses: nrwl/nx-set-shas@v4 @@ -37,7 +37,7 @@ jobs: # cacheable. Since the codebase is currently small, we can get away without distribution, but once # it grows, we'll want to look into what it will take to make the api gateway build cacheable and remove # NX_CLOUD_DISTRIBUTED_EXECUTION=false from this command. - - run: NX_CLOUD_DISTRIBUTED_EXECUTION=false npx nx run-many -t lint build + - run: NX_CLOUD_DISTRIBUTED_EXECUTION=false npx nx affected -t lint build - uses: KengoTODA/actions-setup-docker-compose@v1 with: