Fix Broken Links in Stopping Environments Modal
Summary
When clicking on the stop button on an environment, the following modal opens up:
In this modal, both the doc links are broken:
- https://docs.gitlab.com/ee/ee/ci/yaml/
- https://docs.gitlab.com/ee/environments/#stopping-an-environment
Steps to reproduce
- Visit operate -> environments
- Stop an environment using the stop button
- View the broken links
Example Project
https://gitlab.com/emilybauman/release-test-project/-/environments
What is the current bug behavior?
Links open to "We're sorry, no page exists at this address."
What is the expected correct behavior?
Links should open to appropriate docs pages:
- gitlab-ci.yml: https://docs.gitlab.com/ee/ci/#the-gitlab-ciyml-file
- Learn more about stopping environments: https://docs.gitlab.com/ee/ci/environments/#stopping-an-environment
Relevant logs and/or screenshots
Posted above
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Technical proposal
The stop environment modal is located in
app/assets/javascripts/environments/components/stop_environment_modal.vue
yamlDocsLink
and stoppingEnvironmentDocsLink
fields in component's $options
contain the (now broken) links.
In order to fix these, we should use helpPagePath
helper from ~/helpers/help_page_helper
and pass in a path to intended documentation markdown file (the path should be relative for the docs/
folder).
For example, in order to create a link to doc/ci/yaml/index.md
file we should do the following call:
yamlDocsLink: helpPagePath('ci/yaml/index.md'),
The links to the markdown files are most probably the following:
ci/yaml/index.md
ci/environments/index.md#stopping-an-environment