Skip to content

Conversation

@d-gubert
Copy link
Member

@d-gubert d-gubert commented Apr 7, 2025

Proposed changes (including videos or screenshots)

Issue(s)

CONN-610

Steps to test or reproduce

Further comments


This pull request introduces a feature for managing multi-instance app status in the Rocket.Chat application. It includes the following changes:

  1. Cluster App Status Fetching: A new function is added to fetchAppsStatusFromCluster.ts to retrieve app statuses from a cluster, accommodating both Moleculer and high availability scenarios. It includes error handling for missing instances and ports.

  2. AppsEngineService Enhancements: New methods are added to the AppsEngineService class in service.ts for retrieving app status locally and across a cluster, along with necessary type imports and utility functions.

  3. Network and Local Broker Updates: The NetworkBroker and LocalBroker classes have updated method signatures for the call function, introducing an optional options parameter of type CallingOptions. A warning log is added in LocalBroker if options are provided.

  4. API and Interface Modifications:

    • The Api class and IApiService interface now include an optional options parameter in the call method.
    • A new type AppStatusReport and a method getAppsStatusInCluster are added to the IAppsEngineService interface.
    • The IBroker interface is updated to accept the new CallingOptions type as an optional parameter.
  5. Endpoint Authentication Change: The authentication requirement for the 'installed' endpoint in rest.ts is removed, with a comment questioning if there's a better approach.

  6. Core Services Module Organization: The index.ts file in core-services is updated to improve type safety and module organization through new exports and modifications to existing ones.

These changes aim to enhance the app status management capabilities in a multi-instance environment, improve type safety, and refine module organization.


This pull request introduces a feature to manage multi-instance app status within the Rocket.Chat application. Key changes include:

  1. Cluster App Status Fetching: A new function is added to fetchAppsStatusFromCluster.ts to retrieve app statuses from a cluster, accommodating both Moleculer and high availability scenarios. It includes error handling for missing instances and ports.

  2. AppsEngineService Enhancements: New methods are added to the AppsEngineService class in service.ts for retrieving app status locally and across a cluster.

  3. Network and Local Broker Updates: The NetworkBroker and LocalBroker classes have updated method signatures for the call function, introducing an optional options parameter of type CallingOptions.

  4. Type and Interface Modifications:

    • A new type AppStatusReport and a method getAppsStatusInCluster are added to the IAppsEngineService interface.
    • The CallingOptions type is introduced and integrated into various interfaces and method signatures to enhance flexibility and type safety.
  5. REST Endpoint Change: The authentication requirement for the 'installed' endpoint in rest.ts is removed, which may expose sensitive app information.

  6. Module Organization and Type Safety: Improvements in module organization and type safety are made through updated exports and imports in index.ts and Api.ts.

These changes aim to improve the management and retrieval of app statuses in a multi-instance environment, while also enhancing the flexibility and organization of the codebase.


This pull request introduces a new feature to the Rocket.Chat repository, specifically targeting the multi-instance app status functionality. The changes include:

  1. Cluster App Status Fetching: A new function is added to fetch the status of apps from a cluster, accommodating both Moleculer and high availability scenarios. It includes error handling for missing instances and ports, and processes app status data from the fetched results.

  2. AppsEngineService Enhancements: New methods are introduced to the AppsEngineService class for retrieving app status both locally and across a cluster. This includes necessary imports and utility functions.

  3. NetworkBroker and LocalBroker Updates:

    • The NetworkBroker class now includes a new method signature for the call function, with an optional options parameter of type CallingOptions, allowing for more flexible method calls.
    • The LocalBroker's call method is updated to support CallingOptions, maintaining backward compatibility and adding a warning for unsupported options.
  4. Type and Interface Modifications:

    • New types CallingOptions and AppStatusReport are introduced.
    • The IAppsEngineService interface now includes a getAppsStatusInCluster method.
    • The IBroker interface's call method is modified to accept the CallingOptions type as an optional parameter.
  5. API and Service Interface Improvements:

    • The Api class and IApiService interface are updated to import CallingOptions and extend the call method to accept an options parameter, enhancing method flexibility.
    • New exports and modifications in index.ts improve type safety and accessibility of various service interfaces.
  6. Security Consideration: The authentication requirement for the 'installed' endpoint in rest.ts is removed, which may expose sensitive app information to unauthorized users.

These changes aim to enhance the app status management across multiple instances in a cluster, while also improving the flexibility and type safety of service interfaces.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Apr 7, 2025

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

@changeset-bot
Copy link

changeset-bot bot commented Apr 7, 2025

🦋 Changeset detected

Latest commit: 74a1b94

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

This PR includes changesets to release 37 packages
Name Type
@rocket.chat/network-broker Minor
@rocket.chat/mock-providers Minor
@rocket.chat/pdf-worker Minor
@rocket.chat/core-services Minor
@rocket.chat/model-typings Minor
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
@rocket.chat/ui-contexts Major
@rocket.chat/ui-voip Major
@rocket.chat/models Minor
@rocket.chat/i18n Minor
@rocket.chat/meteor Minor
@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/stream-hub-service Patch
rocketchat-services Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/ui-client Major
@rocket.chat/web-ui-registration Major
@rocket.chat/omnichannel-services Patch
@rocket.chat/presence Patch
@rocket.chat/apps Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/license Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-video-conf Major
@rocket.chat/instance-status 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

@d-gubert d-gubert force-pushed the feat/status-in-cluster branch 4 times, most recently from 1a200cb to de52066 Compare April 14, 2025 12:11
@github-actions
Copy link
Contributor

github-actions bot commented Apr 14, 2025

PR Preview Action v1.6.1

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

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

@codecov
Copy link

codecov bot commented Apr 14, 2025

Codecov Report

Attention: Patch coverage is 79.62963% with 11 lines in your changes missing coverage. Please review.

Project coverage is 61.15%. Comparing base (79d0054) to head (74a1b94).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #35721      +/-   ##
===========================================
- Coverage    61.21%   61.15%   -0.07%     
===========================================
  Files         3001     3003       +2     
  Lines        71121    71350     +229     
  Branches     16241    16333      +92     
===========================================
+ Hits         43538    43634      +96     
- Misses       24620    24750     +130     
- Partials      2963     2966       +3     
Flag Coverage Δ
e2e 57.86% <ø> (+0.03%) ⬆️
unit 74.99% <79.62%> (-0.59%) ⬇️

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.

@d-gubert d-gubert force-pushed the feat/status-in-cluster branch 2 times, most recently from a32c218 to fe93d5e Compare April 14, 2025 13:05
@Al2Tul2 Al2Tul2 added this to the 7.6.0 milestone Apr 14, 2025
@d-gubert d-gubert force-pushed the feat/status-in-cluster branch 2 times, most recently from d35844c to d0a32de Compare April 14, 2025 21:43
@kody-ai
Copy link

kody-ai bot commented Apr 14, 2025

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

1 similar comment
@kody-ai
Copy link

kody-ai bot commented Apr 14, 2025

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

@kody-ai
Copy link

kody-ai bot commented Apr 14, 2025

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

@d-gubert d-gubert force-pushed the feat/status-in-cluster branch 2 times, most recently from abdf64c to 8ef0398 Compare April 15, 2025 17:50
@kody-ai
Copy link

kody-ai bot commented Apr 15, 2025

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

@d-gubert d-gubert force-pushed the feat/status-in-cluster branch from f27faa9 to 263c9ae Compare April 16, 2025 13:18
@kody-ai
Copy link

kody-ai bot commented Apr 16, 2025

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

@d-gubert d-gubert force-pushed the feat/status-in-cluster branch from 263c9ae to 2f74e06 Compare April 16, 2025 14:32
@d-gubert d-gubert marked this pull request as ready for review April 16, 2025 19:11
@d-gubert d-gubert requested review from a team as code owners April 16, 2025 19:11
@d-gubert d-gubert force-pushed the feat/status-in-cluster branch from e51594d to 397cd72 Compare April 17, 2025 15:55
@kody-ai
Copy link

kody-ai bot commented Apr 17, 2025

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

@d-gubert d-gubert force-pushed the feat/status-in-cluster branch from 5893867 to a0d92ea Compare April 18, 2025 15:07
@kody-ai
Copy link

kody-ai bot commented Apr 18, 2025

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

@sampaiodiego sampaiodiego added the stat: QA assured Means it has been tested and approved by a company insider label Apr 20, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Apr 20, 2025
@kody-ai
Copy link

kody-ai bot commented Apr 20, 2025

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

@sampaiodiego sampaiodiego merged commit d8eb824 into develop Apr 20, 2025
44 of 48 checks passed
@sampaiodiego sampaiodiego deleted the feat/status-in-cluster branch April 20, 2025 08:33
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants