From 18324261097de835628570696594f749e48d3747 Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Mon, 1 Oct 2018 10:43:46 +0200 Subject: [PATCH] Link to the tag from a version instead of commit This will result in a 404 when running an unreleased security patch while still allowing users to find the commit when it is made available. --- app/views/help/index.html.haml | 3 +-- changelogs/unreleased/bvl-remove-sha-from-help.yml | 5 +++++ spec/views/help/index.html.haml_spec.rb | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 changelogs/unreleased/bvl-remove-sha-from-help.yml diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index 7a66bac09cb..198c2d35b29 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -7,8 +7,7 @@ GitLab Community Edition - if user_signed_in? - %span= Gitlab::VERSION - %small= link_to Gitlab.revision, Gitlab::COM_URL + namespace_project_commits_path('gitlab-org', 'gitlab-ce', Gitlab.revision) + %span= link_to Gitlab::VERSION, Gitlab::COM_URL + namespace_project_tag_path('gitlab-org', 'gitlab-ce', "v#{Gitlab::VERSION}") = version_status_badge %hr diff --git a/changelogs/unreleased/bvl-remove-sha-from-help.yml b/changelogs/unreleased/bvl-remove-sha-from-help.yml new file mode 100644 index 00000000000..37f797f98f4 --- /dev/null +++ b/changelogs/unreleased/bvl-remove-sha-from-help.yml @@ -0,0 +1,5 @@ +--- +title: Link to the tag for a version on the help page instead of to the commit +merge_request: 22015 +author: +type: changed diff --git a/spec/views/help/index.html.haml_spec.rb b/spec/views/help/index.html.haml_spec.rb index 4b4de540d9e..c8c9c4e773d 100644 --- a/spec/views/help/index.html.haml_spec.rb +++ b/spec/views/help/index.html.haml_spec.rb @@ -21,7 +21,7 @@ describe 'help/index' do render expect(rendered).to match '8.0.2' - expect(rendered).to have_link('abcdefg', href: 'https://gitlab.com/gitlab-org/gitlab-ce/commits/abcdefg') + expect(rendered).to have_link('8.0.2', href: 'https://gitlab.com/gitlab-org/gitlab-ce/tags/v8.0.2') end end