Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ggazzo
Copy link
Member

@ggazzo ggazzo commented Aug 6, 2025

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • New Features

    • Deprecated endpoints configured for the next breaking release are now blocked from being registered in breaking-version deployments.
  • Chores

    • Deprecation tooling advanced to target version 9.0.0 and a changeset added for the major version bump.
    • Deprecation processing now short-circuits with TEST_MODE guards to prevent side effects during tests.
    • Removed public server-method registration for the deprecated e2e.updateGroupKey; the underlying exported function remains.

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

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Aug 6, 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 Aug 6, 2025

🦋 Changeset detected

Latest commit: eb67ea9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 40 packages
Name Type
@rocket.chat/meteor Major
@rocket.chat/core-typings Major
@rocket.chat/rest-typings Major
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/gazzodown Major
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-client Major
@rocket.chat/ui-contexts Major
@rocket.chat/ui-voip Major
@rocket.chat/web-ui-registration Major
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/abac Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/license Patch
@rocket.chat/media-calls Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-video-conf Major
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch

Not sure what this means? Click here to learn what changesets are.

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

@ggazzo ggazzo added this to the 8.0.0 milestone Aug 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

PR Preview Action v1.6.2

🚀 View preview at
https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-36647/

Built to branch gh-pages at 2025-08-06 20:14 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@codecov
Copy link

codecov bot commented Aug 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.42%. Comparing base (3c42f0d) to head (9a70e3a).
⚠️ Report is 419 commits behind head on release-8.0.0.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           release-8.0.0   #36647      +/-   ##
=================================================
+ Coverage          66.43%   68.42%   +1.98%     
=================================================
  Files               3276     2877     -399     
  Lines             109596   101934    -7662     
  Branches           20860    17729    -3131     
=================================================
- Hits               72814    69747    -3067     
+ Misses             34116    30538    -3578     
+ Partials            2666     1649    -1017     
Flag Coverage Δ
e2e-api ?
unit 72.26% <ø> (+0.69%) ⬆️

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 force-pushed the release-8.0.0 branch 2 times, most recently from 33ea06e to 9505de9 Compare August 19, 2025 18:12
@ggazzo ggazzo force-pushed the chore/break-deprecations branch 2 times, most recently from 9588c6c to c9f8809 Compare August 28, 2025 21:07
@ggazzo ggazzo marked this pull request as ready for review August 28, 2025 21:08
@ggazzo ggazzo requested a review from a team as a code owner August 28, 2025 21:08
@ggazzo ggazzo requested review from a team as code owners September 4, 2025 18:47
@ggazzo ggazzo force-pushed the release-8.0.0 branch 3 times, most recently from e19fae0 to 0d1c2a5 Compare September 4, 2025 19:18
@juliajforesti juliajforesti force-pushed the chore/break-deprecations branch from 78a372d to 5a6c610 Compare September 11, 2025 19:58
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

Walkthrough

Adds an early deprecation guard in ApiClass.addRoute that throws when a route's deprecation version should break, bumps planned deprecation version to 9.0.0 and adds TEST_MODE short-circuit throws in the deprecation logger, updates two parameter deprecation calls to 9.0.0, and removes the Meteor method registration for e2e.updateGroupKey.

Changes

Cohort / File(s) Summary
API route deprecation guard
apps/meteor/app/api/server/ApiClass.ts
Adds an early check in addRoute: if options.deprecation exists and shouldBreakInVersion(options.deprecation.version) returns true, throws Meteor.Error('error-deprecated', "The endpoint {route} should be removed") before registering the route. Existing wrapping (auth, rate limiting, permissions, error handling) is unchanged.
Deprecation logger type & TEST_MODE guards
apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts
Updates DeprecationLoggerNextPlannedVersion to include '9.0.0' and adds TEST_MODE guards that throw early in multiple deprecation paths to short-circuit normal processing during tests (api endpoint, parameter, deprecatedParameterUsage, method parameter/usage, warn).
Parameter deprecation version bumps
apps/meteor/app/api/server/helpers/parseJsonQuery.ts
Updates two apiDeprecationLogger.parameter calls to reference version 9.0.0 instead of 8.0.0. No other logic changes.
Remove Meteor method registration
apps/meteor/app/e2e/server/methods/updateGroupKey.ts
Removes the Meteor.methods registration, related ServerMethods augmentation/imports, Meteor import, and methodDeprecationLogger import. The exported updateGroupKey function signature remains unchanged and is now used directly.
Changeset
.changeset/twelve-feet-repeat.md
Adds a changeset documenting removal of the deprecated e2e.updateGroupKey method and a package major version bump.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Caller as addRoute caller
  participant Api as ApiClass.addRoute
  participant Dep as shouldBreakInVersion
  participant Router as Route registry

  Caller->>Api: addRoute(route, options, action)
  Api->>Api: inspect options.deprecation
  alt deprecation present
    Api->>Dep: shouldBreakInVersion(options.deprecation.version)
    Dep-->>Api: true
    Api-->>Caller: throw Meteor.Error('error-deprecated', "The endpoint {route} should be removed")
    Note over Api,Caller: Registration aborted before wrapping/registration
  else not breaking
    Api->>Router: register wrapped action (auth, rate-limit, perms, error handling)
    Router-->>Caller: route registered
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Focus areas:
    • apps/meteor/app/api/server/ApiClass.ts — ensure throwing during route registration is safe for startup, tests, and dynamic registration.
    • apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts — verify TEST_MODE guards do not disrupt test harnesses or expected telemetry.
    • apps/meteor/app/e2e/server/methods/updateGroupKey.ts — confirm no remaining DDP callers expect the removed method.

Possibly related PRs

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • dougfabris
  • aleksandernsilva

Poem

I hop through branches, nose a-flutter,
I spot the routes that time will shutter,
When nine comes round I sound the bell,
"This endpoint's gone" — I stamp and tell,
Carrots, tests, and tidy clutter. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions throwing errors for deprecated endpoints, which aligns with the main change in APIClass.ts where a deprecation guard was added to throw errors for deprecated endpoints.
✨ 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/break-deprecations

📜 Recent review details

Configuration used: Organization 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 b5daa07 and eb67ea9.

📒 Files selected for processing (5)
  • .changeset/twelve-feet-repeat.md (1 hunks)
  • apps/meteor/app/api/server/ApiClass.ts (1 hunks)
  • apps/meteor/app/api/server/helpers/parseJsonQuery.ts (2 hunks)
  • apps/meteor/app/e2e/server/methods/updateGroupKey.ts (0 hunks)
  • apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts (6 hunks)
💤 Files with no reviewable changes (1)
  • apps/meteor/app/e2e/server/methods/updateGroupKey.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/meteor/app/api/server/helpers/parseJsonQuery.ts
  • apps/meteor/app/api/server/ApiClass.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts
🧠 Learnings (1)
📚 Learning: 2025-09-19T15:15:04.642Z
Learnt from: rodrigok
Repo: RocketChat/Rocket.Chat PR: 36991
File: apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts:219-221
Timestamp: 2025-09-19T15:15:04.642Z
Learning: The Federation_Matrix_homeserver_domain setting in apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts is part of the old federation system and is being deprecated/removed, so configuration issues with this setting should not be flagged for improvement.

Applied to files:

  • .changeset/twelve-feet-repeat.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (4)
.changeset/twelve-feet-repeat.md (1)

1-5: LGTM! Changeset documentation is clear and appropriate.

The changeset correctly documents the major version bump for @rocket.chat/meteor and clearly describes the removal of the deprecated e2e.updateGroupKey method. The format follows the standard changeset structure.

apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts (3)

27-27: LGTM! Type narrowing to '9.0.0' is appropriate.

The update to DeprecationLoggerNextPlannedVersion correctly reflects the next planned major version for deprecation removal, aligning with the release-8.0.0 target branch and the move to version 9.0.0 for future deprecations.


34-36: LGTM! TEST_MODE guard correctly placed before compareVersions.

The TEST_MODE guard is properly positioned before compareVersions (line 38), ensuring tests fail fast when deprecated endpoints are called. This ordering is consistent with the intended test-mode behavior.


88-90: LGTM! TEST_MODE guards consistently placed across all remaining methods.

All other deprecation methods (deprecatedParameterUsage, method.method, method.parameter, method.deprecatedParameterUsage, and method.warn) have TEST_MODE guards correctly positioned before their respective compareVersions calls, ensuring consistent fail-fast behavior in test mode.

Also applies to: 112-114, 121-123, 145-147, 157-159


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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/meteor/app/api/server/ApiClass.ts (1)

808-810: Fail-fast removal guard: enrich error and confirm startup-crash intent

Throwing during route registration will fail server startup once the planned version is reached. If that’s the goal, keep it—otherwise gate behind an env flag or only enforce in CI/TEST.

Minimal improvement: include method and planned version to aid triage.

-				if (options.deprecation && shouldBreakInVersion(options.deprecation.version)) {
-					throw new Meteor.Error('error-deprecated', `The endpoint ${route} should be removed`);
-				}
+				if (options.deprecation && shouldBreakInVersion(options.deprecation.version)) {
+					const planned = options.deprecation.version;
+					throw new Meteor.Error(
+						'error-deprecated',
+						`The endpoint ${this.getFullRouteName(route, method)} is scheduled for removal in ${planned} and must be removed`,
+						{ endpoint: route, method, planned },
+					);
+				}

If you prefer a softer rollout aligned with the logger’s env knob, consider:

// near other consts
const hardFailDeprecatedRoutes = process.env.ROCKET_CHAT_DEPRECATION_HARD_FAIL !== 'false';
- if (options.deprecation && shouldBreakInVersion(options.deprecation.version)) {
+ if (options.deprecation && shouldBreakInVersion(options.deprecation.version) && hardFailDeprecatedRoutes) {
    // throw...
  }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 31fd755 and 57d3db7.

📒 Files selected for processing (2)
  • apps/meteor/app/api/server/ApiClass.ts (1 hunks)
  • apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/meteor/app/api/server/ApiClass.ts (1)
apps/meteor/server/lib/shouldBreakInVersion.ts (1)
  • shouldBreakInVersion (5-5)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (1)
apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts (1)

27-27: Type narrowed to '9.0.0' — repo still contains '7.0.0' callers; update callers or centralize

Scan found these literal occurrences — update them to match the new planned version or centralize the version constant:

  • apps/meteor/client/views/admin/workspace/VersionCard/getVersionStatus.spec.ts:175,183
  • apps/meteor/ee/server/api/engagementDashboard/channels.ts:63
  • apps/meteor/app/authorization/server/methods/removeUserFromRole.ts:44
  • apps/meteor/app/authorization/server/methods/addUserToRole.ts:44
  • apps/meteor/app/api/server/v1/oauthapps.ts:296 (apiDeprecationLogger.parameter(..., '7.0.0', ...))

Optional refactor (centralize the version):

-export type DeprecationLoggerNextPlannedVersion = '9.0.0';
+export const NEXT_BREAKING_VERSION = '9.0.0' as const;
+export type DeprecationLoggerNextPlannedVersion = typeof NEXT_BREAKING_VERSION;

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/meteor/app/api/server/ApiClass.ts (1)

810-812: LGTM! Consider enhancing the error message with version info.

The pre-registration deprecation guard correctly prevents deprecated endpoints from being registered when they should break in the current version. This fail-fast approach ensures deprecated endpoints are removed before release.

Consider including the deprecation version in the error message for better developer experience:

-				if (options.deprecation && shouldBreakInVersion(options.deprecation.version)) {
-					throw new Meteor.Error('error-deprecated', `The endpoint ${route} should be removed`);
-				}
+				if (options.deprecation && shouldBreakInVersion(options.deprecation.version)) {
+					throw new Meteor.Error('error-deprecated', `The endpoint ${route} should be removed (deprecated since ${options.deprecation.version})`);
+				}
📜 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 57d3db7 and 7188097.

📒 Files selected for processing (2)
  • apps/meteor/app/api/server/ApiClass.ts (1 hunks)
  • apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/meteor/app/api/server/ApiClass.ts (1)
apps/meteor/app/livechat/server/methods/getAnalyticsChartData.ts (1)
  • options (18-38)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: Builds matrix rust bindings against alpine
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (1)
apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts (1)

27-27: Type alias matches the new removal target.

Locking DeprecationLoggerNextPlannedVersion to '9.0.0' enforces the cleanup of anything slated for ≤8.x before this release, which is exactly what we want here. 👍

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/meteor/app/api/server/ApiClass.ts (1)

810-812: Good enforcement strategy; consider enriching the error message.

Throwing at registration time (during startup) is the right approach to prevent deprecated endpoints from being used past their removal deadline. This ensures teams can't accidentally deploy code with expired deprecations.

Consider including the deprecation version in the error message for better debugging:

-if (options.deprecation && shouldBreakInVersion(options.deprecation.version)) {
-    throw new Meteor.Error('error-deprecated', `The endpoint ${route} should be removed`);
-}
+if (options.deprecation && shouldBreakInVersion(options.deprecation.version)) {
+    throw new Meteor.Error('error-deprecated', `The endpoint ${route} is deprecated for version ${options.deprecation.version} and should be removed`);
+}
📜 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 7188097 and ddb885e.

📒 Files selected for processing (2)
  • apps/meteor/app/api/server/ApiClass.ts (1 hunks)
  • apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/meteor/app/api/server/ApiClass.ts (1)
apps/meteor/app/livechat/server/methods/getAnalyticsChartData.ts (1)
  • options (18-38)

@ggazzo ggazzo force-pushed the release-8.0.0 branch 3 times, most recently from d14079a to 381143c Compare December 19, 2025 20:20
@ggazzo ggazzo force-pushed the chore/break-deprecations branch from f335608 to 0027044 Compare December 19, 2025 20:55
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/meteor/app/api/server/ApiClass.ts (1)

817-819: Enhance error message to include deprecation version for better developer experience.

The deprecation guard correctly prevents registration of endpoints marked for removal in the current version. However, the error message could be more informative by including the deprecation version, helping developers understand why removal is required.

🔎 Suggested enhancement
 if (options.deprecation && shouldBreakInVersion(options.deprecation.version)) {
-    throw new Meteor.Error('error-deprecated', `The endpoint ${route} should be removed`);
+    throw new Meteor.Error('error-deprecated', `The endpoint ${route} was marked for removal in version ${options.deprecation.version} and must be removed`);
 }

Optional efficiency improvement: The rate limiter rules are added (lines 789-795) before this deprecation check. Consider moving this check earlier in the method to avoid unnecessary setup for endpoints that will be rejected. However, this is a minor optimization since the endpoint won't register anyway.

📜 Review details

Configuration used: Organization 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 f335608 and 0027044.

📒 Files selected for processing (2)
  • apps/meteor/app/api/server/ApiClass.ts (1 hunks)
  • apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/api/server/ApiClass.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Organization 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 0027044 and 35b6d32.

📒 Files selected for processing (3)
  • apps/meteor/app/api/server/helpers/parseJsonQuery.ts (2 hunks)
  • apps/meteor/app/e2e/server/methods/updateGroupKey.ts (0 hunks)
  • apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts (6 hunks)
💤 Files with no reviewable changes (1)
  • apps/meteor/app/e2e/server/methods/updateGroupKey.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/api/server/helpers/parseJsonQuery.ts
  • apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts
🧠 Learnings (1)
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts

Applied to files:

  • apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts
🧬 Code graph analysis (1)
apps/meteor/app/api/server/helpers/parseJsonQuery.ts (1)
apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts (1)
  • apiDeprecationLogger (29-101)
🔇 Additional comments (3)
apps/meteor/app/api/server/helpers/parseJsonQuery.ts (1)

60-60: Version bump correctly addresses previous review feedback.

The deprecation version has been updated from '8.0.0' to '9.0.0' for both fields and query parameters, aligning with the type narrowing in deprecationWarningLogger.ts and addressing the past review comment about updating all call sites.

Also applies to: 109-109

apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts (2)

27-27: Type narrowing to '9.0.0' is correct.

The type has been appropriately narrowed to enforce the new planned deprecation version across all deprecation logger call sites.


34-36: TEST_MODE guards correctly enforce deprecations in test mode.

The TEST_MODE guards are properly placed before compareVersions and other deprecation processing, ensuring that tests fail immediately when deprecated APIs are invoked. This aligns with the PR objective to add error throwing for deprecation warnings in test mode.

Also applies to: 88-90, 112-114, 121-123, 145-147, 157-159

@ggazzo ggazzo force-pushed the release-8.0.0 branch 2 times, most recently from 7254b63 to f9e1ff2 Compare December 19, 2025 22:08
@ggazzo ggazzo force-pushed the chore/break-deprecations branch from 35b6d32 to aee918d Compare December 19, 2025 22:12
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts (1)

59-63: Fix TEST_MODE guard ordering in parameter method.

The TEST_MODE guard is placed after compareVersions (line 59), creating inconsistent behavior with all other deprecation logger methods where the guard precedes version comparison. If compareVersions throws when ROCKET_CHAT_DEPRECATION_THROW_ERRORS_FOR_VERSIONS_UNDER is set, the TEST_MODE guard never executes, defeating its purpose.

🔎 Proposed fix to move TEST_MODE guard before compareVersions
         }) ?? `The parameter "${parameter}" in the endpoint "${endpoint}" is deprecated and will be removed on version ${version}`;
-    compareVersions(version, message);
-
     if (process.env.TEST_MODE === 'true') {
         throw new Error(message);
     }
 
+    compareVersions(version, message);
+
     metrics.deprecations.inc({ type: 'parameter-deprecation', kind: 'endpoint', name: endpoint, params: parameter });
🧹 Nitpick comments (1)
apps/meteor/app/api/server/ApiClass.ts (1)

817-819: Consider enhancing the error message with the deprecation version.

The error message could be more helpful by including the deprecation version, making it clearer why the endpoint must be removed.

🔎 Suggested enhancement
 if (options.deprecation && shouldBreakInVersion(options.deprecation.version)) {
-    throw new Meteor.Error('error-deprecated', `The endpoint ${route} should be removed`);
+    throw new Meteor.Error('error-deprecated', `The endpoint ${route} was marked for removal in version ${options.deprecation.version} and must be removed`);
 }
📜 Review details

Configuration used: Organization 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 35b6d32 and aee918d.

📒 Files selected for processing (4)
  • apps/meteor/app/api/server/ApiClass.ts (1 hunks)
  • apps/meteor/app/api/server/helpers/parseJsonQuery.ts (2 hunks)
  • apps/meteor/app/e2e/server/methods/updateGroupKey.ts (0 hunks)
  • apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts (6 hunks)
💤 Files with no reviewable changes (1)
  • apps/meteor/app/e2e/server/methods/updateGroupKey.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/app/api/server/helpers/parseJsonQuery.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/api/server/ApiClass.ts
  • apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build

@ggazzo ggazzo changed the title feat: Throw error if deprecation endpoint deprecated should be removed chore: Throw error if deprecation endpoint deprecated should be removed Dec 20, 2025
@ggazzo ggazzo force-pushed the chore/break-deprecations branch 3 times, most recently from dc95dea to e805619 Compare December 20, 2025 04:52
@ggazzo ggazzo force-pushed the chore/break-deprecations branch from e805619 to 3f76e7a Compare December 20, 2025 05:02
@ggazzo ggazzo force-pushed the chore/break-deprecations branch from 3f76e7a to b5daa07 Compare December 20, 2025 15:10
@ggazzo ggazzo force-pushed the chore/break-deprecations branch from b5daa07 to eb67ea9 Compare December 20, 2025 17:47
@ggazzo ggazzo merged commit 22cdc8e into release-8.0.0 Dec 20, 2025
40 checks passed
@ggazzo ggazzo deleted the chore/break-deprecations branch December 20, 2025 18:28
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.

4 participants