Refactor BurnupChartService to handle iterations
What does this MR do?
Given milestone and iteration generate similar resource events this MR does a refactoring to be able to use the burnup chart service for both milestone and iteration timeboxes. It does not change the implementation(logic) itself from what was already implemented within !37636 (merged)
Migration
The iteration event tracking is still behind FF on gitlab.com and is only enabled for gitlab-org/gitlab, so we do not have too many resource_iteration_events
yet, but following the !37636 (merged) we will be needing an index on resource_milestone_events
for add
action as well for resource_iteration_events
as we are looking for first add
events for given issue, which may have many events.
Up
== 20200903092241 AddIndexToResourceIterationEventsAddEvents: migrating =======
-- transaction_open?()
-> 0.0000s
-- index_exists?(:resource_iteration_events, :iteration_id, {:where=>"action = 1", :name=>"index_resource_iterationn_events_on_iteration_id_and_add_action", :algorithm=>:concurrently})
-> 0.0026s
-- add_index(:resource_iteration_events, :iteration_id, {:where=>"action = 1", :name=>"index_resource_iterationn_events_on_iteration_id_and_add_action", :algorithm=>:concurrently})
-> 0.0046s
== 20200903092241 AddIndexToResourceIterationEventsAddEvents: migrated (0.0078s)
Down
== 20200903092241 AddIndexToResourceIterationEventsAddEvents: reverting =======
-- transaction_open?()
-> 0.0000s
-- index_exists?(:resource_iteration_events, :iteration_id, {:name=>"index_resource_iterationn_events_on_iteration_id_and_add_action", :algorithm=>:concurrently})
-> 0.0046s
-- remove_index(:resource_iteration_events, {:name=>"index_resource_iterationn_events_on_iteration_id_and_add_action", :algorithm=>:concurrently, :column=>:iteration_id})
-> 0.0052s
== 20200903092241 AddIndexToResourceIterationEventsAddEvents: reverted (0.0103s)
Screenshots
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