Refactor(Instance Analytics): use diff months util
What does this MR do?
This MR takes care of the first follow-up part of this ticket: #268224 (closed)
It moves to use the datetime_utility
getDifferenceInMonths
, which was introduced here: !45363 (merged), instead of a local computed calculation.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
To test this out, run bundle exec rails c
and run the following to enable the feature flag:
Feature.enable(:instance_statistics)
To ensure you have data to display in the chart run the following to seed the DB:
FILTER=instance_statistics bundle exec rake db:seed_fu
After that navigate here to see the page: http://localhost:3000/admin/instance_statistics
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers - [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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
Related to #268224 (closed)
Edited by Michael Lunøe