Fix persisting multiple default VSA stages
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):
- Create a new value stream.
- Add a new stage to the value stream. This persists the stage and the 7 default stages that come with VSA by default.
- Create another value stream.
- Add a new stage.
- 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
-
Changelog entry -
Documentation (if required) -
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 -
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