Extracted metadata source.remote.repo only working for git remote "origin"
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 890
- Avg merge
- 2h 9m
- Merged PRs (30d)
- 11
Description
**Operation System**: (`Windows` or `Linux` or `MacOS`)
Windows
**DocFX Version Used**:
2.49.0.0
**Template used**: (`default` or `statictoc` or contain custom template)
default, material
**Steps to Reproduce**:
1. Configure a project with a git configuration using a remote named anything other than "origin" (I used "github" for this example
2. Setup docfx to point to that project, `__gitContribute` metadata doesn't seem to make a difference
3. run `docfx metadata -f`
**Expected Behavior**:
DocFX properly generates metadata and identifies a repository from the list of configured repos in the .git/config file. Optimally it would be nice to be able to specify the exact remote to use for generating the source details per managed reference; something like a global metadata tag, maybe an extension to `_gitUrlPattern` and make the current flag a part of it IE
```
"_gitUrlPattern": {
"type": "github",
"remoteName": "github"
}
```
**Actual Behavior**:
A flood of warning messages in the console log for every item in the project and incomplete metadata:
```
...
[20-02-20 09:50:19.404]Warning:[ExtractMetadata]Skipping GetFileDetail. Exception found: Microsoft.DocAsCode.Common.Git.GitException, Message:
[20-02-20 09:50:19.497]Warning:[ExtractMetadata]Skipping GetFileDetail. Exception found: Microsoft.DocAsCode.Common.Git.GitException, Message:
...
```
Contributor guide
Research direction
Start by reproducing `docfx metadata -f` with a `.git/config` remote named `github` instead of `origin`, and inspect the generated metadata and warning messages. Trace the metadata extraction path that selects the Git remote; done means repository and source details are generated for a non-origin remote without repeated `GetFileDetail` warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100