From fe97168531170d7721a5865fa0858d845425659c Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 2 May 2025 12:44:58 +0200 Subject: [PATCH 1/3] chore: skip Atlas Tests and don't track coverage for fork contributions Because some tests get skipped, we will have coverage test issues. Instead we'll now just check --- .github/workflows/code_health_fork.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code_health_fork.yaml b/.github/workflows/code_health_fork.yaml index bf8c408e..fabff19e 100644 --- a/.github/workflows/code_health_fork.yaml +++ b/.github/workflows/code_health_fork.yaml @@ -32,7 +32,7 @@ jobs: run-atlas-tests: name: Run Atlas tests - if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.head.repo.full_name != github.repository + if: github.event.pull_request.user.login == 'dependabot[bot]' runs-on: ubuntu-latest steps: - uses: GitHubSecurityLab/actions-permissions/monitor@v1 @@ -58,7 +58,7 @@ jobs: coverage: name: Report Coverage - if: always() && github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.head.repo.full_name != github.repository + if: github.event.pull_request.user.login == 'dependabot[bot]' runs-on: ubuntu-latest needs: [run-tests, run-atlas-tests] steps: From 054e1c621927be3f8a6cd54e3566a276c28536c1 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 2 May 2025 13:40:34 +0200 Subject: [PATCH 2/3] fix: adjust coverage --- .github/workflows/code_health.yaml | 2 - .github/workflows/code_health_fork.yaml | 59 ------------------------- 2 files changed, 61 deletions(-) diff --git a/.github/workflows/code_health.yaml b/.github/workflows/code_health.yaml index 46e95044..1451f36e 100644 --- a/.github/workflows/code_health.yaml +++ b/.github/workflows/code_health.yaml @@ -112,5 +112,3 @@ jobs: uses: coverallsapp/github-action@v2.3.6 with: file: coverage/lcov.info - git-branch: ${{ github.head_ref || github.ref_name }} - git-commit: ${{ github.event.pull_request.head.sha || github.sha }} diff --git a/.github/workflows/code_health_fork.yaml b/.github/workflows/code_health_fork.yaml index fabff19e..008df62e 100644 --- a/.github/workflows/code_health_fork.yaml +++ b/.github/workflows/code_health_fork.yaml @@ -30,65 +30,6 @@ jobs: name: test-results path: coverage/lcov.info - run-atlas-tests: - name: Run Atlas tests - if: github.event.pull_request.user.login == 'dependabot[bot]' - 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 - run: npm ci - - name: Run tests - env: - 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" - - name: Upload test results - uses: actions/upload-artifact@v4 - if: always() - with: - name: atlas-test-results - path: coverage/lcov.info - - coverage: - name: Report Coverage - if: github.event.pull_request.user.login == 'dependabot[bot]' - runs-on: ubuntu-latest - needs: [run-tests, run-atlas-tests] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version-file: package.json - cache: "npm" - - name: Install dependencies - run: npm ci - - name: Download test results - uses: actions/download-artifact@v4 - with: - name: test-results - path: coverage/mongodb - - name: Download atlas test results - uses: actions/download-artifact@v4 - with: - name: atlas-test-results - path: coverage/atlas - - name: Merge coverage reports - run: | - npx -y lcov-result-merger@5.0.1 "coverage/*/lcov.info" "coverage/lcov.info" - - name: Coveralls GitHub Action - uses: coverallsapp/github-action@v2.3.6 - with: - file: coverage/lcov.info - git-branch: ${{ github.head_ref || github.ref_name }} - git-commit: ${{ github.event.pull_request.head.sha || github.sha }} - merge-dependabot-pr: name: Merge Dependabot PR if: github.event.pull_request.user.login == 'dependabot[bot]' From d66d04a9c819c9935f6beea064d32916a0ecb2e7 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 2 May 2025 13:41:06 +0200 Subject: [PATCH 3/3] fix: dependabot merge requirements --- .github/workflows/code_health_fork.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_health_fork.yaml b/.github/workflows/code_health_fork.yaml index 008df62e..e1a9ec3c 100644 --- a/.github/workflows/code_health_fork.yaml +++ b/.github/workflows/code_health_fork.yaml @@ -38,7 +38,7 @@ jobs: pull-requests: write contents: write needs: - - coverage + - run-tests steps: - name: Enable auto-merge for Dependabot PRs run: gh pr merge --auto --squash "$PR_URL"