Skip to content

Optionally use new VSA backend on the project level

Adam Hegyi requested to merge 271538-replace-project-level-vsa-backend into master

What does this MR do?

Replace the old implementation of project level Value Stream Analytics (VSA, previously cycle analytics). The change is behind a feature flag (new_project_level_vsa_backend).

Note: This MR depends on !47812 (merged)

More context:

In 2019 we rebuilt the value stream analytics feature (frontend and backend) to work more efficiently on the group level (EE feature, example: https://gitlab.com/groups/gitlab-org/-/analytics/value_stream_analytics). The new backend was built in a way that can support the project level value stream analytics feature without major modifications. The old backend implementation has a few performance problems and misses important bugfixes. Because of this, the new VSA backend is not a drop-in replacement, I had to make a few changes in the old tests to make them pass (timing issues).

The new backend is extensively tested on both group and project level: https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/spec/lib/gitlab/analytics/cycle_analytics/data_collector_spec.rb#L468

Note: The old VSA implementation also has a Group level implementation (GroupLevel), which is no longer in use.

Plan for replacing project level VSA:

  • 13.7: Replace the backend implementation behind feature flag.
  • 13.8: Enable the new implementation by default and start eliminating the old code.
  • 13.x: Use the rewritten frontend (from group level)

Implementation:

The "switch" is introduced above the controller level (LevelBase class) where we mimic the behavior (old API) using an adapter class (StageAdapter). Note: this will be cleaned up as we eliminate the old code and reusing the new frontend from the group level.

How to test it:

  1. Seed VSA:
SEED_CYCLE_ANALYTICS=true FILTER=cycle_analytics rake db:seed_fu
  1. Visit the printed URL in the script output and navigate to Analytics / Value Stream. Page should load.
  2. Start a rails console and enable the FF: Feature.enable(:new_project_level_vsa_backend)
  3. Refresh the page and the page should still show up. (Slightly different numbers are expected)

Screenshots (strongly suggested)

image

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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 #271538 (closed)

Edited by Adam Hegyi

Merge request reports