Skip to content

fix: add TEST_MODE=true to OAuth ratelimiter's 'skip'#40650

Merged
julio-rocketchat merged 1 commit into
release-8.5.0from
fix-oauth-rate-limiter-in-ci
May 22, 2026
Merged

fix: add TEST_MODE=true to OAuth ratelimiter's 'skip'#40650
julio-rocketchat merged 1 commit into
release-8.5.0from
fix-oauth-rate-limiter-in-ci

Conversation

@julio-rocketchat
Copy link
Copy Markdown
Member

@julio-rocketchat julio-rocketchat commented May 22, 2026

Proposed changes (including videos or screenshots)

The OAuth ratelimiter introduced in the #39760 doesn't skip properly when running in the CI. This PR adds TEST_MODE=true to it.

Issue(s)

https://rocketchat.atlassian.net/browse/SB-997

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Chores
    • Improved OAuth testing configuration by enabling rate limiting bypass during test mode, streamlining the development workflow.

Review Change Stack

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented May 22, 2026

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 22, 2026

⚠️ No Changeset found

Latest commit: 605d536

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
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9f8f1d5e-a88d-4d53-a325-3a490029c631

📥 Commits

Reviewing files that changed from the base of the PR and between 6cd9662 and 605d536.

📒 Files selected for processing (1)
  • apps/meteor/server/configuration/configurePassport.ts
📜 Recent review details
⏰ 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: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
  • GitHub Check: 🔨 Test UI (CE) / MongoDB 8.0 (2/4)
🧰 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/server/configuration/configurePassport.ts
🧠 Learnings (3)
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/server/configuration/configurePassport.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/server/configuration/configurePassport.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/server/configuration/configurePassport.ts
🔇 Additional comments (1)
apps/meteor/server/configuration/configurePassport.ts (1)

58-61: LGTM!


Walkthrough

This PR updates the OAuth route rate limiter configuration to skip throttling during test mode. When the TEST_MODE environment variable is set to 'true', requests to OAuth paths will no longer be rate-limited, simplifying test execution.

Changes

OAuth rate limiter test mode bypass

Layer / File(s) Summary
Test mode rate limiter bypass
apps/meteor/server/configuration/configurePassport.ts
The rate limiter skip callback is extended to bypass throttling when process.env.TEST_MODE === 'true', allowing OAuth requests to pass without rate limiting during test execution.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested labels

type: bug

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding TEST_MODE bypass to the OAuth rate limiter's skip logic, which directly corresponds to the changeset that extends the skip callback to bypass rate limiting in test mode.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 69.68%. Comparing base (6cd9662) to head (605d536).
⚠️ Report is 4 commits behind head on release-8.5.0.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           release-8.5.0   #40650      +/-   ##
=================================================
+ Coverage          69.64%   69.68%   +0.03%     
=================================================
  Files               3338     3338              
  Lines             123232   123243      +11     
  Branches           21949    21979      +30     
=================================================
+ Hits               85830    85880      +50     
+ Misses             34046    34005      -41     
- Partials            3356     3358       +2     
Flag Coverage Δ
e2e 59.17% <ø> (-0.05%) ⬇️
e2e-api 45.97% <0.00%> (+0.04%) ⬆️
unit 70.53% <ø> (+0.06%) ⬆️

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.

@julio-rocketchat julio-rocketchat marked this pull request as ready for review May 22, 2026 12:20
@julio-rocketchat julio-rocketchat requested a review from a team as a code owner May 22, 2026 12:20
@julio-rocketchat julio-rocketchat added this to the 8.6.0 milestone May 22, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

KevLehman
KevLehman previously approved these changes May 22, 2026
@KevLehman KevLehman added the stat: QA assured Means it has been tested and approved by a company insider label May 22, 2026
@julio-rocketchat julio-rocketchat changed the base branch from develop to release-8.5.0 May 22, 2026 14:17
@julio-rocketchat julio-rocketchat dismissed KevLehman’s stale review May 22, 2026 14:17

The base branch was changed.

@julio-rocketchat julio-rocketchat modified the milestones: 8.6.0, 8.5.0 May 22, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label May 22, 2026
@julio-rocketchat julio-rocketchat merged commit be11acd into release-8.5.0 May 22, 2026
83 of 85 checks passed
@julio-rocketchat julio-rocketchat deleted the fix-oauth-rate-limiter-in-ci branch May 22, 2026 14:18
@julio-rocketchat julio-rocketchat restored the fix-oauth-rate-limiter-in-ci branch May 22, 2026 14:18
@ggazzo ggazzo deleted the fix-oauth-rate-limiter-in-ci branch May 22, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants