Skip to content

Conversation

@ggazzo
Copy link
Member

@ggazzo ggazzo commented Dec 1, 2025

Proposed changes (including videos or screenshots)

Issue(s)

FB-121

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced federated direct message detection using dynamic participant identifier analysis instead of fixed configuration.
    • Corrected Matrix event payload structure handling for improved federation compatibility.
    • Refined database configuration initialization for federation setup.
  • Chores

    • Updated federation SDK dependency to version 0.3.2 across all packages.
    • Integrated QASE test reporting into CI pipeline for enhanced test analytics and traceability.

✏️ Tip: You can customize this high-level summary in your review settings.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Dec 1, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Dec 1, 2025

⚠️ No Changeset found

Latest commit: 80d802c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR consolidates federation regression fixes and test enhancements per issue FB-121. Updates @rocket.chat/federation-sdk to 0.3.2, fixes MongoDB URL parsing in federation setup, corrects remote profile queries, adjusts DM federated member detection, updates Matrix event typings, adds Qase CI integration, and expands federation end-to-end tests for media handling and direct messages.

Changes

Cohort / File(s) Summary
Federation SDK dependency updates
apps/meteor/package.json, ee/packages/federation-matrix/package.json, packages/core-services/package.json
Bumped @rocket.chat/federation-sdk from 0.3.0 to 0.3.2 across three packages.
CI and Qase integration
.github/workflows/ci.yml, package.json
Added QASE_TESTOPS_JEST_API_TOKEN environment variable to integration and federation test steps; added jest-qase-reporter devDependency v^2.1.3.
Jest Qase configuration
ee/packages/federation-matrix/jest.config.federation.ts, ee/packages/federation-matrix/tests/setup-qase.ts
Added setupFilesAfterEnv and conditional Qase reporter to federation Jest config; introduced setup file that wraps describe/it/test to auto-register suites with Qase when token is present.
DM and room federation detection
apps/meteor/app/lib/server/functions/createRoom.ts, apps/meteor/server/methods/createDirectMessage.ts
Added ESLint disable and TODO notes in createRoom; updated createDirectMessage to dynamically detect federated members (usernames with ':' and '@') and set federated: true flag accordingly instead of hardcoded false.
Federation setup and profile query fixes
ee/packages/federation-matrix/src/setup.ts, ee/packages/federation-matrix/src/FederationMatrix.ts
Inlined MongoDB URI resolution in setup.ts; changed FederationMatrix.verifyMatrixIds to pass full matrixId as userId to federationSDK.queryProfileRemote instead of local portion.
Matrix event structure and typing updates
ee/packages/federation-matrix/src/events/room.ts, ee/packages/federation-matrix/src/helpers/message.parsers.ts
Updated room event handler to destructure from event object structure; updated MatrixMessageContent type to reference event.content path instead of content.
Test helper additions
apps/meteor/tests/data/file.helper.ts, ee/packages/federation-matrix/tests/helper/synapse-client.ts
Added three RC file helpers: uploadFileToRC, getFilesList, downloadFileAndVerifyBinary; added four SynapseClient methods: uploadFile, getRoomFileMessages, findFileMessageInRoom, downloadFileAndCompareBinary for federation media testing.
Federation end-to-end test expansions
ee/packages/federation-matrix/tests/end-to-end/messaging.spec.ts, ee/packages/federation-matrix/tests/end-to-end/room.spec.ts
Added comprehensive Media test suite covering RC and Element file uploads/downloads for image, PDF, video, audio, and text; added IRequestConfig typing and per-test user lifecycle (create/delete) for DM federation tests; removed hardcoded waits.
Test infrastructure cleanup
ee/packages/federation-matrix/tests/helper/ddp-listener.ts, ee/packages/federation-matrix/tests/resources/sample_text.txt
Removed debug console.log statements from DDP listener; added sample_text.txt resource file for media tests.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • DM federation detection logic (createDirectMessage.ts): Verify the hasFederatedMembers detection correctly identifies ':' and '@' patterns; ensure it doesn't break non-federated DM creation or introduce false positives.
  • Matrix profile query parameter change (FederationMatrix.ts): Confirm passing full matrixId instead of local portion aligns with updated federation-sdk 0.3.2 API expectations and doesn't regress remote profile lookups.
  • Event structure changes (room.ts, message.parsers.ts): Validate event object destructuring matches updated EventEmitter emit payload shape and that type references are correct.
  • Qase setup complexity (setup-qase.ts): Review the describe/it/test wrapping logic, stack management, and restoration behavior to ensure proper test registration and no side effects between test suites.
  • MongoDB URI inlining (setup.ts): Confirm that process.env.MONGO_URL || 'mongodb://localhost:3001/meteor' correctly handles the connection without dbName extraction and integrates properly with the federation SDK.

Possibly related PRs

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • rodrigok
  • sampaiodiego
  • ricardogarim

Poem

🐰 Federation fixes hop into place,
SDK bumped at a steady pace,
Mongo URLs parse without a hitch,
DMs detect federated rich,
Tests with Qase now certified—
Quality assured, all tested wide! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/fed-regressions

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d19bb8a and 80d802c.

⛔ Files ignored due to path filters (4)
  • ee/packages/federation-matrix/tests/resources/sample_audio.mp3 is excluded by !**/*.mp3
  • ee/packages/federation-matrix/tests/resources/sample_pdf.pdf is excluded by !**/*.pdf
  • ee/packages/federation-matrix/tests/resources/sample_video.webm is excluded by !**/*.webm
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (19)
  • .github/workflows/ci.yml (1 hunks)
  • apps/meteor/app/lib/server/functions/createRoom.ts (2 hunks)
  • apps/meteor/package.json (1 hunks)
  • apps/meteor/server/methods/createDirectMessage.ts (2 hunks)
  • apps/meteor/tests/data/file.helper.ts (1 hunks)
  • ee/packages/federation-matrix/jest.config.federation.ts (1 hunks)
  • ee/packages/federation-matrix/package.json (1 hunks)
  • ee/packages/federation-matrix/src/FederationMatrix.ts (1 hunks)
  • ee/packages/federation-matrix/src/events/room.ts (1 hunks)
  • ee/packages/federation-matrix/src/helpers/message.parsers.ts (1 hunks)
  • ee/packages/federation-matrix/src/setup.ts (1 hunks)
  • ee/packages/federation-matrix/tests/end-to-end/messaging.spec.ts (2 hunks)
  • ee/packages/federation-matrix/tests/end-to-end/room.spec.ts (4 hunks)
  • ee/packages/federation-matrix/tests/helper/ddp-listener.ts (0 hunks)
  • ee/packages/federation-matrix/tests/helper/synapse-client.ts (2 hunks)
  • ee/packages/federation-matrix/tests/resources/sample_text.txt (1 hunks)
  • ee/packages/federation-matrix/tests/setup-qase.ts (1 hunks)
  • package.json (1 hunks)
  • packages/core-services/package.json (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ggazzo ggazzo added this to the 7.13.0 milestone Dec 1, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2025

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.2GiB 1.2GiB +38MiB
rocketchat 368MiB 347MiB +21MiB
omnichannel-transcript-service 141MiB 132MiB +8.8MiB
queue-worker-service 141MiB 132MiB +8.8MiB
ddp-streamer-service 127MiB 127MiB +70KiB
account-service 114MiB 114MiB +53KiB
stream-hub-service 111MiB 111MiB +66KiB
authorization-service 111MiB 111MiB +58KiB
presence-service 111MiB 111MiB +55KiB

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["11/15 22:28", "11/16 01:28", "11/17 23:50", "11/18 22:53", "11/19 23:02", "11/21 16:49", "11/24 17:34", "11/27 22:32", "11/28 19:05", "12/01 15:59", "12/01 17:40 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.14]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "queue-worker-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.14]
  line "rocketchat" [0.36, 0.36, 0.35, 0.35, 0.35, 0.34, 0.34, 0.34, 0.34, 0.34, 0.36]
  line "stream-hub-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
Loading

Statistics (last 10 days):

  • 📊 Average: 1.5GiB
  • ⬇️ Minimum: 1.2GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 1.2GiB
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-37653
  • Baseline: develop
  • Timestamp: 2025-12-01 17:40:10 UTC
  • Historical data points: 10

Updated: Mon, 01 Dec 2025 17:40:11 GMT

@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-7.13.0@d19bb8a). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##             release-7.13.0   #37653   +/-   ##
=================================================
  Coverage                  ?   68.91%           
=================================================
  Files                     ?     3360           
  Lines                     ?   114278           
  Branches                  ?    20562           
=================================================
  Hits                      ?    78752           
  Misses                    ?    33431           
  Partials                  ?     2095           
Flag Coverage Δ
e2e 57.42% <ø> (?)
e2e-api 42.46% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ggazzo ggazzo marked this pull request as ready for review December 2, 2025 21:40
@ggazzo ggazzo requested review from a team as code owners December 2, 2025 21:40
Copilot AI review requested due to automatic review settings December 2, 2025 21:40
@ggazzo ggazzo merged commit fc2d609 into release-7.13.0 Dec 2, 2025
55 of 56 checks passed
@ggazzo ggazzo deleted the chore/fed-regressions branch December 2, 2025 21:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request addresses regressions in federation functionality by updating the federation SDK, fixing MongoDB configuration issues, adding comprehensive media file upload tests, and integrating Qase test reporting.

Key changes:

  • Updates @rocket.chat/federation-sdk from 0.3.0 to 0.3.2 and related event handler signatures
  • Fixes MongoDB URL handling in federation setup by removing unnecessary intermediate variables
  • Adds comprehensive media file upload tests for federated rooms (images, PDFs, videos, audio, text files)
  • Integrates Qase test reporting infrastructure for better test management
  • Implements DM federation detection based on Matrix-style user IDs

Reviewed changes

Copilot reviewed 19 out of 24 changed files in this pull request and generated no comments.

Show a summary per file
File Description
yarn.lock Updates federation-sdk and adds jest-qase-reporter dependencies
package.json (root) Adds jest-qase-reporter dev dependency
packages/core-services/package.json Updates federation-sdk to 0.3.2
ee/packages/federation-matrix/package.json Updates federation-sdk to 0.3.2
apps/meteor/package.json Updates federation-sdk to 0.3.2
ee/packages/federation-matrix/src/setup.ts Simplifies MongoDB URL handling
ee/packages/federation-matrix/src/helpers/message.parsers.ts Updates type path for event content
ee/packages/federation-matrix/src/events/room.ts Updates event handler to use new SDK signature
ee/packages/federation-matrix/src/FederationMatrix.ts Fixes variable reference bug (userId → matrixId)
apps/meteor/server/methods/createDirectMessage.ts Adds federation detection for DMs
apps/meteor/app/lib/server/functions/createRoom.ts Adds complexity eslint disable comment
ee/packages/federation-matrix/tests/setup-qase.ts Adds Qase test reporter setup
ee/packages/federation-matrix/tests/helper/synapse-client.ts Adds file upload/download methods
ee/packages/federation-matrix/tests/helper/ddp-listener.ts Removes debug console.log statements
ee/packages/federation-matrix/tests/end-to-end/room.spec.ts Adds DM creation tests
ee/packages/federation-matrix/tests/end-to-end/messaging.spec.ts Adds comprehensive media upload tests
ee/packages/federation-matrix/tests/resources/* Adds test media files
ee/packages/federation-matrix/jest.config.federation.ts Configures Qase reporter
.github/workflows/ci.yml Adds QASE_TESTOPS_JEST_API_TOKEN secret

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants