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

Usage of UseSourceLink results in 500 errors in Azure DevOps. #1669

Closed
foggerty opened this issue Jul 7, 2024 · 2 comments
Closed

Usage of UseSourceLink results in 500 errors in Azure DevOps. #1669

foggerty opened this issue Jul 7, 2024 · 2 comments
Labels
question This issue is a question Solved The issue is solved and can be closed

Comments

@foggerty
Copy link

foggerty commented Jul 7, 2024

Describe the bug
When we enable <UseSourceLink>true</UseSourceLink> in our coverlet.runsettings file, Azure spits out errors like so:

For Generate Code Coverage:
2024-07-05T04:50:37: Error during reading file '[https://dev.azure.com/nztasd/SharedDelivery/_apis/git/repositories/Utilities/items?api-version=1.0&versionType=commit&version=8d856b2f1bd65c27e344fc86533a519f3a2f54fc&path=/Process/APIs/Services/BackgroundTasks/Workers/SendConfirmationEmailWorker.cs'](https://dev.azure.com/nztasd/SharedDelivery/_apis/git/repositories/Utilities/items?api-version=1.0&versionType=commit&version=8d856b2f1bd65c27e344fc86533a519f3a2f54fc&path=/Process/APIs/Services/BackgroundTasks/Workers/SendConfirmationEmailWorker.cs%27): Response status code does not indicate success: 500 (Internal Server Error).

For Publish Code Coverage:
2024-07-05T04:50:41: Error during reading file '[https://dev.azure.com/nztasd/SharedDelivery/_apis/git/repositories/Utilities/items?api-version=1.0&versionType=commit&version=8d856b2f1bd65c27e344fc86533a519f3a2f54fc&path=/Process/APIs/TransferObjects/Request/SendConfirmationEmailRequest.cs'](https://dev.azure.com/nztasd/SharedDelivery/_apis/git/repositories/Utilities/items?api-version=1.0&versionType=commit&version=8d856b2f1bd65c27e344fc86533a519f3a2f54fc&path=/Process/APIs/TransferObjects/Request/SendConfirmationEmailRequest.cs%27): Response status code does not indicate success: 500 (Internal Server Error).

To Reproduce
Turn on UseSourceLink in coverlet.settings, and use the following Pipeline build script:

- task: DotNetCoreCLI@2
    displayName: 'Run Tests'
    inputs:      
      projects: '${{parameters.solution}}'
      command: test
      arguments: '--configuration ${{parameters.buildConfiguration}} --no-build --collect:"XPlat Code Coverage" --settings coverlet.runsettings'

  - script: |
      dotnet tool install -g dotnet-reportgenerator-globaltool --add-source "https://api.nuget.org/v3/index.json" --ignore-failed-sources
      reportgenerator -reports:$(Agent.TempDirectory)\*\coverage.*.xml -targetdir:$(Build.SourcesDirectory)/CodeCoverage -reporttypes:"HtmlInline_AzurePipelines;Cobertura"
    displayName: Create code coverage report

  - task: PublishCodeCoverageResults@2
    displayName: Publish code coverage report
    condition: succeededOrFailed()
    inputs:
      codeCoverageTool: 'Cobertura'
      summaryFileLocation: '$(Build.SourcesDirectory)/CodeCoverage/Cobertura.xml'
      reportDirectory: '$(Build.SourcesDirectory)/CodeCoverage'
    env:
      DISABLE_COVERAGE_AUTOGENERATE: 'true'

Expected behavior
We're expecting source-links in the published report. As in, a direct link to the source file (in Azure's Git repository) that's being reported on.

Actual behavior
We're getting "source-links" that don't actually contain any links - as in, there's text saying https://dev.azure.com/.....SendConfirmationEmailRequest.cs but it's not actually a link.

Note that if we turn off UseSourceLink then the report contains a local file-path from the build agenet, e.g. D:\a\1\s\Experience\APIs\Controllers\VehiclesController.cs and we don't get any errors.

Configuration (please complete the following information):
Please provide more information on your .NET configuration:
* Coverlet version: 6.0.2
* .NET version: 8
* OS: WindowsLatest as specified by Azure build process.
* Architecture: x64

Additional context
There's what looks like a possible fix here, but I'd like to confirm that it's either a bug or that maybe we're doing something wrong. I've gone through the docs, but didn't see anything special related to Azure.

Cheers,

Matt.

@github-actions github-actions bot added the untriaged To be investigated label Jul 7, 2024
@Bertk Bertk added question This issue is a question and removed untriaged To be investigated labels Jul 24, 2024
@Bertk
Copy link
Collaborator

Bertk commented Jul 24, 2024

Hi,
this looks like CI authentication issue and as far as I know coverlet does not handle any credentials.

@Bertk Bertk added the Solved The issue is solved and can be closed label Aug 7, 2024
@foggerty
Copy link
Author

Cheers, just wanted to double-check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This issue is a question Solved The issue is solved and can be closed
Projects
None yet
Development

No branches or pull requests

2 participants