dotnet / dotnet/sourcelink

Issue with Bamboos git-checkout and Source Link

Open
#574 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.4k
Forks
148
PR merge metrics
No merged PRs in 30d

Description

Hi,

We use a self-hosted Bitbucket instance as git host, and build our packages with Bamboo.

Bamboo has a very special way of checking out/cloning git repositories in a CI build. See https://jira.atlassian.com/browse/BAM-15012 for details, but the short version is, that for local git checkouts it sets the origin-url to either a local path, or even to `file://nothing`.
So when trying to read that automatically you will end up with an error like:
`The value of SourceRoot.RepositoryUrl with identity '' is invalid: 'file://nothing/` what causes the build to fail.

The question now is, which configuration is needed, so that Source Link won't produce errors or warnings?
Currently we go with:

```xml


https://our.bitbucket.instance/scm//.git

```

The generated NuGet package metadata contains the repository URL as referenced, but the build produces the following two warnings for every package that configures Source Link information that way:

```
/packages/microsoft.build.tasks.git/1.0.0/build/Microsoft.Build.Tasks.Git.targets(24,5): warning : Repository '\\nothing' has no remote. [//src//.csproj]
/packages/microsoft.sourcelink.common/1.0.0/build/Microsoft.SourceLink.Common.targets(52,5): warning : Source control information is not available - the generated source link is empty. [//src//.csproj]
```

Additional questions are:
* Is there a configuration that would get rid of those warnings? I thought explicitly specifying the `RepositoryUrl` property would stop Source Link from trying to look up repository information.
* Will Source Link work regardless of those warnings? As said, there *is* the Repository URL getting written in the Package metadata

Thanks for help,
Peter

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.