Add sorting to integrated error tracking
What does this MR do?
Add support for sort
and limit
params in ErrorTracking::ErrorsFinder
. This way users can sort errors if integrated error tracking is enabled.
Integrated error tracking is a feature behind a feature flag. Issue #329596 (closed)
Database migrations
rake db:migrate
== 20210826124311 AddIndexToErrorTrackingError: migrating =====================
-- transaction_open?()
-> 0.0000s
-- index_exists?(:error_tracking_errors, [:project_id, :status, :last_seen_at], {:name=>"index_et_errors_on_project_id_and_status_and_last_seen_at", :algorithm=>:concurrently})
-> 0.0069s
-- execute("SET statement_timeout TO 0")
-> 0.0005s
-- add_index(:error_tracking_errors, [:project_id, :status, :last_seen_at], {:name=>"index_et_errors_on_project_id_and_status_and_last_seen_at", :algorithm=>:concurrently})
-> 0.0065s
-- execute("RESET statement_timeout")
-> 0.0005s
-- transaction_open?()
-> 0.0000s
-- index_exists?(:error_tracking_errors, [:project_id, :status, :first_seen_at], {:name=>"index_et_errors_on_project_id_and_status_and_first_seen_at", :algorithm=>:concurrently})
-> 0.0028s
-- add_index(:error_tracking_errors, [:project_id, :status, :first_seen_at], {:name=>"index_et_errors_on_project_id_and_status_and_first_seen_at", :algorithm=>:concurrently})
-> 0.0039s
-- transaction_open?()
-> 0.0000s
-- index_exists?(:error_tracking_errors, [:project_id, :status, :events_count], {:name=>"index_et_errors_on_project_id_and_status_and_events_count", :algorithm=>:concurrently})
-> 0.0022s
-- add_index(:error_tracking_errors, [:project_id, :status, :events_count], {:name=>"index_et_errors_on_project_id_and_status_and_events_count", :algorithm=>:concurrently})
-> 0.0031s
-- transaction_open?()
-> 0.0000s
-- index_exists?(:error_tracking_errors, [:project_id, :status, :id], {:name=>"index_et_errors_on_project_id_and_status_and_id", :algorithm=>:concurrently})
-> 0.0026s
-- add_index(:error_tracking_errors, [:project_id, :status, :id], {:name=>"index_et_errors_on_project_id_and_status_and_id", :algorithm=>:concurrently})
-> 0.0029s
== 20210826124311 AddIndexToErrorTrackingError: migrated (0.0409s) ============
rake db:rollback
== 20210826124311 AddIndexToErrorTrackingError: reverting =====================
-- transaction_open?()
-> 0.0000s
-- index_exists?(:error_tracking_errors, [:project_id, :status, :last_seen_at], {:name=>"index_et_errors_on_project_id_and_status_and_last_seen_at", :algorithm=>:concurrently})
-> 0.0042s
-- execute("SET statement_timeout TO 0")
-> 0.0005s
-- remove_index(:error_tracking_errors, {:name=>"index_et_errors_on_project_id_and_status_and_last_seen_at", :algorithm=>:concurrently, :column=>[:project_id, :status, :last_seen_at]})
-> 0.0067s
-- execute("RESET statement_timeout")
-> 0.0004s
-- transaction_open?()
-> 0.0000s
-- index_exists?(:error_tracking_errors, [:project_id, :status, :first_seen_at], {:name=>"index_et_errors_on_project_id_and_status_and_first_seen_at", :algorithm=>:concurrently})
-> 0.0021s
-- remove_index(:error_tracking_errors, {:name=>"index_et_errors_on_project_id_and_status_and_first_seen_at", :algorithm=>:concurrently, :column=>[:project_id, :status, :first_seen_at]})
-> 0.0036s
-- transaction_open?()
-> 0.0000s
-- index_exists?(:error_tracking_errors, [:project_id, :status, :events_count], {:name=>"index_et_errors_on_project_id_and_status_and_events_count", :algorithm=>:concurrently})
-> 0.0018s
-- remove_index(:error_tracking_errors, {:name=>"index_et_errors_on_project_id_and_status_and_events_count", :algorithm=>:concurrently, :column=>[:project_id, :status, :events_count]})
-> 0.0034s
-- transaction_open?()
-> 0.0000s
-- index_exists?(:error_tracking_errors, [:project_id, :status, :id], {:name=>"index_et_errors_on_project_id_and_status_and_id", :algorithm=>:concurrently})
-> 0.0015s
-- remove_index(:error_tracking_errors, {:name=>"index_et_errors_on_project_id_and_status_and_id", :algorithm=>:concurrently, :column=>[:project_id, :status, :id]})
-> 0.0036s
== 20210826124311 AddIndexToErrorTrackingError: reverted (0.0343s) ============
Screenshot
No changes in UI. We just make sort dropdown work for integrated error tracking. Before, it worked only for Sentry integration.
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) - [-] I have added/updated documentation, or it's not needed. (Is documentation required?)
- [-] I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?)
-
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Edited by Dmytro Zaporozhets (DZ)