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

Unable to override URL used with GitLab #786

Open
bthharper opened this issue Jan 7, 2022 · 3 comments
Open

Unable to override URL used with GitLab #786

bthharper opened this issue Jan 7, 2022 · 3 comments

Comments

@bthharper
Copy link

I am trying to integrate SourceLink with an on-premise GitLab version 14.5.2, however the default URL being added into the PDBs is incorrect. I have added the following to the csproj files:

<PropertyGroup>
  <PublishRepositoryUrl>true</PublishRepositoryUrl>
  <EmbedUntrackedSources>true</EmbedUntrackedSources>
  <IncludeSymbols>true</IncludeSymbols>
  <SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<ItemGroup>
  <PackageReference Include="Microsoft.SourceLink.GitLab" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

However this produces:

<SourceLink>
  <Conversion FilePath="C:\git\group\project\*" Uri="https://gitlabssh.acme.com/group/project/-/raw/7c9ac7a534ca5e0442fb23f896d7e5e7ac983019/*" />
</SourceLink>

Our gitlab server is hosted on https://gitlab.acme.com/ but cloning in git is via gitlabssh.acme.com.

I tried overriding this using:

<SourceLinkGitLabHost Include="gitlab.acme.com" />

and

<SourceLinkGitLabHost Include="gitlab.acme.com" ContentUrl="https://gitlab.acme.com/" />

However, neither of these have an affect. Is there something I am getting wrong here?

@bthharper
Copy link
Author

bthharper commented Jan 7, 2022

After reviewng the code, I changed to using this which has partially fixed the issue:

<SourceLinkGitLabHost Include="gitlabssh.acme.com" ContentUrl="https://gitlab.acme.com/" />

which returns:

<SourceLink>
  <Conversion FilePath="C:\git\group\project\*" Uri="https://gitlab.acme.com/group/project/-/raw/7c9ac7a534ca5e0442fb23f896d7e5e7ac983019/*" />
</SourceLink>

However, now I am getting an HTML page returned asking me to login in (using an AD account).

Any one know how to work around this?

@tmat
Copy link
Member

tmat commented Jan 10, 2022

@chuckries re authentication for GitLab.

@chuckries
Copy link
Contributor

Private GitLab repos are not currently supported in Visual Studio: #281

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

No branches or pull requests

3 participants