Extend Events lifetime to 3 years instead of 2
What does this MR do?
Temporary solution until #24538 (closed) is implemented.
Closes #33840 (closed)
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Merge request reports
Activity
changed milestone to %12.4
mentioned in issue #24538 (closed)
added 1 commit
- 95c8177a - Extend Events lifetime to 3 years instead of 2
Reviewer roulette
Changes that require review have been detected! A merge request is normally reviewed by both a reviewer and a maintainer in its primary category (e.g. frontend or backend), and by a maintainer in all other categories.
To spread load more evenly across eligible reviewers, Danger has randomly picked a candidate for each review slot. Feel free to override this selection if you think someone else would be better-suited, or the chosen person is unavailable.
Once you've decided who will review this merge request, mention them as you normally would! Danger does not (yet?) automatically notify them for you.
Category Reviewer Maintainer backend Vladimir Shushlin ( @vshushlin
)Bob Van Landuyt ( @reprazent
)Generated by
DangerEdited by 🤖 GitLab Bot 🤖added 1 commit
- 4785846d - Extend Events lifetime to 3 years instead of 2
added Pick into auto-deploy label
mentioned in commit 554414f5
Approved and merged, thanks @ifarkas @jeremy
Added Pick into auto-deploy given the potential data loss risk
Edited by Thong Kuahremoved Pick into auto-deploy label
mentioned in commit 98540b79
6 6 7 7 # rubocop: disable CodeReuse/ActiveRecord 8 8 def perform 9 # Contribution calendar shows maximum 12 months of events, we retain 2 years for data integrity. 9 # Contribution calendar shows maximum 12 months of events, we retain 3 years for data integrity. 10 10 # Double nested query is used because MySQL doesn't allow DELETE subqueries on the same table. 11 11 Event.unscoped.where( 12 12 '(id IN (SELECT id FROM (?) ids_to_remove))', 13 13 Event.unscoped.where( 14 14 'created_at < ?', 15 (2.years + 1.day).ago) 15 (3.years + 1.day).ago) @ifarkas If we only display the last 12 months of data, why do we query up to 3 years of data? That seems a little redundant.
@yorickpeterse, that's correct, it seems a little redundant for now. However, we might want to extend / build new functionality on top of that data. Eg. extending user's contribution history (like GitHub does) or using it for analytics. See #24538 (closed).
mentioned in commit Dalahro/gitlab@4d1a3d31
mentioned in issue #119109 (closed)
mentioned in issue gitlab-org/database-team/team-tasks#79 (closed)