From 08ddfb3cf23c090767139b2fe7fd428f3524dcfd Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Mon, 13 Nov 2023 13:29:50 -0500 Subject: [PATCH 01/13] updated signer e2e test script & docs --- apps/signer/package.json | 16 ++++++++-------- docs/kubernetes-deployment/signer/README.md | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/signer/package.json b/apps/signer/package.json index 87cfe2c73..7f48d76ab 100644 --- a/apps/signer/package.json +++ b/apps/signer/package.json @@ -22,14 +22,14 @@ "test:integration:debugdb": "VERBOSE_DB_LOGGING=true jest --runInBand test/integration", "test:e2e": "jest --runInBand test/end-to-end --testPathIgnorePatterns test/end-to-end/disabled-apis.test.ts", "test:e2e:disabledapis": "jest --runInBand test/end-to-end/disabled-apis.test.ts", - "test:e2e:staging:0": "CONTEXT_NAME=staging ODIS_SIGNER_SERVICE_URL=https://staging-pgpnp-signer0.azurefd.net yarn test:e2e", - "test:e2e:staging:1": "CONTEXT_NAME=staging ODIS_SIGNER_SERVICE_URL=https://staging-pgpnp-signer1.azurefd.net yarn test:e2e", - "test:e2e:staging:2": "CONTEXT_NAME=staging ODIS_SIGNER_SERVICE_URL=https://staging-pgpnp-signer2.azurefd.net yarn test:e2e", - "test:e2e:alfajores:1": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=https://odis-alfajores-signer-1-b.azurefd.net yarn test:e2e", - "test:e2e:alfajores:2": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=https://odis-alfajores-signer2.azurefd.net yarn test:e2e", - "test:e2e:alfajores:3": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=https://odis-alfajores-signer3.azurefd.net yarn test:e2e", - "test:e2e:mainnet:brazilsouth": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=https://mainnet-pgpnp-brazilsouth.azurefd.net yarn test:e2e", - "test:e2e:mainnet:eastasia": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=https://mainnet-pgpnp-eastasia.azurefd.net yarn test:e2e", + "test:e2e:staging:0": "CONTEXT_NAME=staging ODIS_SIGNER_SERVICE_URL=http://odis-signer0-staging.odis-signer0-staging:3000 yarn test:e2e", + "test:e2e:staging:1": "CONTEXT_NAME=staging ODIS_SIGNER_SERVICE_URL=http://odis-signer1-staging.odis-signer1-staging:3000 yarn test:e2e", + "test:e2e:staging:2": "CONTEXT_NAME=staging ODIS_SIGNER_SERVICE_URL=http://odis-signer2-staging.odis-signer2-staging:3000 yarn test:e2e", + "test:e2e:alfajores:1": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=http://odis-signer0-alfajores.odis-signer0-alfajores:3000 yarn test:e2e", + "test:e2e:alfajores:2": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=http://odis-signer1-staging.odis-signer1-staging:3000 yarn test:e2e", + "test:e2e:alfajores:3": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=http://odis-signer2-alfajores.odis-signer2-alfajores:3000 yarn test:e2e", + "test:e2e:mainnet:brazilsouth": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=http://odis-signer0-mainnet.odis-signer0-mainnet:3000 yarn test:e2e", + "test:e2e:mainnet:eastasia": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=http://odis-signer1-mainnet.odis-signer1-mainnet:3000 yarn test:e2e", "test:signer:mainnet": "MAINNET_ODIS_BLOCKCHAIN_PROVIDER=https://alfajores-forno.celo-testnet.org CONTEXT_NAME=mainnet yarn jest test/end-to-end -t='\\[Signer configuration test\\]'", "db:migrate": "ts-node scripts/run-migrations.ts", "db:migrate:make": "knex --migrations-directory ./src/common/database/migrations migrate:make -x ts", diff --git a/docs/kubernetes-deployment/signer/README.md b/docs/kubernetes-deployment/signer/README.md index 41572d727..f2b787dd8 100644 --- a/docs/kubernetes-deployment/signer/README.md +++ b/docs/kubernetes-deployment/signer/README.md @@ -38,7 +38,7 @@ ODIS signer is deployed in the following clusters: - Signer0 in namespace `odis-signer0-alfajores` with this [`values-signer0-alfajores.yaml` file](./values/alfajores/values-signer0-alfajores.yaml). - URL: `http://odis-signer0-alfajores.odis-signer0-alfajores:3000`. :warning: This is a URL internal to the cluster (i.e. not accessible from outside)!! - Signer1 in namespace `odis-signer1-alfajores` with this [`values-signer1-alfajores.yaml` file](./values/alfajores/values-signer1-alfajores.yaml). - - URL: `http://odis-signer1-staging.odis-signer1-staging:3000`. :warning: This is a URL internal to the cluster (i.e. not accessible from outside)!! + - URL: `http://odis-signer1-alfajores.odis-signer1-alfajores:3000`. :warning: This is a URL internal to the cluster (i.e. not accessible from outside)!! - Signer2 in namespace `odis-signer2-alfajores` with this [`values-signer2-alfajores.yaml` file](./values/alfajores/values-signer2-alfajores.yaml). - URL: `http://odis-signer2-alfajores.odis-signer2-alfajores:3000`. :warning: This is a URL internal to the cluster (i.e. not accessible from outside)!! - Mainnet: cluster `rc1-europe-west1` From da37ab1c9732cd968dd3e781f7c64a438c106128 Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Mon, 13 Nov 2023 13:30:09 -0500 Subject: [PATCH 02/13] ++ ts-node in monitor --- apps/monitor/package.json | 3 ++- yarn.lock | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/monitor/package.json b/apps/monitor/package.json index 876a4cd74..7f03b1392 100644 --- a/apps/monitor/package.json +++ b/apps/monitor/package.json @@ -38,7 +38,8 @@ "devDependencies": { "firebase-functions-test": "^3.1.0", "firebase-tools": "9.20.0", - "jest": "^29.7.0" + "jest": "^29.7.0", + "ts-node": "^10.9.1" }, "engines": { "node": ">=14" diff --git a/yarn.lock b/yarn.lock index b56c18b1f..b5b5237e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1989,6 +1989,7 @@ __metadata: firebase-functions-test: "npm:^3.1.0" firebase-tools: "npm:9.20.0" jest: "npm:^29.7.0" + ts-node: "npm:^10.9.1" yargs: "npm:^14.0.0" languageName: unknown linkType: soft From 14269eb2bf26130237ca84fff86b70ec1b2d0c48 Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Mon, 13 Nov 2023 13:39:14 -0500 Subject: [PATCH 03/13] ++ cs --- .changeset/big-lies-protect.md | 5 +++++ .changeset/red-ravens-search.md | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/big-lies-protect.md create mode 100644 .changeset/red-ravens-search.md diff --git a/.changeset/big-lies-protect.md b/.changeset/big-lies-protect.md new file mode 100644 index 000000000..4c3bef658 --- /dev/null +++ b/.changeset/big-lies-protect.md @@ -0,0 +1,5 @@ +--- +'@celo/phone-number-privacy-signer': patch +--- + +Updated the e2e test script. diff --git a/.changeset/red-ravens-search.md b/.changeset/red-ravens-search.md new file mode 100644 index 000000000..c6ad57ca5 --- /dev/null +++ b/.changeset/red-ravens-search.md @@ -0,0 +1,5 @@ +--- +'@celo/phone-number-privacy-monitor': patch +--- + +Added `ts-node` to monitor package From 392e90d715e9a6f034701c4ff65199c479bfbc6e Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Tue, 14 Nov 2023 10:50:18 -0500 Subject: [PATCH 04/13] updated mainnet signer e2e test script name --- apps/signer/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/signer/package.json b/apps/signer/package.json index 7f48d76ab..1d448c2bc 100644 --- a/apps/signer/package.json +++ b/apps/signer/package.json @@ -28,8 +28,8 @@ "test:e2e:alfajores:1": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=http://odis-signer0-alfajores.odis-signer0-alfajores:3000 yarn test:e2e", "test:e2e:alfajores:2": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=http://odis-signer1-staging.odis-signer1-staging:3000 yarn test:e2e", "test:e2e:alfajores:3": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=http://odis-signer2-alfajores.odis-signer2-alfajores:3000 yarn test:e2e", - "test:e2e:mainnet:brazilsouth": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=http://odis-signer0-mainnet.odis-signer0-mainnet:3000 yarn test:e2e", - "test:e2e:mainnet:eastasia": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=http://odis-signer1-mainnet.odis-signer1-mainnet:3000 yarn test:e2e", + "test:e2e:mainnet:0": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=http://odis-signer0-mainnet.odis-signer0-mainnet:3000 yarn test:e2e", + "test:e2e:mainnet:1": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=http://odis-signer1-mainnet.odis-signer1-mainnet:3000 yarn test:e2e", "test:signer:mainnet": "MAINNET_ODIS_BLOCKCHAIN_PROVIDER=https://alfajores-forno.celo-testnet.org CONTEXT_NAME=mainnet yarn jest test/end-to-end -t='\\[Signer configuration test\\]'", "db:migrate": "ts-node scripts/run-migrations.ts", "db:migrate:make": "knex --migrations-directory ./src/common/database/migrations migrate:make -x ts", From 27bb8ccb4cfed99f984139f131225b7959324758 Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Tue, 14 Nov 2023 11:25:46 -0500 Subject: [PATCH 05/13] signer endoint update --- apps/signer/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/signer/package.json b/apps/signer/package.json index 1d448c2bc..35120ac25 100644 --- a/apps/signer/package.json +++ b/apps/signer/package.json @@ -25,9 +25,9 @@ "test:e2e:staging:0": "CONTEXT_NAME=staging ODIS_SIGNER_SERVICE_URL=http://odis-signer0-staging.odis-signer0-staging:3000 yarn test:e2e", "test:e2e:staging:1": "CONTEXT_NAME=staging ODIS_SIGNER_SERVICE_URL=http://odis-signer1-staging.odis-signer1-staging:3000 yarn test:e2e", "test:e2e:staging:2": "CONTEXT_NAME=staging ODIS_SIGNER_SERVICE_URL=http://odis-signer2-staging.odis-signer2-staging:3000 yarn test:e2e", - "test:e2e:alfajores:1": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=http://odis-signer0-alfajores.odis-signer0-alfajores:3000 yarn test:e2e", - "test:e2e:alfajores:2": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=http://odis-signer1-staging.odis-signer1-staging:3000 yarn test:e2e", - "test:e2e:alfajores:3": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=http://odis-signer2-alfajores.odis-signer2-alfajores:3000 yarn test:e2e", + "test:e2e:alfajores:0": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=http://odis-signer0-alfajores.odis-signer0-alfajores:3000 yarn test:e2e", + "test:e2e:alfajores:1": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=http://odis-signer1-alfajores.odis-signer1-alfajores:3000 yarn test:e2e", + "test:e2e:alfajores:2": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=http://odis-signer2-alfajores.odis-signer2-alfajores:3000 yarn test:e2e", "test:e2e:mainnet:0": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=http://odis-signer0-mainnet.odis-signer0-mainnet:3000 yarn test:e2e", "test:e2e:mainnet:1": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=http://odis-signer1-mainnet.odis-signer1-mainnet:3000 yarn test:e2e", "test:signer:mainnet": "MAINNET_ODIS_BLOCKCHAIN_PROVIDER=https://alfajores-forno.celo-testnet.org CONTEXT_NAME=mainnet yarn jest test/end-to-end -t='\\[Signer configuration test\\]'", From 8bc13490decb1c418a375c0169e0c4da98de6bda Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Tue, 14 Nov 2023 11:50:47 -0500 Subject: [PATCH 06/13] bump signer ts-node --- apps/signer/package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/signer/package.json b/apps/signer/package.json index 35120ac25..4de8e73b4 100644 --- a/apps/signer/package.json +++ b/apps/signer/package.json @@ -81,7 +81,7 @@ "sqlite3": "^5.0.8", "supertest": "^6.2.3", "ts-mockito": "^2.6.1", - "ts-node": "^8.3.0", + "ts-node": "^10.9.1", "typescript": "^5.2.2" }, "engines": { diff --git a/yarn.lock b/yarn.lock index b5b5237e1..85e3b5b0d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2039,7 +2039,7 @@ __metadata: sqlite3: "npm:^5.0.8" supertest: "npm:^6.2.3" ts-mockito: "npm:^2.6.1" - ts-node: "npm:^8.3.0" + ts-node: "npm:^10.9.1" typescript: "npm:^5.2.2" languageName: unknown linkType: soft @@ -21581,7 +21581,7 @@ __metadata: languageName: node linkType: hard -"ts-node@npm:^8.3.0, ts-node@npm:^8.4.1": +"ts-node@npm:^8.4.1": version: 8.10.2 resolution: "ts-node@npm:8.10.2" dependencies: From d18f4342a9053b395c46a78d595b9e4e160ad0dd Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:17:06 -0500 Subject: [PATCH 07/13] auto-detect current version --- apps/signer/.env | 3 ++- apps/signer/src/config.ts | 5 ++++- apps/signer/test/end-to-end/disabled-apis.test.ts | 3 ++- apps/signer/test/end-to-end/domain.test.ts | 3 ++- apps/signer/test/end-to-end/pnp.test.ts | 4 ++-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/signer/.env b/apps/signer/.env index 17849657c..ab86d9eca 100644 --- a/apps/signer/.env +++ b/apps/signer/.env @@ -32,7 +32,8 @@ ALFAJORES_ODIS_BLOCKCHAIN_PROVIDER=https://alfajores-forno.celo-testnet.org MAINNET_ODIS_BLOCKCHAIN_PROVIDER=https://forno.celo.org ODIS_DOMAINS_TEST_KEY_VERSION=1 ODIS_PNP_TEST_KEY_VERSION=1 -DEPLOYED_SIGNER_SERVICE_VERSION=3.0.1 +# DEPLOYED_SIGNER_SERVICE_VERSION=3.1.1 + # PUBKEYS STAGING_DOMAINS_PUBKEY=7FsWGsFnmVvRfMDpzz95Np76wf/1sPaK0Og9yiB+P8QbjiC8FV67NBans9hzZEkBaQMhiapzgMR6CkZIZPvgwQboAxl65JWRZecGe5V3XO4sdKeNemdAZ2TzQuWkuZoA ALFAJORES_DOMAINS_PUBKEY=+ZrxyPvLChWUX/DyPw6TuGwQH0glDJEbSrSxUARyP5PuqYyP/U4WZTV1e0bAUioBZ6QCJMiLpDwTaFvy8VnmM5RBbLQUMrMg5p4+CBCqj6HhsMfcyUj8V0LyuNdStlCB diff --git a/apps/signer/src/config.ts b/apps/signer/src/config.ts index cc15a802d..40964944d 100644 --- a/apps/signer/src/config.ts +++ b/apps/signer/src/config.ts @@ -12,7 +12,9 @@ import BigNumber from 'bignumber.js' require('dotenv').config() export function getSignerVersion(): string { - return process.env.npm_package_version ?? '0.0.0' + return ( + process.env.DEPLOYED_SIGNER_SERVICE_VERSION ?? require('../package.json').version ?? '0.0.0' + ) } export const DEV_MODE = process.env.NODE_ENV !== 'production' export const VERBOSE_DB_LOGGING = toBool(process.env.VERBOSE_DB_LOGGING, false) @@ -102,6 +104,7 @@ export interface SignerConfig { } const env = process.env as any + export const config: SignerConfig = { serviceName: env.SERVICE_NAME ?? 'odis-signer', server: { diff --git a/apps/signer/test/end-to-end/disabled-apis.test.ts b/apps/signer/test/end-to-end/disabled-apis.test.ts index b2ac32098..14f07d2ff 100644 --- a/apps/signer/test/end-to-end/disabled-apis.test.ts +++ b/apps/signer/test/end-to-end/disabled-apis.test.ts @@ -21,6 +21,7 @@ import { import { defined, noBool, noNumber, noString } from '@celo/utils/lib/sign-typed-data-utils' import { LocalWallet } from '@celo/wallet-local' import 'isomorphic-fetch' +import { getSignerVersion } from '../../src/config' require('dotenv').config() const { ACCOUNT_ADDRESS1, BLINDED_PHONE_NUMBER, PRIVATE_KEY1 } = TestUtils.Values @@ -30,7 +31,7 @@ const ODIS_SIGNER = process.env.ODIS_SIGNER_SERVICE_URL jest.setTimeout(30000) -const expectedVersion = process.env.DEPLOYED_SIGNER_SERVICE_VERSION! +const expectedVersion = getSignerVersion() // These tests should be run when the individual APIs are disabled. // When run against enabled APIs, they should fail. diff --git a/apps/signer/test/end-to-end/domain.test.ts b/apps/signer/test/end-to-end/domain.test.ts index 94a8e0b91..c5cc40302 100644 --- a/apps/signer/test/end-to-end/domain.test.ts +++ b/apps/signer/test/end-to-end/domain.test.ts @@ -28,6 +28,7 @@ import { DomainRequest } from '@celo/phone-number-privacy-common/src' import { defined, noBool, noNumber, noString } from '@celo/utils/lib/sign-typed-data-utils' import { LocalWallet } from '@celo/wallet-local' import 'isomorphic-fetch' +import { getSignerVersion } from '../../src/config' import { getTestParamsForContext } from './utils' const { ACCOUNT_ADDRESS1, PRIVATE_KEY1 } = TestUtils.Values @@ -35,7 +36,7 @@ require('dotenv').config() jest.setTimeout(60000) -const expectedVersion = process.env.DEPLOYED_SIGNER_SERVICE_VERSION! +const expectedVersion = getSignerVersion() const ODIS_SIGNER_URL = process.env.ODIS_SIGNER_SERVICE_URL diff --git a/apps/signer/test/end-to-end/pnp.test.ts b/apps/signer/test/end-to-end/pnp.test.ts index b7222cab5..01c942a59 100644 --- a/apps/signer/test/end-to-end/pnp.test.ts +++ b/apps/signer/test/end-to-end/pnp.test.ts @@ -16,7 +16,7 @@ import { import threshold_bls from 'blind-threshold-bls' import { randomBytes } from 'crypto' import 'isomorphic-fetch' -import { config } from '../../src/config' +import { config, getSignerVersion } from '../../src/config' import { getBlindedPhoneNumber, getTestParamsForContext } from './utils' require('dotenv').config() @@ -43,7 +43,7 @@ kit.addAccount(PRIVATE_KEY3) jest.setTimeout(60000) -const expectedVersion = process.env.DEPLOYED_SIGNER_SERVICE_VERSION! +const expectedVersion = getSignerVersion() describe(`Running against service deployed at ${ODIS_SIGNER_URL}`, () => { const singleQueryCost = config.quota.queryPriceInCUSD.times(1e18).toString() From 96b5d3d9c6554c9d5577c717b56f7178eb3a59e6 Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:20:05 -0500 Subject: [PATCH 08/13] removed unused imports --- apps/signer/test/end-to-end/disabled-apis.test.ts | 1 - apps/signer/test/end-to-end/domain.test.ts | 1 - apps/signer/test/end-to-end/pnp.test.ts | 1 - 3 files changed, 3 deletions(-) diff --git a/apps/signer/test/end-to-end/disabled-apis.test.ts b/apps/signer/test/end-to-end/disabled-apis.test.ts index 14f07d2ff..a81dc55c9 100644 --- a/apps/signer/test/end-to-end/disabled-apis.test.ts +++ b/apps/signer/test/end-to-end/disabled-apis.test.ts @@ -20,7 +20,6 @@ import { } from '@celo/phone-number-privacy-common' import { defined, noBool, noNumber, noString } from '@celo/utils/lib/sign-typed-data-utils' import { LocalWallet } from '@celo/wallet-local' -import 'isomorphic-fetch' import { getSignerVersion } from '../../src/config' require('dotenv').config() diff --git a/apps/signer/test/end-to-end/domain.test.ts b/apps/signer/test/end-to-end/domain.test.ts index c5cc40302..d792d8c8c 100644 --- a/apps/signer/test/end-to-end/domain.test.ts +++ b/apps/signer/test/end-to-end/domain.test.ts @@ -27,7 +27,6 @@ import { import { DomainRequest } from '@celo/phone-number-privacy-common/src' import { defined, noBool, noNumber, noString } from '@celo/utils/lib/sign-typed-data-utils' import { LocalWallet } from '@celo/wallet-local' -import 'isomorphic-fetch' import { getSignerVersion } from '../../src/config' import { getTestParamsForContext } from './utils' const { ACCOUNT_ADDRESS1, PRIVATE_KEY1 } = TestUtils.Values diff --git a/apps/signer/test/end-to-end/pnp.test.ts b/apps/signer/test/end-to-end/pnp.test.ts index 01c942a59..010dc3c52 100644 --- a/apps/signer/test/end-to-end/pnp.test.ts +++ b/apps/signer/test/end-to-end/pnp.test.ts @@ -15,7 +15,6 @@ import { } from '@celo/phone-number-privacy-common' import threshold_bls from 'blind-threshold-bls' import { randomBytes } from 'crypto' -import 'isomorphic-fetch' import { config, getSignerVersion } from '../../src/config' import { getBlindedPhoneNumber, getTestParamsForContext } from './utils' From 9a28d14ac4067619417cb6af9b9c287ab889f064 Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:49:29 -0500 Subject: [PATCH 09/13] Updated Signer e2e test w/ externally exposed URL --- apps/signer/package.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/signer/package.json b/apps/signer/package.json index 4de8e73b4..12bced067 100644 --- a/apps/signer/package.json +++ b/apps/signer/package.json @@ -20,16 +20,16 @@ "test:coverage": "yarn test --coverage", "test:integration": "jest --runInBand test/integration", "test:integration:debugdb": "VERBOSE_DB_LOGGING=true jest --runInBand test/integration", - "test:e2e": "jest --runInBand test/end-to-end --testPathIgnorePatterns test/end-to-end/disabled-apis.test.ts", + "test:e2e": "jest --runInBand test/end-to-end/pnp --testPathIgnorePatterns test/end-to-end/disabled-apis.test.ts", "test:e2e:disabledapis": "jest --runInBand test/end-to-end/disabled-apis.test.ts", - "test:e2e:staging:0": "CONTEXT_NAME=staging ODIS_SIGNER_SERVICE_URL=http://odis-signer0-staging.odis-signer0-staging:3000 yarn test:e2e", - "test:e2e:staging:1": "CONTEXT_NAME=staging ODIS_SIGNER_SERVICE_URL=http://odis-signer1-staging.odis-signer1-staging:3000 yarn test:e2e", - "test:e2e:staging:2": "CONTEXT_NAME=staging ODIS_SIGNER_SERVICE_URL=http://odis-signer2-staging.odis-signer2-staging:3000 yarn test:e2e", - "test:e2e:alfajores:0": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=http://odis-signer0-alfajores.odis-signer0-alfajores:3000 yarn test:e2e", - "test:e2e:alfajores:1": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=http://odis-signer1-alfajores.odis-signer1-alfajores:3000 yarn test:e2e", - "test:e2e:alfajores:2": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=http://odis-signer2-alfajores.odis-signer2-alfajores:3000 yarn test:e2e", - "test:e2e:mainnet:0": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=http://odis-signer0-mainnet.odis-signer0-mainnet:3000 yarn test:e2e", - "test:e2e:mainnet:1": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=http://odis-signer1-mainnet.odis-signer1-mainnet:3000 yarn test:e2e", + "test:e2e:staging:0": "CONTEXT_NAME=staging ODIS_SIGNER_SERVICE_URL=https://odis-signer0-staging.integration-tests.celo-networks-dev.org yarn test:e2e", + "test:e2e:staging:1": "CONTEXT_NAME=staging ODIS_SIGNER_SERVICE_URL=https://odis-signer1-staging.integration-tests.celo-networks-dev.org yarn test:e2e", + "test:e2e:staging:2": "CONTEXT_NAME=staging ODIS_SIGNER_SERVICE_URL=https://odis-signer2-staging.integration-tests.celo-networks-dev.org yarn test:e2e", + "test:e2e:alfajores:0": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=https://odis-signer0-alfajores.alfajores.celo-testnet.org yarn test:e2e", + "test:e2e:alfajores:1": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=https://odis-signer1-alfajores.alfajores.celo-testnet.org yarn test:e2e", + "test:e2e:alfajores:2": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=https://odis-signer2-alfajores.alfajores.celo-testnet.org yarn test:e2e", + "test:e2e:mainnet:0": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=https://odis-signer0-mainnet.rc1-europe-west1.celo-testnet.org/ yarn test:e2e", + "test:e2e:mainnet:1": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=https://odis-signer1-mainnet.rc1-europe-west1.celo-testnet.org/ yarn test:e2e", "test:signer:mainnet": "MAINNET_ODIS_BLOCKCHAIN_PROVIDER=https://alfajores-forno.celo-testnet.org CONTEXT_NAME=mainnet yarn jest test/end-to-end -t='\\[Signer configuration test\\]'", "db:migrate": "ts-node scripts/run-migrations.ts", "db:migrate:make": "knex --migrations-directory ./src/common/database/migrations migrate:make -x ts", From 41e52c0a36a156e81fe8a7db6a1a70cc536e34e2 Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Tue, 14 Nov 2023 13:02:33 -0500 Subject: [PATCH 10/13] fix URL --- apps/signer/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/signer/package.json b/apps/signer/package.json index 12bced067..4d14ecc08 100644 --- a/apps/signer/package.json +++ b/apps/signer/package.json @@ -20,7 +20,7 @@ "test:coverage": "yarn test --coverage", "test:integration": "jest --runInBand test/integration", "test:integration:debugdb": "VERBOSE_DB_LOGGING=true jest --runInBand test/integration", - "test:e2e": "jest --runInBand test/end-to-end/pnp --testPathIgnorePatterns test/end-to-end/disabled-apis.test.ts", + "test:e2e": "jest --runInBand test/end-to-end --testPathIgnorePatterns test/end-to-end/disabled-apis.test.ts", "test:e2e:disabledapis": "jest --runInBand test/end-to-end/disabled-apis.test.ts", "test:e2e:staging:0": "CONTEXT_NAME=staging ODIS_SIGNER_SERVICE_URL=https://odis-signer0-staging.integration-tests.celo-networks-dev.org yarn test:e2e", "test:e2e:staging:1": "CONTEXT_NAME=staging ODIS_SIGNER_SERVICE_URL=https://odis-signer1-staging.integration-tests.celo-networks-dev.org yarn test:e2e", @@ -28,8 +28,8 @@ "test:e2e:alfajores:0": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=https://odis-signer0-alfajores.alfajores.celo-testnet.org yarn test:e2e", "test:e2e:alfajores:1": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=https://odis-signer1-alfajores.alfajores.celo-testnet.org yarn test:e2e", "test:e2e:alfajores:2": "CONTEXT_NAME=alfajores ODIS_SIGNER_SERVICE_URL=https://odis-signer2-alfajores.alfajores.celo-testnet.org yarn test:e2e", - "test:e2e:mainnet:0": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=https://odis-signer0-mainnet.rc1-europe-west1.celo-testnet.org/ yarn test:e2e", - "test:e2e:mainnet:1": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=https://odis-signer1-mainnet.rc1-europe-west1.celo-testnet.org/ yarn test:e2e", + "test:e2e:mainnet:0": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=https://odis-signer0-mainnet.rc1-europe-west1.celo-testnet.org yarn test:e2e", + "test:e2e:mainnet:1": "CONTEXT_NAME=mainnet ODIS_SIGNER_SERVICE_URL=https://odis-signer1-mainnet.rc1-europe-west1.celo-testnet.org yarn test:e2e", "test:signer:mainnet": "MAINNET_ODIS_BLOCKCHAIN_PROVIDER=https://alfajores-forno.celo-testnet.org CONTEXT_NAME=mainnet yarn jest test/end-to-end -t='\\[Signer configuration test\\]'", "db:migrate": "ts-node scripts/run-migrations.ts", "db:migrate:make": "knex --migrations-directory ./src/common/database/migrations migrate:make -x ts", From 4ff79cb79566d083d457ac5115b44f4935b5ff8e Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Wed, 15 Nov 2023 11:35:56 -0500 Subject: [PATCH 11/13] ++ user root in GH ations --- .github/workflows/social-connect.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/social-connect.yml b/.github/workflows/social-connect.yml index fbd372ec3..46539460f 100644 --- a/.github/workflows/social-connect.yml +++ b/.github/workflows/social-connect.yml @@ -42,6 +42,7 @@ jobs: runs-on: ['self-hosted', 'org', '8-cpu'] container: image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18 + options: --user root timeout-minutes: 30 steps: - name: Restore .git cache From ce05f127958d489d3e43d7a914197cadd24022e1 Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Wed, 15 Nov 2023 11:56:50 -0500 Subject: [PATCH 12/13] ++ git safe directories --- .github/workflows/social-connect.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/social-connect.yml b/.github/workflows/social-connect.yml index 46539460f..a7b9b1390 100644 --- a/.github/workflows/social-connect.yml +++ b/.github/workflows/social-connect.yml @@ -56,6 +56,9 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 + # Workaround for `detected dubious ownership` error + - name: Configure git safe directories + run: git config --global --add safe.directory '*' - name: Detect files changed in PR, and expose as output id: changed-files uses: tj-actions/changed-files@v39 From 12515595f89ffa4857ffec891742bcd63f58aae7 Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Thu, 16 Nov 2023 15:51:09 +0100 Subject: [PATCH 13/13] Undo ci workarounds --- .github/workflows/social-connect.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/social-connect.yml b/.github/workflows/social-connect.yml index a7b9b1390..fbd372ec3 100644 --- a/.github/workflows/social-connect.yml +++ b/.github/workflows/social-connect.yml @@ -42,7 +42,6 @@ jobs: runs-on: ['self-hosted', 'org', '8-cpu'] container: image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18 - options: --user root timeout-minutes: 30 steps: - name: Restore .git cache @@ -56,9 +55,6 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - # Workaround for `detected dubious ownership` error - - name: Configure git safe directories - run: git config --global --add safe.directory '*' - name: Detect files changed in PR, and expose as output id: changed-files uses: tj-actions/changed-files@v39