Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SourceLink build errors when using a "limited refs" clone #1139

Open
crhaglun opened this issue Nov 15, 2023 · 2 comments
Open

SourceLink build errors when using a "limited refs" clone #1139

crhaglun opened this issue Nov 15, 2023 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@crhaglun
Copy link

When cloning an ADO repo with limited refs, i.e. adding "optimized/" to an ADO repo path (https://dev.azure.com/account/project/optimized/_git/repo), SourceLink fails to validate the repository URL when building.

The value of SourceRoot.RepositoryUrl with identity 'C:\git\repo' is invalid: 'https://dev.azure.com/account/project/optimized/_git/repo' C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.SourceLink.AzureRepos.Git\build\Microsoft.SourceLink.AzureRepos.Git.targets 28

Cloning the same repo normally (https://dev.azure.com/account/project/_git/repo) works perfectly fine.

@tmat
Copy link
Member

tmat commented Nov 15, 2023

Docs on limited refs: https://learn.microsoft.com/en-us/previous-versions/azure/devops/all/git/limited-refs?view=tfs-2017 do not mention "optimized" as part of the path. @crhaglun are you aware of another documentation for it?

@tmat tmat added the enhancement New feature or request label Nov 15, 2023
@tmat tmat added this to the future milestone Nov 15, 2023
@crhaglun
Copy link
Author

@tmat heh, I'm trying to find something more official, but I always end up on https://stackoverflow.com/questions/56598474/how-do-you-enabled-limited-refs-in-tfs-git

Internal docs point at https://vsowiki.com/index.php?title=Limited_Refs_Basics - but that host no longer appears to be online

The "Limited Refs" article talks about enabling limited refs by default, and then mentions that it's possible to bypass limited refs for a repo on ADO by adding "_full" to the repo URL when cloning.

What it does not mention is that the opposite is true, for an unmodified repo you can opt in to limited refs by adding "_optimized" to the repo URL when cloning.

This feature is available on every ADO project I've tried it, but the lack of official documentation is unexpected.
Perhaps it's a first-party feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants