backstage: Unable to ingest from Azure git repos
I tried ingesting a template from a private Azure git repo but got an error. After some investigation it seems that the generated URL doesn’t correspond with what is in the Azure docs.
Expected Behavior
As per this documentation the URL should be in the following format:
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/items?path={path}&api-version=6.0
Current Behavior
The currently generated URL looks like the following:
GET https://dev.azure.com/{organization}/{project}/_apis/sourceProviders/TfsGit/filecontents?repository={repositoryId}&commitOrBranch=undefined&path={path}&api-version=6.0-preview.1
I have not tried with a Team Foundation Version Control (TFVC) repo so I’m not sure if that works and what would happen if the URL is changed.
Possible Solution
Change AzureApiReaderProcessor.ts to the documented URL.
Steps to Reproduce
- Go to register an existing component
- Supply a URL for a private Azure repo
Your Environment
- NodeJS Version (v12): v12.18.3
- Operating System and Version (e.g. Ubuntu 14.04): VS Code Node.js devcontainer
- Browser Information: Chrome 85.0.4183.83
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (20 by maintainers)
Yes, I just tested and with the branch and the permission it works.
Thanks both of you. Let me know if I can be of assistance, but it would be great if we could make all of those possible URLs work “out of the box” so users can just paste whatever they have in their browser while looking at the file contents.
A perhaps useful analogy is when looking at a file on github, then both the regular browse view
https://github.com/spotify/backstage/blob/master/catalog-info.yamlas well as the raw view
https://raw.githubusercontent.com/spotify/backstage/master/catalog-info.yamlcould be argued that they should be valid, different representations of the same file, that should “just work” (although I think at the moment, only the first works 😃).