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

AzureDevops SourceLink Url Incorrectly parsed #6146

Closed
crystalworks opened this issue Oct 11, 2024 · 5 comments · Fixed by #6159
Closed

AzureDevops SourceLink Url Incorrectly parsed #6146

crystalworks opened this issue Oct 11, 2024 · 5 comments · Fixed by #6159

Comments

@crystalworks
Copy link

Describe the bug
It appears that the TryParseSourceLinkUrl method utilised by the AzureDevOpsSourceLinkUrlParser is delivering the incorrect Url

e.g.

this is picked up by sourcelink "https://dev.azure.com/organisation/project/_apis/git/repositories/example.shopping.api/items?api-version=1.0&versionType=commit&version=0e4d29442102e6cef1c271025d513c8b2187bcd6&path=/*"

and should give you

https://dev.azure.com/organisation/project/_git/example.shopping.api

but instead it gives you

https://dev.azure.com/organisation/_git/repositories

This was identified whilst configuring DORA in DataDog, the spans/traces came in with the incorrect url. the datadog-ci metadata upload appears to be working correctly.

To Reproduce
Steps to reproduce the behavior:

  1. configure sourcelink with your project with APM configured from an ADO repo
  2. inspect traces in datadog and look at git.repository.id or git.repository_url

Example project with the logic isolated showcasing the issue attached
example.zip

Expected behavior
Expected behaviour is parser should correctly parse the url

Screenshots
Image

Runtime environment (please complete the following information):

  • Instrumentation mode: [e.g. automatic with msi installer or manual with NuGet package]
  • Tracer version: [e.g. 1.0.0]
  • OS: [e.g. Windows Server 2012 R2 ]
  • CLR: [e.g. .NET Framework 4.6.2, .NET Core 2.1]

Additional context
Noticed while configuring DORA CI

@crystalworks
Copy link
Author

@OmerRaviv
Copy link
Collaborator

@crystalworks Thank you for reporting this issue! I am investigating it and will keep you posted on our progress.

@crystalworks
Copy link
Author

Hi @OmerRaviv

Sorry to chase, any update on this?

Thanks

@OmerRaviv
Copy link
Collaborator

OmerRaviv commented Oct 16, 2024

Hi @crystalworks ! No worries. I am still actively working on this issue. Will post here once I have a PR ready. Thank you for interest and patience.

andrewlock pushed a commit that referenced this issue Oct 22, 2024
…parsing logic (#6159)

## Summary of changes

Fixes #6146

## Reason for change
Customer reported an issue where the tracer reports incorrect
`git.repository_url` as a result of this bug.


## Test coverage
Add a new test case.
andrewlock pushed a commit that referenced this issue Oct 22, 2024
…parsing logic (#6159)

## Summary of changes

Fixes #6146

## Reason for change
Customer reported an issue where the tracer reports incorrect
`git.repository_url` as a result of this bug.


## Test coverage
Add a new test case.
bouwkast pushed a commit that referenced this issue Oct 22, 2024
…parsing logic (#6159 => v2) (#6178)

## Summary of changes

Fixes #6146

2.x backport of #6159

## Reason for change
Customer reported an issue where the tracer reports incorrect
`git.repository_url` as a result of this bug.

## Test coverage
Add a new test case.

Co-authored-by: Omer Raviv <omer.raviv@datadoghq.com>
@andrewlock
Copy link
Member

Hi @crystalworks this should be fixed in v3.4.0. and v2.60.0, Thanks!

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