Skip to content

chore: migrate rooms.changeArchivationState to new api pattern#39808

Open
Rohitgiri02 wants to merge 2 commits intoRocketChat:developfrom
Rohitgiri02:migrate/rooms.changeArchivationState
Open

chore: migrate rooms.changeArchivationState to new api pattern#39808
Rohitgiri02 wants to merge 2 commits intoRocketChat:developfrom
Rohitgiri02:migrate/rooms.changeArchivationState

Conversation

@Rohitgiri02
Copy link
Copy Markdown
Contributor

@Rohitgiri02 Rohitgiri02 commented Mar 23, 2026

Summary

This PR migrates rooms.changeArchivationState to the new API route style and removes its dedicated validator definition from rest-typings, keeping the schema local to the endpoint implementation.

What changed

  • Migrated rooms.changeArchivationState from deprecated API.v1.addRoute(...) to chained roomEndpoints.post(...).
  • Replaced validateParams usage with body schema for the migrated endpoint.
  • Added inline response validation (200, 400, 401) on the migrated route.
  • Removed the dedicated isRoomsChangeArchivationStateProps schema/type export from rest-typings.

tracked in :- RocketChat/Rocket.Chat-Open-API#150

Why

  • Aligns with API migration guidelines (addRoute and validateParams deprecation).
  • Reduces coupling to shared manual validator exports in rest-typings.
  • Keeps validation close to endpoint behavior for this migrated route.

Validation

  • Type diagnostics on changed files: no errors.
  • ESLint on changed files: no errors (warnings only, pre-existing in API file context).
  • yarn testapi -- --grep "rooms.changeArchivationState": no matching tests found (0 passing).

Scope

  • Only migration-related changes for rooms.changeArchivationState.
  • No unrelated endpoint behavior changes.

Summary by CodeRabbit

  • Refactor
    • Refactored the rooms.changeArchivationState API endpoint to an updated architectural pattern with improved validation and response handling.

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Mar 23, 2026

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

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 23, 2026

🦋 Changeset detected

Latest commit: cb6de5e

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

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 23, 2026

Walkthrough

The rooms.changeArchivationState endpoint is migrated from a top-level route registration to a chained API pattern. The request validator is relocated from a shared typings package to a local schema definition within the route handler.

Changes

Cohort / File(s) Summary
Changeset Documentation
.changeset/migrate-rooms-changeArchivationState-endpoint.md
Documents the migration of rooms.changeArchivationState to chained API pattern and removal of the exported validator from rest-typings.
Endpoint Migration
apps/meteor/app/api/server/v1/rooms.ts
Removes legacy top-level rooms.changeArchivationState route registration and adds it within the roomEndpoints chain with local AJV schema validator, explicit response schemas for status codes 200/400/401, and authRequired: true.
Type Definitions Cleanup
packages/rest-typings/src/v1/rooms.ts
Removes exported RoomsChangeArchivationStateProps type, isRoomsChangeArchivationStateProps validator, and the corresponding endpoint signature from RoomsEndpoints.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

type: chore

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately describes the main change: migrating the rooms.changeArchivationState endpoint to a new API pattern, which is the primary focus of this changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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.

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 3 files

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant