Job ID in artifact's browser breadcrumbs links to a wrong page

Summary

When opening the job artifacts browser, the job ID in the breadcrumbs is not linking to the job (e.g. https://gitlab.example.com/some/project/-/jobs/12345). Instead it links to the main job's page (https://gitlab.example.com/some/project/-/jobs/).

Screenshot_2019-03-26__testoutput___Artifacts___unit_test_1_5___184246388____Jobs___GitLab_org_gitlab-runner

Steps to reproduce

Found on GitLab.com. Can be seen for example at https://gitlab.com/gitlab-org/gitlab-runner/-/jobs/184246388/artifacts/browse (this is where I've found it; I've saved the artifact for this job, so the link will be available for future readers).

What is the current bug behavior?

The ID part of the breadcrumbs links to project's /-/jobs page.

What is the expected correct behavior?

The ID part of the breadcrumbs should link to the specific job page, e.g. /-/jobs/1234.

Output of checks

This bug happens on GitLab.com (11.9.1-ee at the moment of filling this issue).

Possible fixes

https://gitlab.com/gitlab-org/gitlab-ce/blob/v11.9.1/app/views/projects/artifacts/browse.html.haml#L7

This should probably be enough to fix the problem:

:100644 100644 09295940529 00000000000 M        app/views/projects/artifacts/browse.html.haml

diff --git a/app/views/projects/artifacts/browse.html.haml b/app/views/projects/artifacts/browse.html.haml
index 09295940529..6a7cb1499c5 100644
--- a/app/views/projects/artifacts/browse.html.haml
+++ b/app/views/projects/artifacts/browse.html.haml
@@ -4,7 +4,7 @@
 = render "projects/jobs/header"
 
 - add_to_breadcrumbs(s_('CICD|Jobs'), project_jobs_path(@project))
-- add_to_breadcrumbs("##{@build.id}", project_jobs_path(@project))
+- add_to_breadcrumbs("##{@build.id}", project_job_path(@project, @build))
 
 .tree-holder
   .nav-block
Edited by Tomasz Maczukin