Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove restivus #34999

Merged
merged 39 commits into from
Jan 31, 2025
Merged

chore: remove restivus #34999

merged 39 commits into from
Jan 31, 2025

Conversation

ggazzo
Copy link
Member

@ggazzo ggazzo commented Jan 22, 2025

ARCH-1450

As part of the initiative to move rest to an external package, we must to remove dependencies related to meteor.
Restivus was a old library created to have access to webrouter, this is no longer the default, we have express exposed and its how we should create new endpoints.

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

Copy link
Contributor

dionisio-bot bot commented Jan 22, 2025

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 targeting the wrong base branch. It should target 7.4.0, but it targets 7.3.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

Copy link

changeset-bot bot commented Jan 22, 2025

⚠️ No Changeset found

Latest commit: 72fcf02

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

Copy link
Contributor

github-actions bot commented Jan 22, 2025

PR Preview Action v1.6.0

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

Built to branch gh-pages at 2025-01-31 22:27 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.27%. Comparing base (271894f) to head (72fcf02).
Report is 34 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #34999      +/-   ##
===========================================
+ Coverage    59.17%   59.27%   +0.09%     
===========================================
  Files         2822     2824       +2     
  Lines        68069    68240     +171     
  Branches     15136    15143       +7     
===========================================
+ Hits         40283    40450     +167     
- Misses       24956    24958       +2     
- Partials      2830     2832       +2     
Flag Coverage Δ
unit 75.17% <ø> (+0.16%) ⬆️

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

@ggazzo ggazzo force-pushed the chore/remove-restivus branch 22 times, most recently from bd105b6 to 73a9722 Compare January 24, 2025 20:43
@ggazzo ggazzo added this to the 7.4.0 milestone Jan 24, 2025
@ggazzo ggazzo force-pushed the chore/remove-restivus branch 2 times, most recently from 1dee994 to 07336e0 Compare January 24, 2025 22:49
Copy link

@Ricchkdbanks Ricchkdbanks left a comment

Choose a reason for hiding this comment

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

Please merge

@ggazzo ggazzo force-pushed the chore/remove-restivus branch from a40a882 to cd8051d Compare January 29, 2025 20:20
Copy link
Member

@KevLehman KevLehman left a comment

Choose a reason for hiding this comment

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

image
Not sure if this happened before, but enabling Prometheus and going to localhost:9458 returns this "index" page.

Should we keep? Should we remove?

Comment on lines +262 to +264
request.integration = await Integrations.findOne({
_id: request.params.integrationId,
token: decodeURIComponent(request.params.token),
});
Copy link
Member

Choose a reason for hiding this comment

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

Should we have this one on model? Can be done later, a TODO may be enough.
But if we can do it on here :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if I followed, do you mean create a 'getByIdAndToken' ? I dont think is related to the objetive of the pull request, this is 100% exactly how the previous code was doing

Copy link
Member

Choose a reason for hiding this comment

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

Yup, that's the idea. Agree on the oos, that's why I suggested the TODO. I'm tracking and fixing some of them.

apps/meteor/app/integrations/server/api/api.js Outdated Show resolved Hide resolved
@@ -87,6 +87,22 @@ API.v1.addRoute(
},
);

API.v1.addRoute(
'livechat/department/isDepartmentCreationAvailable',
Copy link
Member

Choose a reason for hiding this comment

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

So we have to be more worried about path collisions now :(

This is something that would be great to be shared somewhere so no one gets bitten by it.

Copy link
Member Author

Choose a reason for hiding this comment

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

why we should be more worried? to you have any extra explanation in mind? now at least we follow the same rules as express, it should be easy to find how it works

Copy link
Member

Choose a reason for hiding this comment

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

Oh, because we apparently used to support things like
path/:_id
path/something

Which express doesn't iirc.

apps/meteor/app/api/server/router.ts Outdated Show resolved Hide resolved
@ggazzo
Copy link
Member Author

ggazzo commented Jan 29, 2025

image Not sure if this happened before, but enabling Prometheus and going to localhost:9458 returns this "index" page.

Should we keep? Should we remove?

I think it is the exact same behavior :)

@julio-rocketchat
Copy link
Member

This PR will definitely help with Iron Bank and with our vulnerability management as a whole. We have some issues related to Restivus since it's an old package that uses old dependencies.

apps/meteor/app/api/server/api.ts Dismissed Show dismissed Hide dismissed
@ggazzo ggazzo force-pushed the chore/remove-restivus branch from fd8fb31 to 78b097a Compare January 31, 2025 21:26
@ggazzo ggazzo force-pushed the chore/remove-restivus branch from 78b097a to bc242f5 Compare January 31, 2025 21:54
@ggazzo ggazzo merged commit 263a7cb into develop Jan 31, 2025
48 checks passed
@ggazzo ggazzo deleted the chore/remove-restivus branch January 31, 2025 23:19
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