Draft: Change Devops adoption segment to be a single group only
What does this MR do?
Changes GraphQL endpoints to reflect new structure which binds devops report to groups.
THIS MR DOES NOT TARGET MASTER
How to use
Use old createDevopsAdoptionSegment
mutation as "enable devops adoption for namespace" and
deleteDevopsAdoptionSegment
to "disable devops adoption for namespace"
Database migrations output
== 20210121100038 AddDevopsAdoptionGroupSegment: migrating ====================
-- add_column(:analytics_devops_adoption_segments, :namespace_id, :integer, {:if_not_exists=>true})
-> 0.0051s
-- transaction_open?()
-> 0.0000s
-- index_exists?(:analytics_devops_adoption_segments, :namespace_id, {:unique=>true, :algorithm=>:concurrently})
-> 0.0056s
-- add_index(:analytics_devops_adoption_segments, :namespace_id, {:unique=>true, :algorithm=>:concurrently})
-> 0.0117s
== 20210121100038 AddDevopsAdoptionGroupSegment: migrated (0.0242s) ===========
== 20210121121102 OptionalDevopsAdoptionSegmentName: migrating ================
-- change_column_null(:analytics_devops_adoption_segments, :name, true)
-> 0.0026s
-- transaction_open?()
-> 0.0000s
-- indexes(:analytics_devops_adoption_segments)
-> 0.0056s
-- remove_index(:analytics_devops_adoption_segments, {:algorithm=>:concurrently, :name=>"index_analytics_devops_adoption_segments_on_name"})
-> 0.0049s
== 20210121121102 OptionalDevopsAdoptionSegmentName: migrated (0.0149s) =======
== 20210125105410 AddDevopsAdoptionSegmentNamespaceFk: migrating ==============
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:analytics_devops_adoption_segments)
-> 0.0050s
-- execute("ALTER TABLE analytics_devops_adoption_segments\nADD CONSTRAINT fk_f5aa768998\nFOREIGN KEY (namespace_id)\nREFERENCES namespaces (id)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0066s
-- execute("ALTER TABLE analytics_devops_adoption_segments VALIDATE CONSTRAINT fk_f5aa768998;")
-> 0.0035s
== 20210125105410 AddDevopsAdoptionSegmentNamespaceFk: migrated (0.0274s) =====
== 20210125105410 AddDevopsAdoptionSegmentNamespaceFk: reverting ==============
-- foreign_keys(:analytics_devops_adoption_segments)
-> 0.0065s
-- remove_foreign_key(:analytics_devops_adoption_segments, :namespaces, {:column=>:namespace_id})
-> 0.0093s
== 20210125105410 AddDevopsAdoptionSegmentNamespaceFk: reverted (0.0159s) =====
== 20210121121102 OptionalDevopsAdoptionSegmentName: reverting ================
-- transaction()
-- execute("DELETE FROM analytics_devops_adoption_segments WHERE name IS NULL")
-> 0.0036s
-- change_column_null(:analytics_devops_adoption_segments, :name, false)
-> 0.0030s
-> 0.0124s
-- transaction_open?()
-> 0.0000s
-- index_exists?(:analytics_devops_adoption_segments, :name, {:unique=>true, :name=>"index_analytics_devops_adoption_segments_on_name", :algorithm=>:concurrently})
-> 0.0051s
-- add_index(:analytics_devops_adoption_segments, :name, {:unique=>true, :name=>"index_analytics_devops_adoption_segments_on_name", :algorithm=>:concurrently})
-> 0.0184s
== 20210121121102 OptionalDevopsAdoptionSegmentName: reverted (0.0377s) =======
== 20210121100038 AddDevopsAdoptionGroupSegment: reverting ====================
-- remove_column(:analytics_devops_adoption_segments, :namespace_id)
-> 0.0065s
== 20210121100038 AddDevopsAdoptionGroupSegment: reverted (0.0066s) ===========
Screenshots (strongly suggested)
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
Related to #297583 (closed)
Edited by Pavel Shutsin