Skip to content

Show incident details page via `issues/incident/:id`

David O'Regan requested to merge 244943-incidents-navigation into master

What does this MR do?

This merge is a small MVC based on: #244943 (closed) where we allow the incident list to link through to a dedicated page for the incident details.

This new page is located under: issues/incident/:id and can be toggled via a frontend feature flag

This feature is toggled via a feature flag :

rails c Feature.enable(:issues_incident_details)

On the frontend side of this merge, we create a new entry point for the show of the Incident page and link it to the same show.js that currently drives the issue_show as this contains the if logic to swap between issues and incidents. This then allows us a path to reducing the HAML show view for both Issues and Incidents into a single Vue application that can accept a config object to change the view required.

Screenshots

Issue Incident Merge Requests
Screenshot_2020-09-27_at_10.13.09 Screenshot_2020-09-27_at_10.10.10 Screenshot_2020-09-27_at_10.13.14

database query plans

Find a single incident

For https://gitlab.com/gitlab-examples/ops/incident-setup/everyone/tanuki-inc/-/issues/2252

explain SELECT "issues"."id" AS t0_r0, "issues"."title" AS t0_r1, "issues"."author_id" AS t0_r2, "issues"."project_id" AS t0_r3, "issues"."created_at" AS t0_r4, "issues"."updated_at" AS t0_r5, "issues"."description" AS t0_r6, "issues"."milestone_id" AS t0_r7, "issues"."iid" AS t0_r8, "issues"."updated_by_id" AS t0_r9, "issues"."weight" AS t0_r10, "issues"."confidential" AS t0_r11, "issues"."due_date" AS t0_r12, "issues"."moved_to_id" AS t0_r13, "issues"."lock_version" AS t0_r14, "issues"."title_html" AS t0_r15, "issues"."description_html" AS t0_r16, "issues"."time_estimate" AS t0_r17, "issues"."relative_position" AS t0_r18, "issues"."service_desk_reply_to" AS t0_r19, "issues"."cached_markdown_version" AS t0_r20, "issues"."last_edited_at" AS t0_r21, "issues"."last_edited_by_id" AS t0_r22, "issues"."discussion_locked" AS t0_r23, "issues"."closed_at" AS t0_r24, "issues"."closed_by_id" AS t0_r25, "issues"."state_id" AS t0_r26, "issues"."duplicated_to_id" AS t0_r27, "issues"."promoted_to_epic_id" AS t0_r28, "issues"."health_status" AS t0_r29, "issues"."external_key" AS t0_r30, "issues"."sprint_id" AS t0_r31, "issues"."issue_type" AS t0_r32, "issues"."blocking_issues_count" AS t0_r33, "users"."id" AS t1_r0, "users"."email" AS t1_r1, "users"."encrypted_password" AS t1_r2, "users"."reset_password_token" AS t1_r3, "users"."reset_password_sent_at" AS t1_r4, "users"."remember_created_at" AS t1_r5, "users"."sign_in_count" AS t1_r6, "users"."current_sign_in_at" AS t1_r7, "users"."last_sign_in_at" AS t1_r8, "users"."current_sign_in_ip" AS t1_r9, "users"."last_sign_in_ip" AS t1_r10, "users"."created_at" AS t1_r11, "users"."updated_at" AS t1_r12, "users"."name" AS t1_r13, "users"."admin" AS t1_r14, "users"."projects_limit" AS t1_r15, "users"."skype" AS t1_r16, "users"."linkedin" AS t1_r17, "users"."twitter" AS t1_r18, "users"."failed_attempts" AS t1_r19, "users"."locked_at" AS t1_r20, "users"."username" AS t1_r21, "users"."can_create_group" AS t1_r22, "users"."can_create_team" AS t1_r23, "users"."state" AS t1_r24, "users"."color_scheme_id" AS t1_r25, "users"."password_expires_at" AS t1_r26, "users"."created_by_id" AS t1_r27, "users"."last_credential_check_at" AS t1_r28, "users"."avatar" AS t1_r29, "users"."confirmation_token" AS t1_r30, "users"."confirmed_at" AS t1_r31, "users"."confirmation_sent_at" AS t1_r32, "users"."unconfirmed_email" AS t1_r33, "users"."hide_no_ssh_key" AS t1_r34, "users"."website_url" AS t1_r35, "users"."admin_email_unsubscribed_at" AS t1_r36, "users"."notification_email" AS t1_r37, "users"."hide_no_password" AS t1_r38, "users"."password_automatically_set" AS t1_r39, "users"."location" AS t1_r40, "users"."encrypted_otp_secret" AS t1_r41, "users"."encrypted_otp_secret_iv" AS t1_r42, "users"."encrypted_otp_secret_salt" AS t1_r43, "users"."otp_required_for_login" AS t1_r44, "users"."otp_backup_codes" AS t1_r45, "users"."public_email" AS t1_r46, "users"."dashboard" AS t1_r47, "users"."project_view" AS t1_r48, "users"."consumed_timestep" AS t1_r49, "users"."layout" AS t1_r50, "users"."hide_project_limit" AS t1_r51, "users"."note" AS t1_r52, "users"."unlock_token" AS t1_r53, "users"."otp_grace_period_started_at" AS t1_r54, "users"."external" AS t1_r55, "users"."incoming_email_token" AS t1_r56, "users"."organization" AS t1_r57, "users"."auditor" AS t1_r58, "users"."require_two_factor_authentication_from_group" AS t1_r59, "users"."two_factor_grace_period" AS t1_r60, "users"."last_activity_on" AS t1_r61, "users"."notified_of_own_activity" AS t1_r62, "users"."preferred_language" AS t1_r63, "users"."email_opted_in" AS t1_r64, "users"."email_opted_in_ip" AS t1_r65, "users"."email_opted_in_source_id" AS t1_r66, "users"."email_opted_in_at" AS t1_r67, "users"."theme_id" AS t1_r68, "users"."accepted_term_id" AS t1_r69, "users"."feed_token" AS t1_r70, "users"."private_profile" AS t1_r71, "users"."roadmap_layout" AS t1_r72, "users"."include_private_contributions" AS t1_r73, "users"."commit_email" AS t1_r74, "users"."group_view" AS t1_r75, "users"."managing_group_id" AS t1_r76, "users"."first_name" AS t1_r77, "users"."last_name" AS t1_r78, "users"."static_object_token" AS t1_r79, "users"."role" AS t1_r80, "users"."user_type" AS t1_r81, "user_statuses"."user_id" AS t2_r0, "user_statuses"."cached_markdown_version" AS t2_r1, "user_statuses"."emoji" AS t2_r2, "user_statuses"."message" AS t2_r3, "user_statuses"."message_html" AS t2_r4 FROM "issues" LEFT OUTER JOIN "users" ON "users"."id" = "issues"."author_id" LEFT OUTER JOIN "user_statuses" ON "user_statuses"."user_id" = "users"."id" WHERE "issues"."project_id" = 14986497 AND "issues"."issue_type" = 1 AND "issues"."iid" = 2252

Plan from #database-lab (internal)

Recommendations: Looks good

Nested Loop Left Join  (cost=1.42..7.48 rows=1 width=2553) (actual time=8.351..8.351 rows=0 loops=1)
   Buffers: shared read=4
   I/O Timings: read=8.278
   ->  Nested Loop Left Join  (cost=1.00..7.04 rows=1 width=2507) (actual time=8.350..8.351 rows=0 loops=1)
         Buffers: shared read=4
         I/O Timings: read=8.278
         ->  Index Scan using index_issues_on_project_id_and_iid on public.issues  (cost=0.56..3.59 rows=1 width=1261) (actual time=8.349..8.349 rows=0 loops=1)
               Index Cond: ((issues.project_id = 14986497) AND (issues.iid = 2252))
               Filter: (issues.issue_type = 1)
               Rows Removed by Filter: 0
               Buffers: shared read=4
               I/O Timings: read=8.278
         ->  Index Scan using users_pkey on public.users  (cost=0.43..3.45 rows=1 width=1246) (actual time=0.000..0.000 rows=0 loops=0)
               Index Cond: (users.id = issues.author_id)
   ->  Index Scan using user_statuses_pkey on public.user_statuses  (cost=0.42..0.44 rows=1 width=46) (actual time=0.000..0.000 rows=0 loops=0)
         Index Cond: (user_statuses.user_id = users.id)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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

Closes #244943 (closed)

Edited by Peter Leitzen

Merge request reports