Skip to content

Fix Jira integration favicon image with relative URL

Arturo Herrero requested to merge 24818-fix-jira-favicon-link into master

What does this MR do?

The icon of the links generated by the integration of a GitLab instance set up on https://<host>/gitlab with JIRA is shown as a broken image.

Related #24818 (closed).

Testing

I've manually tested this with an external Jira instance.

I don't know if we can write an automated test for this. I tried to stub some configuration to set relative_url_root in the tests:

stub_config_setting(relative_url_root: '/gitlab')
stub_config_setting(url: Settings.send(:build_gitlab_url))

But this is not working because Rails doesn't read the new values from the test, I don't know why: https://github.com/rails/rails/blob/v5.2.3/actionview/lib/action_view/helpers/asset_url_helper.rb#L204-L207

The only way that I found to test this from the specs was to launch the specs with RAILS_RELATIVE_URL_ROOT, eg:

$ RAILS_RELATIVE_URL_ROOT='/gitlab' rspec spec/models/project_services/jira_service_spec.rb:617
Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading