Skip to content

The automatic linking of URLs in job log output considers ' to be part of the URL

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

This bug report was created on behalf of a GitLab Ultimate customer (internal link). Reported via a support ticket (internal link)

When a link is outputted in the CI job output screen that contains ' at the beginning and/or end, when it is highlighted as a link in the UI, the trailing ' is considered part of the URL, which can lead to broken links/404's when clicked or copied directly from the job output screen.

Steps to reproduce

  1. Create a project with a .gitlab-ci.yml that contains the below script steps as an example:
  script:
    - echo "'https://gitlab.com/gitlab-org/gitlab'"
    - echo "'https://google.com'"
    - echo "'https://gitlab.example.com'"
  1. Commit changes, await for the job to complete.
  2. Check the job log and notice how each link includes the trailing '.

Example Project

Example Project: https://gitlab.com/tloughlin_ultimate_group/public/public-reproductions/trailing-apostrophe-ci-job-output

Example Job: https://gitlab.com/tloughlin_ultimate_group/public/public-reproductions/trailing-apostrophe-ci-job-output/-/jobs/11390212086

What is the current bug behavior?

URLs that are present in a CI job output enclosed in ' will have the trailing ' included at the end of the URL.

What is the expected correct behavior?

Trailing ' should not be included.

Relevant logs and/or screenshots

image

Output of checks

This bug happens on GitLab.com

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)

Possible fixes

Patch release information for backports

If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.

Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.

High-severity bug remediation

To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.

Edited by 🤖 GitLab Bot 🤖