"New cycle analytics stage and median data endpoints"
What does this MR do?
The current cycle analytics stage data endpoint (/groups/:group_id/-/cycle_analytics/events/:stage_id.json
) only returns data for the default cycle analytics stages. This MR updates the FE to fetch data from the stage records endpoint (/-/analytics/cycle_analytics/stages/:stage_id/records
) that returns data for both default and custom cycle analytics stages.
Additionally, the median calculations returned from the summary endpoint (/groups/:group_id/-/cycle_analytics
) only returns default stages. This MR updates the FE to iterate over all the stages and fetch median values from the stage median endpoint (/-/analytics/cycle_analytics/stages/:stage_id/median).
- Adds an additional state item
medians
, containing the calculated median value for each stage{ 11: "5 Days", 12: null, 13: "3 Days" ...}
- Adds the
REQUEST_STAGE_MEDIANS
,RECEIVE_STAGE_MEDIANS_SUCCESS
andRECEIVE_STAGE_MEDIANS_ERROR
vuex actions / mutations - Adds a frontend request for medians from
/-/analytics/cycle_analytics/stages/:stage_id/median
- Udpates the stage data request to fetch from
/-/analytics/cycle_analytics/stages/:stage_id/records
, replacing/groups/:group_id/-/cycle_analytics/events/:stage_id.json
- Checks if the stage is persisted in
transformRawStages
allowing the stage slug to be set correctly - Updates jest tests to use the new urls
Screenshots
No visual changes
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
Availability 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
Closes #34751 (closed)