Skip to content

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.

error_tracking_list_v12_6

Does this MR meet the acceptance criteria?

Conformity

Edited by Dmytro Zaporozhets (DZ)

Merge request reports

Loading