Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 22 additions & 43 deletions .github/workflows/ci-test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,17 @@ jobs:
# if building for production on develop branch or release, add suffix for coverage images
DOCKER_TAG_SUFFIX_ROCKETCHAT: ${{ inputs.coverage == matrix.mongodb-version && (github.event_name == 'release' || github.ref == 'refs/heads/develop') && '-cov' || '' }}
MONGODB_VERSION: ${{ matrix.mongodb-version }}
COVERAGE_DIR: '/tmp/coverage/${{ inputs.type }}'
COVERAGE_FILE_NAME: '${{ inputs.type }}-${{ matrix.shard }}.json'
COVERAGE_REPORTER: ${{ inputs.coverage == matrix.mongodb-version && 'json' || '' }}

strategy:
fail-fast: false
matrix:
mongodb-version: ${{ fromJSON(inputs.mongodb-version) }}
shard: ${{ fromJSON(inputs.shard) }}

name: MongoDB ${{ matrix.mongodb-version }}${{ inputs.db-watcher-disabled == 'false' && ' [legacy watchers]' || '' }} (${{ matrix.shard }}/${{ inputs.total-shard }})
name: MongoDB ${{ matrix.mongodb-version }}${{ inputs.db-watcher-disabled == 'false' && ' [legacy watchers]' || '' }}${{ inputs.coverage == matrix.mongodb-version && ' coverage' || '' }} (${{ matrix.shard }}/${{ inputs.total-shard }})

steps:
- name: Collect Workflow Telemetry
Expand Down Expand Up @@ -156,10 +159,11 @@ jobs:
docker compose -f docker-compose-ci.yml up -d httpbin

- name: Prepare code coverage directory
if: inputs.coverage == matrix.mongodb-version
run: |
mkdir -p /tmp/coverage
chmod 777 /tmp/coverage
set -o xtrace

mkdir -p $COVERAGE_DIR
chmod 777 $COVERAGE_DIR

- name: Start containers for CE
if: inputs.release == 'ce'
Expand All @@ -172,8 +176,6 @@ jobs:
env:
ENTERPRISE_LICENSE: ${{ inputs.enterprise-license }}
TRANSPORTER: ${{ inputs.transporter }}
COVERAGE_DIR: '/tmp/coverage'
COVERAGE_REPORTER: 'lcov'
DISABLE_DB_WATCHERS: ${{ inputs.db-watcher-disabled }}
run: |
DEBUG_LOG_LEVEL=${DEBUG_LOG_LEVEL:-0} docker compose -f docker-compose-ci.yml up -d --wait
Expand Down Expand Up @@ -201,16 +203,14 @@ jobs:
env:
WEBHOOK_TEST_URL: 'http://httpbin'
IS_EE: ${{ inputs.release == 'ee' && 'true' || '' }}
COVERAGE_DIR: '/tmp/coverage'
COVERAGE_REPORTER: 'lcovonly'
run: |
set -o xtrace

npm run testapi

docker compose -f ../../docker-compose-ci.yml stop

ls -l $COVERAGE_DIR
ls -la $COVERAGE_DIR
exit $s
Comment on lines +213 to 214
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix undefined variable in exit statement.

Line 214 attempts to exit with an undefined $s variable, causing unpredictable behavior. The variable is never defined in the script.

Capture the test exit status before the stop command and use it properly, or remove the exit statement if the step should pass:

           npm run testapi
+          TEST_STATUS=$?

           docker compose -f ../../docker-compose-ci.yml stop

           ls -la $COVERAGE_DIR
-          exit $s
+          exit $TEST_STATUS

Alternatively, if the step should always succeed after test completion:

           npm run testapi

           docker compose -f ../../docker-compose-ci.yml stop

           ls -la $COVERAGE_DIR || true
-          exit $s

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In .github/workflows/ci-test-e2e.yml around lines 213 to 214, the script calls
"exit $s" but $s is never defined; capture the test step exit status into a
variable immediately after the test command (e.g., s=$? or similar) before any
subsequent commands that might change $?, then use that variable in the exit
statement (exit $s), or if the step should always succeed simply remove the exit
statement so the job does not fail.


- name: E2E Test UI (${{ matrix.shard }}/${{ inputs.total-shard }})
Expand All @@ -235,9 +235,18 @@ jobs:
PLAYWRIGHT_RETRIES: ${{ inputs.retries }}
working-directory: ./apps/meteor
run: |
set -o xtrace

yarn prepare
yarn test:e2e --shard=${{ matrix.shard }}/${{ inputs.total-shard }}

- name: Merge ui coverage files
if: inputs.type == 'ui' && inputs.coverage == matrix.mongodb-version
working-directory: ./apps/meteor
run: |
npx nyc merge .nyc_output ${COVERAGE_DIR}/${COVERAGE_FILE_NAME}
ls -la $COVERAGE_DIR || true

- name: Store playwright test trace
if: inputs.type == 'ui' && always()
uses: actions/upload-artifact@v5
Expand All @@ -254,40 +263,10 @@ jobs:
if: failure()
run: docker compose -f docker-compose-ci.yml logs mongo

- name: Extract e2e:ee:coverage
if: inputs.coverage == matrix.mongodb-version && inputs.type == 'ui'
working-directory: ./apps/meteor
run: yarn test:e2e:nyc

- uses: codecov/codecov-action@v3
if: inputs.coverage == matrix.mongodb-version && inputs.type == 'ui'
with:
directory: ./apps/meteor
flags: e2e
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}

- uses: codecov/codecov-action@v3
if: inputs.coverage == matrix.mongodb-version && inputs.type == 'api'
with:
directory: /tmp/coverage
working-directory: .
flags: e2e-api
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Store e2e-api-ee-coverage
if: inputs.coverage == matrix.mongodb-version && inputs.type == 'api'
uses: actions/upload-artifact@v5
- name: Store coverage
if: inputs.coverage == matrix.mongodb-version
uses: actions/upload-artifact@v4
with:
name: e2e-api-ee-coverage-${{ matrix.mongodb-version }}-${{ matrix.shard }}
name: coverage-${{ inputs.type }}-${{ matrix.shard }}
path: /tmp/coverage
include-hidden-files: true

- name: Store e2e-ee-coverage
if: inputs.coverage == matrix.mongodb-version && inputs.type == 'ui'
uses: actions/upload-artifact@v5
with:
name: e2e-ee-coverage-${{ matrix.mongodb-version }}-${{ matrix.shard }}
path: ./apps/meteor/coverage*
include-hidden-files: true
63 changes: 57 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,7 @@ jobs:
uses: ./.github/actions/build-docker
if: matrix.service[1] && (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') && github.actor != 'dependabot[bot]'
env:
# add suffix for the extra images with coverage if building for production
DOCKER_TAG_SUFFIX_ROCKETCHAT: ${{ matrix.type == 'coverage' && (github.event_name == 'release' || github.ref == 'refs/heads/develop') && '-cov' || '' }}
DOCKER_TAG_SUFFIX_ROCKETCHAT: ${{ matrix.type == 'coverage' && '-cov' || '' }}
with:
CR_USER: ${{ secrets.CR_USER }}
CR_PAT: ${{ secrets.CR_PAT }}
Expand All @@ -344,8 +343,7 @@ jobs:
uses: ./.github/actions/build-docker
if: matrix.service[2] && (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') && github.actor != 'dependabot[bot]'
env:
# add suffix for the extra images with coverage if building for production
DOCKER_TAG_SUFFIX_ROCKETCHAT: ${{ matrix.type == 'coverage' && (github.event_name == 'release' || github.ref == 'refs/heads/develop') && '-cov' || '' }}
DOCKER_TAG_SUFFIX_ROCKETCHAT: ${{ matrix.type == 'coverage' && '-cov' || '' }}
with:
CR_USER: ${{ secrets.CR_USER }}
CR_PAT: ${{ secrets.CR_PAT }}
Expand All @@ -359,8 +357,7 @@ jobs:
uses: ./.github/actions/build-docker
if: matrix.service[3] && (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') && github.actor != 'dependabot[bot]'
env:
# add suffix for the extra images with coverage if building for production
DOCKER_TAG_SUFFIX_ROCKETCHAT: ${{ matrix.type == 'coverage' && (github.event_name == 'release' || github.ref == 'refs/heads/develop') && '-cov' || '' }}
DOCKER_TAG_SUFFIX_ROCKETCHAT: ${{ matrix.type == 'coverage' && '-cov' || '' }}
with:
CR_USER: ${{ secrets.CR_USER }}
CR_PAT: ${{ secrets.CR_PAT }}
Expand Down Expand Up @@ -588,6 +585,60 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
REPORTER_JIRA_ROCKETCHAT_API_KEY: ${{ secrets.REPORTER_JIRA_ROCKETCHAT_API_KEY }}

report-coverage:
name: 📊 Report Coverage
runs-on: ubuntu-24.04
needs: [release-versions, test-api-ee, test-ui-ee, test-ui-ee-watcher]

steps:
- uses: actions/checkout@v5

- name: Use Node.js
uses: actions/setup-node@v6.0.0
with:
node-version: ${{ needs.release-versions.outputs.node-version }}

- name: Restore coverage folder
uses: actions/download-artifact@v6
with:
pattern: coverage-*
path: /tmp/coverage
merge-multiple: true

- name: Generate lcov report
run: |
set -o xtrace

npx nyc report --reporter=lcovonly --report-dir=/tmp/coverage_report/api --temp-dir=/tmp/coverage/api
npx nyc report --reporter=lcovonly --report-dir=/tmp/coverage_report/ui --temp-dir=/tmp/coverage/ui

- name: Store coverage-reports
uses: actions/upload-artifact@v4
with:
name: reports-coverage
path: /tmp/coverage_report
include-hidden-files: true

- name: Report API coverage
uses: codecov/codecov-action@v3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Update deprecated Codecov action to v5.

The Codecov action v3 is deprecated and failing static analysis checks. Update to the latest v5 release:

      - name: Report API coverage
-        uses: codecov/codecov-action@v3
+        uses: codecov/codecov-action@v5
         with:
           fail_ci_if_error: true
           files: /tmp/coverage_report/api/lcov.info
           working-directory: .
           flags: e2e-api
           verbose: true
           token: ${{ secrets.CODECOV_TOKEN }}

       - name: Report UI coverage
-        uses: codecov/codecov-action@v3
+        uses: codecov/codecov-action@v5
         with:
           fail_ci_if_error: true
           files: /tmp/coverage_report/ui/lcov.info
           working-directory: .
           flags: e2e
           verbose: true
           token: ${{ secrets.CODECOV_TOKEN }}

Verify that input parameters (fail_ci_if_error, files, working-directory, flags, verbose, token) remain compatible with v5 API.

Also applies to: 678-678


I'll verify the key claims in the review comment about the Codecov action deprecation and version compatibility.





---

🏁 Script executed:

```shell
#!/bin/bash
# Verify the exact content at lines 668 and 678 in the CI workflow
find . -name "ci.yml" -path "*/.github/workflows/*" -type f | head -1 | xargs -I {} sed -n '665,682p' {}

Length of output: 539


🌐 Web query:

codecov/codecov-action v5 release notes breaking changes

💡 Result:

Key v5 breaking / changed items (from the official release notes):

  • Action now uses the Codecov Wrapper (encapsulates the CLI) — migration recommended to @v5. [1]
  • Deprecated/renamed inputs:
    • file → files (file deprecated). [1]
    • plugin → plugins (plugin deprecated). [1]
  • New inputs added: binary, gcov_args, gcov_executable, gcov_ignore, gcov_include, report_type, skip_validation, swift_project. [1]
  • Token/auth behavior: v5 coincides with the opt‑out global upload token feature for public repos (tokenless uploads behavior changed; see Codecov docs). OIDC is supported via use_oidc (id-token write permission required). [1][2]

References:
[1] codecov/codecov-action (v5 release notes) — GitHub.
[2] Codecov Action listing (Marketplace) — GitHub Marketplace.


🌐 Web query:

codecov-action v3 deprecation status

💡 Result:

Short answer: v3 is effectively deprecated/obsolete — Codecov has moved to newer actions (v4 uses the Codecov CLI; the repo/marketplace recommend using v5 or v4) and v3 (and earlier) will not receive the new CLI features/updates. Upgrade your workflows to v4/v5. (github.com)

Citations:


Update deprecated Codecov action from v3 to v5.

The Codecov action v3 is effectively deprecated; Codecov recommends upgrading to v4 or v5. The parameters you're using (fail_ci_if_error, files, working-directory, flags, verbose, token) remain compatible with v5, as the workflow already uses the files parameter—the correct naming for v5.

      - name: Report API coverage
-        uses: codecov/codecov-action@v3
+        uses: codecov/codecov-action@v5
         with:
           fail_ci_if_error: true
           files: /tmp/coverage_report/api/lcov.info
           working-directory: .
           flags: e2e-api
           verbose: true
           token: ${{ secrets.CODECOV_TOKEN }}

       - name: Report UI coverage
-        uses: codecov/codecov-action@v3
+        uses: codecov/codecov-action@v5
         with:
           fail_ci_if_error: true
           files: /tmp/coverage_report/ui/lcov.info
           working-directory: .
           flags: e2e
           verbose: true
           token: ${{ secrets.CODECOV_TOKEN }}

Also applies to: 678-678

🧰 Tools
🪛 actionlint (1.7.8)

668-668: the runner of "codecov/codecov-action@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
.github/workflows/ci.yml around lines 668 and 678: the workflow uses the
deprecated codecov/codecov-action@v3; update both occurrences to
codecov/codecov-action@v5 (or @v4 if preferred) keeping the existing parameters
(fail_ci_if_error, files, working-directory, flags, verbose, token) unchanged
since they are compatible with v5; ensure the action version string is replaced
and run a quick workflow lint/validate to confirm no further syntax changes are
required.

with:
fail_ci_if_error: true
files: /tmp/coverage_report/api/lcov.info
working-directory: .
flags: e2e-api
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Report UI coverage
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: /tmp/coverage_report/ui/lcov.info
working-directory: .
flags: e2e
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
Comment on lines +588 to +640
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Excellent coverage aggregation workflow, but update Codecov action version.

The new coverage reporting job successfully centralizes coverage handling by downloading artifacts, merging them with nyc, and uploading to Codecov. However, the static analysis correctly identifies that codecov/codecov-action@v3 is deprecated.

Update to the latest version to ensure compatibility with current GitHub Actions runners:

-      - name: Report API coverage
-        uses: codecov/codecov-action@v3
+      - name: Report API coverage
+        uses: codecov/codecov-action@v5
         with:
           fail_ci_if_error: true
           files: /tmp/coverage_report/api/lcov.info
           working-directory: .
           flags: e2e-api
           verbose: true
           token: ${{ secrets.CODECOV_TOKEN }}

-      - name: Report UI coverage
-        uses: codecov/codecov-action@v3
+      - name: Report UI coverage
+        uses: codecov/codecov-action@v5
         with:
           fail_ci_if_error: true
           files: /tmp/coverage_report/ui/lcov.info
           working-directory: .
           flags: e2e
           verbose: true
           token: ${{ secrets.CODECOV_TOKEN }}

Note: You may need to verify the API compatibility between v3 and v5, as some parameters might have changed.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
report-coverage:
name: 📊 Report Coverage
runs-on: ubuntu-24.04
needs: [release-versions, test-api-ee, test-ui-ee, test-ui-ee-watcher]
steps:
- uses: actions/checkout@v5
- name: Use Node.js
uses: actions/setup-node@v6.0.0
with:
node-version: ${{ needs.release-versions.outputs.node-version }}
- name: Restore coverage folder
uses: actions/download-artifact@v6
with:
pattern: coverage-*
path: /tmp/coverage
merge-multiple: true
- name: Generate lcov report
run: |
set -o xtrace
npx nyc report --reporter=lcovonly --report-dir=/tmp/coverage_report/api --temp-dir=/tmp/coverage/api
npx nyc report --reporter=lcovonly --report-dir=/tmp/coverage_report/ui --temp-dir=/tmp/coverage/ui
- name: Store coverage-reports
uses: actions/upload-artifact@v4
with:
name: reports-coverage
path: /tmp/coverage_report
include-hidden-files: true
- name: Report API coverage
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: /tmp/coverage_report/api/lcov.info
working-directory: .
flags: e2e-api
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Report UI coverage
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: /tmp/coverage_report/ui/lcov.info
working-directory: .
flags: e2e
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
report-coverage:
name: 📊 Report Coverage
runs-on: ubuntu-24.04
needs: [release-versions, test-api-ee, test-ui-ee, test-ui-ee-watcher]
steps:
- uses: actions/checkout@v5
- name: Use Node.js
uses: actions/setup-node@v6.0.0
with:
node-version: ${{ needs.release-versions.outputs.node-version }}
- name: Restore coverage folder
uses: actions/download-artifact@v6
with:
pattern: coverage-*
path: /tmp/coverage
merge-multiple: true
- name: Generate lcov report
run: |
set -o xtrace
npx nyc report --reporter=lcovonly --report-dir=/tmp/coverage_report/api --temp-dir=/tmp/coverage/api
npx nyc report --reporter=lcovonly --report-dir=/tmp/coverage_report/ui --temp-dir=/tmp/coverage/ui
- name: Store coverage-reports
uses: actions/upload-artifact@v4
with:
name: reports-coverage
path: /tmp/coverage_report
include-hidden-files: true
- name: Report API coverage
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: /tmp/coverage_report/api/lcov.info
working-directory: .
flags: e2e-api
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Report UI coverage
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: /tmp/coverage_report/ui/lcov.info
working-directory: .
flags: e2e
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
🧰 Tools
🪛 actionlint (1.7.8)

623-623: the runner of "codecov/codecov-action@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


633-633: the runner of "codecov/codecov-action@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
.github/workflows/ci.yml lines 588-640: the workflow uses the deprecated
codecov/codecov-action@v3; update the action reference to the current stable
major (e.g., codecov/codecov-action@v5) and adjust input names to match the new
API (verify token handling, files path, flags, fail_ci_if_error or equivalent,
working-directory and verbose flags) — replace the version tag, run a quick dry
CI to confirm no input name changes break the job, and update any parameter
names or behavior according to the v5 action docs.


tests-done:
name: ✅ Tests Done
runs-on: ubuntu-24.04
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"coverage": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' nyc -r html mocha --config ./.mocharc.js",
"test:e2e": "playwright test",
"test:e2e:federation": "playwright test --config=playwright-federation.config.ts",
"test:e2e:nyc": "nyc report --reporter=lcov",
"test:e2e:nyc": "nyc report --reporter=lcovonly",
"testapi": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' mocha --config ./.mocharc.api.js",
"testunit": "yarn .testunit:definition && yarn .testunit:client && yarn .testunit:server:cov",
".testunit:server": "mocha --config ./.mocharc.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import reports from 'istanbul-reports';
import libCoverage from 'istanbul-lib-coverage';

const dir = process.env.COVERAGE_DIR;
const fileName = process.env.COVERAGE_FILE_NAME;
const reporter = process.env.COVERAGE_REPORTER || 'lcov';

console.log('Coverage plugin started');
Expand Down Expand Up @@ -45,7 +46,8 @@ process.on('exit', async () => {
coverageMap,
});

const report = reports.create(reporter);
console.log('Generating coverage report', { dir, reporter, fileName });
const report = reports.create(reporter, { file: fileName });

report.execute(context);
} catch (e) {
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
rocketchat:
volumes:
- /tmp/coverage:/tmp/coverage
- ${COVERAGE_DIR:-/tmp/coverage}:${COVERAGE_DIR:-/tmp/coverage}
platform: linux/amd64
build:
dockerfile: ${GITHUB_WORKSPACE}/apps/meteor/.docker/Dockerfile.alpine
Expand All @@ -23,6 +23,7 @@ services:
- MOLECULER_LOG_LEVEL=info
- 'ROCKETCHAT_LICENSE=${ENTERPRISE_LICENSE}'
- 'COVERAGE_DIR=${COVERAGE_DIR}'
- 'COVERAGE_FILE_NAME=${COVERAGE_FILE_NAME}'
- 'COVERAGE_REPORTER=${COVERAGE_REPORTER}'
- DISABLE_DB_WATCHERS=${DISABLE_DB_WATCHERS}
- OVERWRITE_SETTING_Log_Level=${DEBUG_LOG_LEVEL:-0}
Expand Down Expand Up @@ -98,7 +99,6 @@ services:
- linux/arm64
args:
SERVICE: presence-service
DENO_VERSION: ${DENO_VERSION}
image: ghcr.io/${LOWERCASE_REPOSITORY}/presence-service:${DOCKER_TAG}
environment:
- MONGO_URL=mongodb://mongo:27017/rocketchat?replicaSet=rs0
Expand Down
Loading