From 14741c794120d66d5c65f10beed656156d46369d Mon Sep 17 00:00:00 2001 From: Filipe C Menezes Date: Tue, 29 Apr 2025 12:25:50 +0100 Subject: [PATCH 1/4] ci: test to check dependencies --- .github/workflows/code_health.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/code_health.yaml b/.github/workflows/code_health.yaml index 55f485d82..727ad4c98 100644 --- a/.github/workflows/code_health.yaml +++ b/.github/workflows/code_health.yaml @@ -62,6 +62,26 @@ jobs: name: atlas-test-results path: coverage/lcov.info + dep-check: + name: Check dependencies + if: github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository + runs-on: ubuntu-latest + steps: + - uses: GitHubSecurityLab/actions-permissions/monitor@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: package.json + cache: "npm" + - name: Install dependencies & build + run: npm ci + - name: Remove dev dependencies + run: | + rm -rf node_modules + npm pkg set scripts.prepare="exit 0" + npm install --omit=dev + - run: npx -y @modelcontextprotocol/inspector --cli --method tools/list -- node dist/index.js --connectionString "mongodb://localhost" + coverage: name: Report Coverage if: always() && github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository From b99bdb5f73eb183ba7922403a1e4782af75fbe68 Mon Sep 17 00:00:00 2001 From: Filipe C Menezes Date: Tue, 29 Apr 2025 12:29:36 +0100 Subject: [PATCH 2/4] test: recreate bug --- package-lock.json | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index ad844d2f1..334e7a85d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,6 @@ "mongodb-log-writer": "^2.4.1", "mongodb-redact": "^1.1.6", "mongodb-schema": "^12.6.2", - "native-machine-id": "^0.1.0", "openapi-fetch": "^0.13.5", "simple-oauth2": "^5.1.0", "yargs-parser": "^21.1.1", @@ -45,6 +44,7 @@ "jest-environment-node": "^29.7.0", "jest-extended": "^4.0.2", "mongodb-runner": "^5.8.2", + "native-machine-id": "^0.1.0", "openapi-types": "^12.1.3", "openapi-typescript": "^7.6.1", "prettier": "^3.5.3", @@ -6467,6 +6467,7 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "devOptional": true, "license": "MIT", "dependencies": { "file-uri-to-path": "1.0.0" @@ -8786,6 +8787,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "devOptional": true, "license": "MIT" }, "node_modules/filelist": { @@ -11472,6 +11474,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/native-machine-id/-/native-machine-id-0.1.0.tgz", "integrity": "sha512-Po7OPcXGsWZ/o+n93ZOhmF3G5RQsEUMTnVddX45u5GfoEnk803ba7lhztwMkDaPhUFHy5FpXLiytIFitVxMkTA==", + "dev": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -11486,6 +11489,7 @@ "version": "8.3.1", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.3.1.tgz", "integrity": "sha512-lytcDEdxKjGJPTLEfW4mYMigRezMlyJY8W4wxJK8zE533Jlb8L8dRuObJFWg2P+AuOIxoCgKF+2Oq4d4Zd0OUA==", + "dev": true, "license": "MIT", "engines": { "node": "^18 || ^20 || >= 21" diff --git a/package.json b/package.json index a0090a403..aee5d3f44 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "jest-extended": "^4.0.2", "mongodb-runner": "^5.8.2", "openapi-types": "^12.1.3", + "native-machine-id": "^0.1.0", "openapi-typescript": "^7.6.1", "prettier": "^3.5.3", "ts-jest": "^29.3.1", @@ -69,7 +70,6 @@ "mongodb-log-writer": "^2.4.1", "mongodb-redact": "^1.1.6", "mongodb-schema": "^12.6.2", - "native-machine-id": "^0.1.0", "openapi-fetch": "^0.13.5", "simple-oauth2": "^5.1.0", "yargs-parser": "^21.1.1", From 5a698279b7c8c5e9dc79657321cdf7bfa1cee3e0 Mon Sep 17 00:00:00 2001 From: Filipe C Menezes Date: Tue, 29 Apr 2025 12:33:50 +0100 Subject: [PATCH 3/4] fix: atlas tests should skip unit --- .github/workflows/code_health.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_health.yaml b/.github/workflows/code_health.yaml index 727ad4c98..46e950447 100644 --- a/.github/workflows/code_health.yaml +++ b/.github/workflows/code_health.yaml @@ -54,7 +54,7 @@ jobs: MDB_MCP_API_CLIENT_ID: ${{ secrets.TEST_ATLAS_CLIENT_ID }} MDB_MCP_API_CLIENT_SECRET: ${{ secrets.TEST_ATLAS_CLIENT_SECRET }} MDB_MCP_API_BASE_URL: ${{ vars.TEST_ATLAS_BASE_URL }} - run: npm test -- --testPathIgnorePatterns "tests/integration/tools/mongodb" --testPathIgnorePatterns "tests/integration/[^/]+\.ts" + run: npm test -- --testPathIgnorePatterns "tests/unit" --testPathIgnorePatterns "tests/integration/tools/mongodb" --testPathIgnorePatterns "tests/integration/[^/]+\.ts" - name: Upload test results uses: actions/upload-artifact@v4 if: always() From 959fa6e65433476e58f5b3ec67eaa02349b1d7ff Mon Sep 17 00:00:00 2001 From: Filipe C Menezes Date: Tue, 29 Apr 2025 12:34:06 +0100 Subject: [PATCH 4/4] Revert "test: recreate bug" This reverts commit b99bdb5f73eb183ba7922403a1e4782af75fbe68. --- package-lock.json | 6 +----- package.json | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 334e7a85d..ad844d2f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ "mongodb-log-writer": "^2.4.1", "mongodb-redact": "^1.1.6", "mongodb-schema": "^12.6.2", + "native-machine-id": "^0.1.0", "openapi-fetch": "^0.13.5", "simple-oauth2": "^5.1.0", "yargs-parser": "^21.1.1", @@ -44,7 +45,6 @@ "jest-environment-node": "^29.7.0", "jest-extended": "^4.0.2", "mongodb-runner": "^5.8.2", - "native-machine-id": "^0.1.0", "openapi-types": "^12.1.3", "openapi-typescript": "^7.6.1", "prettier": "^3.5.3", @@ -6467,7 +6467,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "devOptional": true, "license": "MIT", "dependencies": { "file-uri-to-path": "1.0.0" @@ -8787,7 +8786,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "devOptional": true, "license": "MIT" }, "node_modules/filelist": { @@ -11474,7 +11472,6 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/native-machine-id/-/native-machine-id-0.1.0.tgz", "integrity": "sha512-Po7OPcXGsWZ/o+n93ZOhmF3G5RQsEUMTnVddX45u5GfoEnk803ba7lhztwMkDaPhUFHy5FpXLiytIFitVxMkTA==", - "dev": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -11489,7 +11486,6 @@ "version": "8.3.1", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.3.1.tgz", "integrity": "sha512-lytcDEdxKjGJPTLEfW4mYMigRezMlyJY8W4wxJK8zE533Jlb8L8dRuObJFWg2P+AuOIxoCgKF+2Oq4d4Zd0OUA==", - "dev": true, "license": "MIT", "engines": { "node": "^18 || ^20 || >= 21" diff --git a/package.json b/package.json index aee5d3f44..a0090a403 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,6 @@ "jest-extended": "^4.0.2", "mongodb-runner": "^5.8.2", "openapi-types": "^12.1.3", - "native-machine-id": "^0.1.0", "openapi-typescript": "^7.6.1", "prettier": "^3.5.3", "ts-jest": "^29.3.1", @@ -70,6 +69,7 @@ "mongodb-log-writer": "^2.4.1", "mongodb-redact": "^1.1.6", "mongodb-schema": "^12.6.2", + "native-machine-id": "^0.1.0", "openapi-fetch": "^0.13.5", "simple-oauth2": "^5.1.0", "yargs-parser": "^21.1.1",