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

feat: Adds setting to ignore automatic messages on metrics #34274

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from

Conversation

lucas-a-pelegrino
Copy link
Member

@lucas-a-pelegrino lucas-a-pelegrino commented Dec 20, 2024

Proposed changes (including videos or screenshots)

This PR adds a new setting to consider or not automatic messages (bot messages) on response time metrics.

Issue(s)

CORE-668

Steps to test or reproduce

Further comments

@lucas-a-pelegrino lucas-a-pelegrino added this to the 7.3.0 milestone Dec 20, 2024
@lucas-a-pelegrino lucas-a-pelegrino self-assigned this Dec 20, 2024
Copy link
Contributor

dionisio-bot bot commented Dec 20, 2024

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 Dec 20, 2024

🦋 Changeset detected

Latest commit: 4221773

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/meteor Minor
@rocket.chat/i18n Minor
@rocket.chat/mock-providers Patch
@rocket.chat/ui-contexts Major
@rocket.chat/web-ui-registration Major
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/ui-client Major
@rocket.chat/ui-voip Major
@rocket.chat/uikit-playground Patch
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-video-conf Major
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
@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/freeswitch Patch
@rocket.chat/model-typings Patch
@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
@rocket.chat/license 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/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

Copy link
Contributor

github-actions bot commented Dec 20, 2024

PR Preview Action v1.6.0

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

Built to branch gh-pages at 2025-01-24 16:17 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@scuciatto scuciatto modified the milestones: 7.3.0, 7.4.0 Jan 20, 2025
Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.18%. Comparing base (f80ac66) to head (4221773).
Report is 5 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #34274    +/-   ##
=========================================
  Coverage    59.17%   59.18%            
=========================================
  Files         2822     2821     -1     
  Lines        68118    67699   -419     
  Branches     15145    15075    -70     
=========================================
- Hits         40312    40066   -246     
+ Misses       24975    24814   -161     
+ Partials      2831     2819    -12     
Flag Coverage Δ
unit 75.01% <100.00%> (+<0.01%) ⬆️

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

@lucas-a-pelegrino lucas-a-pelegrino marked this pull request as ready for review January 22, 2025 15:36
@lucas-a-pelegrino lucas-a-pelegrino requested review from a team as code owners January 22, 2025 15:36
tapiarafael
tapiarafael previously approved these changes Jan 22, 2025
.changeset/funny-turtles-hunt.md Outdated Show resolved Hide resolved
apps/meteor/tests/end-to-end/api/livechat/04-dashboards.ts Outdated Show resolved Hide resolved
packages/i18n/src/locales/en.i18n.json Outdated Show resolved Hide resolved
packages/i18n/src/locales/en.i18n.json Outdated Show resolved Hide resolved
packages/i18n/src/locales/en.i18n.json Outdated Show resolved Hide resolved
import type { IMessage, IUser } from '@rocket.chat/core-typings';
import { Users } from '@rocket.chat/models';

export async function isMessageFromBot(message: IMessage): Promise<boolean> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use Users.isUserInRole?

Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't aware of this method, definitely worth to use it.

Copy link
Member

Choose a reason for hiding this comment

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

Why not use the model method directly instead of creating this new template method (function)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Mainly, for readability.

lucas-a-pelegrino and others added 2 commits January 23, 2025 14:51
Co-authored-by: Marcos Spessatto Defendi <marcos.defendi@rocket.chat>
import type { IMessage, IUser } from '@rocket.chat/core-typings';
import { Users } from '@rocket.chat/models';

export async function isMessageFromBot(message: IMessage): Promise<boolean> {
Copy link
Member

Choose a reason for hiding this comment

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

Why not use the model method directly instead of creating this new template method (function)?

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.

6 participants