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

Web viewer does not respect UriBaseIds for navigating to relative file paths #8

Open
harleenkohli opened this issue Apr 7, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@harleenkohli
Copy link

harleenkohli commented Apr 7, 2020

Repro steps:

Sarif sample to repro this issue:

{
  "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json",
  "version": "2.1.0",
  "runs": [
    {
      "results": [
        {
          "ruleId": "rule01",
          "level": "error",
          "message": {
            "text": "test text."
          },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": ".config/CredScanSuppressions.json",
                  "uriBaseId": "TARGETROOT",
                  "index": 0
                },
                "region": {
                  "startColumn": 10,
                  "endColumn": 147,
                  "snippet": {
                    "text": "Test text."
                  }
                }
              }
            }
          ]
        }
      ],
      "tool": {
        "driver": {
          "name": "Code Analysis"
        }
      },
      "originalUriBaseIds": {
        "TARGETROOT": {
          "uri": "https://dev.azure.com/mseng/_git/AzureDevOps?path="
        }
      },
      "artifacts": [
        {
          "location": {
            "uri": ".config/CredScanSuppressions.json",
            "uriBaseId": "TARGETROOT"
          }
        }
      ],
      "columnKind": "utf16CodeUnits"
    }
  ]
}

Expected behavior:

On clicking the file path, we should navigate to the proper URL relative to the value of uriBaseID.
e.g. in above exampl, it shoulde be:

https://dev.azure.com/mseng/_git/AzureDevOps?path=.config/CredScanSuppressions.json

Actual behavior:

Incorrect navigation URL is created relative to the sarif view website instead.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant