View Source not working for Azure Devops repos cloned via ssh
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 890
- Avg merge
- 2h 9m
- Merged PRs (30d)
- 11
Description
DocFX does not work correctly with Azure Devops git repos cloned via ssh
Possible regression since this previously seemed to work based on other issues.
https://github.com/dotnet/docfx/issues/1927
https://github.com/dotnet/docfx/pull/1557
**Operating System**: (`Windows` or `Linux` or `MacOS`)
`MacOs`
**DocFX Version Used**:
`2.59.4.0`
**Template used**: (`default` or `statictoc` or contain custom template)
`default`
**Steps to Reproduce**:
Clone DevOps repo using ssh.
Create new branch `feature/add-docfx`
Run docfx - `docfx init -q docs/docfx`
Configure `docs/docfx/docfx.json` to point to source code (c#)
Serve pages - `docfx docs/docfx/docfx.json --serve`
**Expected Behavior**:
Expect urls for "View Source" to correctly point to https based url and not ssh url
**Actual Behavior**:
URL generated by docfx for the "View Source" link
https://ssh.dev.azure.com/v3/myOrg/myProject/myRepo?path=src/Path/To/File.cs&version=GBfeature/docfx&line=8
Improve This Doc links to
https://ssh.dev.azure.com/v3/myOrg/myProject/myRepo?path=docs/docfx/index.md&version=GBfeature/add-docfx&line=1
Not that the View Source link is using SSH, and the branch name is wrong.
The Improve this doc link is also using SSH, but the branch name is correct.
output of `git remote -v`
```
origin git@ssh.dev.azure.com:v3/myOrg/myProject/myRepo (fetch)
origin git@ssh.dev.azure.com:v3/myOrg/myProject/myRepo (push)
```
Adding
```
"_gitContribute": {
"repo": "https://dev.azure.com/myOrg/myProject/_git/myRepo",
"branch": "feature/add-docfx"
}
```
to docfx.json fixes the Improve This doc
https://dev.azure.com/myOrg/myProject/_git/myRepo?path=docs/docfx/api/index.md&version=GBfeature/add-docfx&line=1
However the View Source link is still broken
https://ssh.dev.azure.com/v3/myOrg/myProject/myRepo?path=src/Path/To/The/File.cs&version=GBfeature/docfx&line=6
Note that the url is using ssh, and the branch name applied to the version query param is also wrong.
Contributor guide
Assessment
This issue has not been assessed yet.