microsoft / sarif-visualstudio-extension

SARIF Microsoft Visual Studio Viewer Extension
MIT License
46 stars 19 forks source link

Fix GetSourceFileUri for not slash terminated repositories #580

Closed JarLob closed 1 year ago

JarLob commented 1 year ago

When the repository is not slash terminated like https://github.com/user/repo the Uri.TryCreate(this.details.RepositoryUri, sourceRelativePath, out Uri sourceUri) drops the repo from resulting Uri: Uri.TryCreate("https://github.com/user/repo", "abc/def", out Uri sourceUri) makes sourceUri == "https://github.com/user/abc/def".

I made the fix in two functions that operate with the RepositoryUri, but maybe it can be fixed somewhere even earlier, because it is such a gotcha.

EasyRhinoMSFT commented 1 year ago

@JarLob the checks appear stuck, please push an innocuous change


In reply to: 1418241682

EasyRhinoMSFT commented 1 year ago
public class AdoVersionControlParser : IVersionControlParser

These classes are really similar. Maybe we could take the opportunity to DRY them our with a base class.


In reply to: 1418243907


Refers to: src/Sarif.Viewer.VisualStudio.Core/VersionControlParser/AdoVersionControlParser.cs:16 in e77293a. [](commit_id = e77293a7ad7ea7601681dd605ff95e6982ee414e, deletion_comment = False)

JarLob commented 1 year ago

Sorry for the delay, done.


In reply to: 1440898889

JarLob commented 1 year ago

Hi @EasyRhinoMSFT, sorry I didn't make that push. Now got some time, let me know if you still need anything from me.

EasyRhinoMSFT commented 1 year ago

No worries, there is still something wrong with the build pipeline settings which is why the fifth check is just sitting there. I'm working on it, don't need you to do anything. 👍

EasyRhinoMSFT commented 1 year ago

@JarLob it looks like what we're doing is adding people as contributors so they don't have to use a fork. Please accept the invite, move this change to a working branch, and create a new PR so we can get this merged.

JarLob commented 1 year ago

Ok, created https://github.com/microsoft/sarif-visualstudio-extension/pull/588