Skip to content

Fix persisting multiple default VSA stages

Adam Hegyi requested to merge fix-persisting-multiple-vsa-default-stages into master

What does this MR do?

VSA - Value Stream Analytics (https://docs.gitlab.com/ee/user/analytics/value_stream_analytics.html)

In a previous MR we changed the relationship between Group and Value Stream Stage. Note: it's still behind a feature flag.

Now we have the following structure (Value Stream model was introduced in: !36658 (merged))

Group:

  • Value Stream 1 (has a name)
    • Stage 1 (has a name)
    • Stage 2
  • Value Stream 2
    • Stage 1
    • Stage 2

The bug (cannot be reproduced on the UI, added a test case in ee/spec/services/analytics/cycle_analytics/stages/create_service_spec.rb to reproduce it):

  1. Create a new value stream.
  2. Add a new stage to the value stream. This persists the stage and the 7 default stages that come with VSA by default.
  3. Create another value stream.
  4. Add a new stage.
  5. The new stage is persisted but the default stages are not.

Reason: We check for already created stages on the group level and not on the value stream level.

This MR also changes an index to have uniqueness on the stage name in scope of the group_id and the group_value_stream_id.

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
Edited by Adam Hegyi

Merge request reports

Loading