Skip to content

Links in projects don't update after external_url is changed

Proposed solution

  1. Move the CACHE_COMMONMARK_VERSION constant to the database, in application_settings.
    1. As described in https://gitlab.com/gitlab-org/gitlab-ce/issues/32789#note_30579916, we may want to keep a hard-coded constant and an administrator-changeable version.
  2. Add a Rake task (or API call?) to bump this, which will therefore have the effect of forcing a re-render of all existing content.
  3. Add this to the documentation about the external_url setting.

Summary

If the external_url setting is changed, links (such as issue branches from the issue), do not update to the new setting. The remote links for the projects do update just fine.

Steps to reproduce

  1. Create an issue
  2. Create an issue branch from the issue
  3. Change external_url in /etc/gitlab/gitlab.rb
  4. Call gitlab-ctl reconfigure
  5. Go back to the issue and check the link for the issue branch. This is the previous setting for the external_url, not the current.

What is the current bug behavior?

The URL for the links is not updated when the external_url setting is changed.

What is the expected correct behavior?

The URL for the links should be updated when the external_url setting is changed.

Relevant logs and/or screenshots

Shows the external_url that is used in the remote links.

sshot_current_url

Shows that the same external_url is not used in the link (look at the bottom of the screen)

sshot_wrong_url

Output of checks

This is on an Omnibus installation of version 9.1.3.

Results of GitLab environment info

Expand for output related to GitLab environment info

''' System information System: Ubuntu 16.04 Current User: git Using RVM: no Ruby Version: 2.3.3p222 Gem Version: 2.6.6 Bundler Version:1.13.7 Rake Version: 10.5.0 Redis Version: 3.2.5 Git Version: 2.11.1 Sidekiq Version:4.2.7

GitLab information Version: 9.1.3 Revision: 2e4e522 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: http://hydrogen HTTP Clone URL: http://hydrogen/some-group/some-project.git SSH Clone URL: git@hydrogen:some-group/some-project.git Using LDAP: no Using Omniauth: no

GitLab Shell Version: 5.0.2 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git '''

Results of GitLab application Check

Expand for output related to the GitLab application check

''' Checking GitLab Shell ...

GitLab Shell version >= 5.0.2 ? ... OK (5.0.2) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 6/1 ... ok 2/2 ... repository is empty 6/5 ... ok 6/7 ... ok 6/8 ... ok 6/11 ... ok 4/12 ... ok 4/14 ... ok 4/15 ... ok 4/16 ... ok 4/17 ... ok 4/18 ... ok 6/19 ... ok 4/20 ... ok 4/21 ... ok 4/22 ... ok 2/23 ... ok 4/24 ... ok 4/25 ... ok 4/26 ... ok 6/27 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Access to /var/opt/gitlab/.ssh/authorized_keys: OK Send ping to redis server: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Reply by email ...

Reply by email is disabled in config/gitlab.yml

Checking Reply by email ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Git configured with autocrlf=input? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config outdated? ... no Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory setup correctly? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) projects have namespace: ... 6/1 ... yes 2/2 ... yes 6/5 ... yes 6/7 ... yes 6/8 ... yes 6/11 ... yes 4/12 ... yes 4/14 ... yes 4/15 ... yes 4/16 ... yes 4/17 ... yes 4/18 ... yes 6/19 ... yes 4/20 ... yes 4/21 ... yes 4/22 ... yes 2/23 ... yes 4/24 ... yes 4/25 ... yes 4/26 ... yes 6/27 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.1.0 ? ... yes (2.3.3) Your git bin path is "/opt/gitlab/embedded/bin/git" Git version >= 2.7.3 ? ... yes (2.11.1) Active users: 15

Checking GitLab ... Finished

'''

Possible fixes

I'm not familiar enough with the code to offer a possible fix.

Edited by Sean McGivern