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: Allow different time units for retention policy #32425

Merged
merged 36 commits into from
Jun 21, 2024
Merged

Conversation

gabriellsh
Copy link
Member

@gabriellsh gabriellsh commented May 13, 2024

Proposed changes (including videos or screenshots)

image

Issue(s)

CORE-302
CORE-303

Steps to test or reproduce

Further comments

Copy link
Contributor

dionisio-bot bot commented May 13, 2024

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

Copy link

changeset-bot bot commented May 13, 2024

🦋 Changeset detected

Latest commit: 02b5ddf

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

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

Copy link

codecov bot commented May 13, 2024

Codecov Report

Attention: Patch coverage is 95.34884% with 4 lines in your changes missing coverage. Please review.

Project coverage is 56.59%. Comparing base (c0828b4) to head (02b5ddf).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #32425      +/-   ##
===========================================
+ Coverage    56.54%   56.59%   +0.04%     
===========================================
  Files         2484     2483       -1     
  Lines        54746    54790      +44     
  Branches     11305    11321      +16     
===========================================
+ Hits         30958    31007      +49     
- Misses       21139    21142       +3     
+ Partials      2649     2641       -8     
Flag Coverage Δ
unit 72.29% <98.64%> (+0.18%) ⬆️

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

@gabriellsh gabriellsh marked this pull request as ready for review May 15, 2024 17:18
@gabriellsh gabriellsh requested review from a team as code owners May 15, 2024 17:18
@scuciatto scuciatto added this to the 6.9 milestone May 16, 2024
Copy link
Member

@MarcosSpessatto MarcosSpessatto left a comment

Choose a reason for hiding this comment

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

Doing some local tests, looks like there's something weird going on with the feature.

1 - The callout seems wrong
image

2- Executing the branch locally, the values for the new settings look weird.
Screenshot 2024-05-17 151351

3 - It's not possible to use the same granularity if the user wants to override the global retention policy, we can use only days (old behavior)
Screenshot 2024-05-17 151731

4 - It seems the messages are not being pruned after the specified time (1 minute), I'm not sure if it's respecting what the callout says... Or if it's just not working.
image

apps/meteor/server/startup/migrations/v305.ts Outdated Show resolved Hide resolved
apps/meteor/server/startup/migrations/v305.ts Outdated Show resolved Hide resolved
@gabriellsh
Copy link
Member Author

gabriellsh commented May 20, 2024

@MarcosSpessatto

1 - The callout seems wrong

Will be fixed

2 - Executing the branch locally, the values for the new settings look weird.

Seems like an issue with the migration. I'm suspecting the packageValue is changing before the migration runs, so I'll have to do something different there

3 - 3 - It's not possible to use the same granularity if the user wants to override the global retention policy, we can use only days (old behavior)

There will be a fix to the input value but this form specifically will stay as it is for now. It was not part of the scope as far as I'm aware

4 - It seems the messages are not being pruned after the specified time (1 minute), I'm not sure if it's respecting what the callout says... Or if it's just not working.

This depends on the cron running, which is managed through settings above the ones I changed. Both callout and warning will be changing to reflect the cron time.

@scuciatto scuciatto modified the milestones: 6.9, 6.10 May 21, 2024
@scuciatto scuciatto modified the milestones: 6.10, 7.0 May 21, 2024
…retention

* 'develop' of github.com:RocketChat/Rocket.Chat: (36 commits)
  refactor: IntegrationHistory out of DB Watcher (#32502)
  fix: Message update being broadcasted without updated values (#32472)
  test: make api teams test fully independent (#31756)
  test: Fix test name (#32490)
  fix: streams being called with no logged user (#32489)
  feat: Un-encrypted messages not allowed in E2EE rooms (#32040)
  feat(UiKit): Users select (#31455)
  fix: Re-login same browser tab issues (#32479)
  chore: move all webclient code out of the COSS folders (#32273)
  chore(deps): bump thehanimo/pr-title-checker from 1.3.7 to 1.4.1 (#30619)
  fix: Don't show join default channels option for edit user form  (#31750)
  fix: CAS user merge not working (#32444)
  fix: Overriding Retention Policy not working (#32454)
  fix: `rooms.export` endpoint generates an empty export when given an invalid date (#32364)
  fix: "Allow Password Change for OAuth Users" setting is not honored in the "Forgot Password" flow (#32398)
  fix: Bypass trash when removing OTR system messages and read receipts (#32269)
  fix: Monitors dissapearing from Unit upon edit (#32393)
  fix: Link image preview not opening in gallery (#32391)
  feat: Allow visitors & integrations to access downloaded files after a room has closed (#32439)
  regression: Users tab misaligned (#32451)
  ...
@scuciatto scuciatto added this to the 6.10 milestone Jun 10, 2024
apps/meteor/server/startup/migrations/v305.ts Outdated Show resolved Hide resolved
apps/meteor/server/startup/migrations/v305.ts Outdated Show resolved Hide resolved
apps/meteor/server/startup/migrations/xrun.ts Outdated Show resolved Hide resolved
apps/meteor/server/startup/migrations/xrun.ts Outdated Show resolved Hide resolved
…retention

* 'develop' of github.com:RocketChat/Rocket.Chat:
  fix: Not possible to edit room without proper permission with retention policy enabled (#32547)
  feat: Apps-Engine Deno Runtime update (#31821)
  feat: E2EE room setup header (#32446)
  fix: E2EE thread main message reactivity (#32381)
  chore: Add telemetry to CI so we can get a better understanding of resource usage (#32113)
  fix: Long katex strings breaking overflow in x axis (#32609)
  fix: Force highlighted code language registration (#32507)
  fix: sidebar last message E2EE (#32431)
  chore: remove message column on moderation console (#32432)
  fix: Accepted Media Types settings validation (#32478)
@jessicaschelly jessicaschelly added the stat: QA assured Means it has been tested and approved by a company insider label Jun 19, 2024
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Jun 19, 2024
@gabriellsh gabriellsh dismissed stale reviews from KevLehman, ggazzo, and debdutdeb June 19, 2024 15:44

done

dougfabris
dougfabris previously approved these changes Jun 20, 2024
Copy link
Member

@dougfabris dougfabris left a comment

Choose a reason for hiding this comment

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

This is a really good and solid work.
Really well coded and you added great tests to cover your work.

My only concern here is related to the consistency of the feature. In my opinion we should have keep the same time unit possibilities when overriding retention policy in the rooms. But it seems a product decision to follow like this.

Because of that, I'm approving it on behalf of frontend team!

@ggazzo ggazzo dismissed stale reviews from dougfabris and MarcosSpessatto via 02b5ddf June 21, 2024 02:06
@ggazzo ggazzo merged commit dfa49bd into develop Jun 21, 2024
36 of 39 checks passed
@ggazzo ggazzo deleted the imp/retention branch June 21, 2024 02:36
This was referenced Jun 22, 2024
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.

9 participants