GitHub Importer Links Incorrect When Not Using OAUTH
Summary
When importing from GitHub you are taken to the status page (/import/github/status) and it lists all of the projects to import. The left hand column should link to GitHub but if your installation isn't configured for OAUTH then the project links to a relative URL which ends up pointing to your server.
Steps to reproduce
- Install GitLab CE but do not enable OATH. Ensure that there are no configured omniauth_providers configured
- Create a new project and click the GitHub button
- Use a personal token
- The projects that can be imported should be listed
Expected behavior
- Links for the projects being imported should have a full url configured (which they do if you have omniauth_providers configured).
Actual behavior
- Links to the projects use relative urls so point to your gitlab installation and not the github.com source.
Relevant logs and/or screenshots
This is the source for the status page, as you can see the links to "stevenorman/node-gitlab" are relative but should be a full url which is what is seen on GitLab.com and on an installation with OAUTH configured.
<thead>
<tr>
<th>From GitHub</th>
<th>To GitLab</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr id="repo_34380735">
<td>
<a target="_blank" href="/stevenorman/node-df">stevenorman/node-df</a>
</td>
<td class="import-target">
stevenorman/node-df
</td>
<td class="import-actions job-status">
<button name="button" type="submit" class="btn btn-import js-add-to-import">Import
<i class="fa fa-spinner fa-spin loading-icon"></i>
</button></td>
</tr>
<tr id="repo_33670045">
<td>
<a target="_blank" href="/stevenorman/node-gitlab">stevenorman/node-gitlab</a>
</td>
<td class="import-target">
stevenorman/node-gitlab
</td>
<td class="import-actions job-status">
<button name="button" type="submit" class="btn btn-import js-add-to-import">Import
<i class="fa fa-spinner fa-spin loading-icon"></i>
</button></td>
</tr>
</tbody>
Possible fixes
I think the problem is the helper function that builds the links for the importer. Specifically https://gitlab.com/gitlab-org/gitlab-ee/blob/master/app/helpers/import_helper.rb#L12 which appears to do a lookup for the omniauth provider but doesn't seem to return anything if the provider isn't found. I think the default should be to return https://github.com as the root if the provider doesn't exist.