ankitbko / vscode-pull-request-azdo

Azure Devops Pull Requests for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=ankitbko.vscode-pull-request-azdo
MIT License
65 stars 23 forks source link

Fetching pull requests failing #24

Closed adriansberg closed 3 years ago

adriansberg commented 3 years ago

Steps to Reproduce:

  1. Log in
  2. Try to fetch pull requests

The PAT has all the required scopes, even tried giving it full access. I am the project administrator of the project I am trying to fetch pull requests from.

[Info] AzdoRepository> Fetching pull requests for search: {"status":1} failed: Error: {"$id":"1","innerException":null,"message":"A potentially dangerous Request.Path value was detected from the client (:).","typeName":"System.Web.HttpException, System.Web","typeKey":"HttpException","errorCode":0,"eventId":0}
ankitbko commented 3 years ago

Could you share orgUrl and projectName that you have specified?

adriansberg commented 3 years ago

orgUrl: https://dev.azure.com/akvagroupsoftware projectName: Plan

ankitbko commented 3 years ago

Weird. Can you paste the entire log.

adriansberg commented 3 years ago
[Info] Looking for git repository
[Info] Git repository found, initializing review manager and pr tree view.
[Info] Review> Validate state in progress
[Info] Review> Validating state...
[Info] No remote with name 'upstream' found.
[Info] Found GitHub remote
[Info] Unable to resolve remote: Error: {"$id":"1","innerException":null,"message":"A potentially dangerous Request.Path value was detected from the client (:).","typeName":"System.Web.HttpException, System.Web","typeKey":"HttpException","errorCode":0,"eventId":0}
[Info] Review> no matching pull request metadata found for current branch master
[Info] AzdoRepository> Fetching pull requests for search: {"sourceRefName":"master"} failed: Error: {"$id":"1","innerException":null,"message":"A potentially dangerous Request.Path value was detected from the client (:).","typeName":"System.Web.HttpException, System.Web","typeKey":"HttpException","errorCode":0,"eventId":0}
[Info] AzdoRepository> Fetching pull requests for search: {"status":1} failed: Error: {"$id":"1","innerException":null,"message":"A potentially dangerous Request.Path value was detected from the client (:).","typeName":"System.Web.HttpException, System.Web","typeKey":"HttpException","errorCode":0,"eventId":0}
[Info] AzdoRepository> Fetching pull requests for search: {"status":1} failed: Error: {"$id":"1","innerException":null,"message":"A potentially dangerous Request.Path value was detected from the client (:).","typeName":"System.Web.HttpException, System.Web","typeKey":"HttpException","errorCode":0,"eventId":0}
[Info] Review> Queuing additional validate state
ankitbko commented 3 years ago

Can you please set azdoPullRequests.logLevel to debug, reload the window and share the log once again.

adriansberg commented 3 years ago
[Debug 1614701409.968s] AzdoRepository> Auth> Successful: Logged userid: c8667a92-e38a-63ac-bdf5-3a8f6fe52443
[Debug 1614701409.973s] Looking for git repository
[Debug 1614701409.973s] Git repository found, initializing review manager and pr tree view.
[Debug 1614701410.311s] Review> Validate state in progress
[Debug 1614701410.311s] Review> Validating state...
[Debug 1614701410.314s] No remote with name 'upstream' found.
[Debug 1614701410.314s] FolderRepositoryManager> Displaying configured remotes: origin, upstream
[Debug 1614701410.322s] Found GitHub remote
[Debug 1614701410.323s] AzdoRepository> Fetch metadata - enter
[Debug 1614701410.513s] Unable to resolve remote: Error: {"$id":"1","innerException":null,"message":"A potentially dangerous Request.Path value was detected from the client (:).","typeName":"System.Web.HttpException, System.Web","typeKey":"HttpException","errorCode":0,"eventId":0}
[Debug 1614701410.523s] Review> no matching pull request metadata found for current branch master
[Debug 1614701410.523s] AzdoRepository> Fetch pull requests for branch - enter
[Debug 1614701410.523s] AzdoRepository> Fetch metadata - enter
[Debug 1614701410.776s] AzdoRepository> Fetching pull requests for search: {"sourceRefName":"master"} failed: Error: {"$id":"1","innerException":null,"message":"A potentially dangerous Request.Path value was detected from the client (:).","typeName":"System.Web.HttpException, System.Web","typeKey":"HttpException","errorCode":0,"eventId":0}
[Debug 1614701415.489s] AzdoRepository> Fetch pull requests for branch - enter
[Debug 1614701415.489s] AzdoRepository> Fetch metadata - enter
[Debug 1614701415.696s] AzdoRepository> Fetching pull requests for search: {"creatorId":"c8667a92-e38a-63ac-bdf5-3a8f6fe52443","status":1} failed: Error: {"$id":"1","innerException":null,"message":"A potentially dangerous Request.Path value was detected from the client (:).","typeName":"System.Web.HttpException, System.Web","typeKey":"HttpException","errorCode":0,"eventId":0}
[Debug 1614701418.686s] AzdoRepository> Fetch pull requests for branch - enter
[Debug 1614701418.686s] AzdoRepository> Fetch metadata - enter
[Debug 1614701418.872s] AzdoRepository> Fetching pull requests for search: {"status":1} failed: Error: {"$id":"1","innerException":null,"message":"A potentially dangerous Request.Path value was detected from the client (:).","typeName":"System.Web.HttpException, System.Web","typeKey":"HttpException","errorCode":0,"eventId":0}
ankitbko commented 3 years ago

I have updated the extension to v0.0.15 with additional logging which may help me to narrow down the issue. Could you please update the extension to above version and share the log again. My current guess is there is a colon (:) somewhere in REST request sent to AZDO. Need to narrow it down further.

adriansberg commented 3 years ago

I figured it out! I had set the projectName to include the organization URL so it was essentially requesting https://dev.azure.com/akvagroupsoftware/https://dev.azure.com/akvagroupsoftware/Plan. I didn't see it when I answered your first question either. 🤦 The additional logging helped me realize it though. 😁

So sorry!