Custom issue trackers don't substitute issues_tracker_id
Problem
In former versions of GitLab the admin could configure a custom issue tracker (e.g. Redmine) and the URLs would be build by using the configuration + substituting :issues_tracker_id
and :id
.
Current master (7561b1c2) doesn't support this feature in two ways:
- The project's
issues_tracker_id
cannot be set using the UI anymore (The option for setting the project'sissues_tracker_id
was removed in a720dde6) - Even if set (e.g. by using the console) the
:issues_tracker_id
placeholder isn't substituted correctly
I'm opening only one issue for this matter as fixing only one of both problems doesn't seems to make any sense for me.
Steps to reproduce 1
- Install a vanilla gitlab-development-kit installation and start all instances
- Check that the input field to configure the
issues_tracker_id
is gone one the project's settings page: - Visit:
http://localhost:3000/documentcloud/underscore/edit
Steps to reproduce 2
- Install a vanilla gitlab-development-kit installation and start all instances
- Enable a custom issue tracker. Example for project DocumentCloud/Underscore:
- Visit:
http://localhost:3000/documentcloud/underscore/services/redmine/edit
- Configure the urls (s. screenshot) and save:
- Manually set a project's
issues_tracker_id
- Start a new console:
rails c
- Manually update the tracker's id:
Project.find(1).update_attributes!(:issues_tracker_id => "custom_tracker_id")
(This updates thedocumentcloud/underscore
project) - Note the custom issues tracker URLs are used but the placeholders not substituted
- Visit:
http://localhost:3000/documentcloud/underscore
- The URL linked for "Issues" in the sidebar is
http://localhost/redmine/:issues_tracker_id/
- Also for single issue links only the
:id
placeholder is substituted: - Visit:
http://localhost:3000/documentcloud/underscore/commit/044ba5c3502dfac26c1a863a62c518b91e2a255d
- Add a new comment:
This is a dummy reference #1
- The URL linked to the single reference is:
http://localhost/redmine/:issues_tracker_id/issues/1
My two cents
I think 1) can easily be fixed by re-adding the configuration option to the settings page. See my commit for a hint https://gitlab.com/jnbt/gitlab-ce/commit/0c4a136683948d534ffd8971680c65a13a489f3e. I can make a MR if wished, but I'm unsure how to write a test case for this.
I didn't got 2) fixed as I don't fully understand the concept the services and their config. It seems that the class Service
and IssueTrackerService
should already support the usage of the placeholders, but the code path isn't executed at all. My guess this bases on accessing Gitlab.config.issues_tracker
in https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/models/project_services/issue_tracker_service.rb#L93