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
66 stars 22 forks source link

Feature Request:Mark file as reviewed #7

Closed abdulkareemnalband closed 3 years ago

abdulkareemnalband commented 3 years ago

Issue Type: Feature Request

I'm using this extension for past couple of days, I missing mark file as reviewed from web UI a lot image

Extension version: 0.0.7 VS Code version: Code - Insiders 1.53.0-insider (32b28f6f8f9dfe36efad102cc460e14a84ba756a, 2021-01-19T06:09:44.762Z) OS version: Windows_NT x64 10.0.19042

ankitbko commented 3 years ago

Related to https://github.com/microsoft/vscode-pull-request-github/issues/520. However I do not see any AzDO API to set a file reviewed. I will need to dig into it a little more.

ImanMahmoudinasab commented 3 years ago

@ankitbko now microsoft#520 is implemented. Also a local storage can be used to keep the state.

ankitbko commented 3 years ago

Great. I am thinking of keeping the state in memory. So the reviewed symbol will show on file till vscode is restarted or the PR is refreshed.

Will this work or are you looking at more persisted review feature?

ImanMahmoudinasab commented 3 years ago

.... However I do not see any AzDO API to set a file reviewed. ...

Actually, there is an API that Microsoft azure uses to store review state: https://dev.azure.com/{projectName}/_apis/Contribution/HierarchyQuery/project/{projectId} I could not find the documents for the API.

image modifyHashes: file names

ankitbko commented 3 years ago

Yes I have seen that. Its not a supported API to be consumed from client. The AzDO client I am using does not have this API exposed as well. I don't want to add dependency to unsupported API and bypassing the AzDO Node client as well. Its too much of effort and moreover I can never be sure if the API will work in expected way for all organizations deployments.

So here is my question - what features are you looking for? Specifically in terms of persistence, below are 2 options I can think of -

  1. The metadata about reviewed file is maintained in memory as part of the PR itself, so any action that refreshed PR (manually refreshing, restarting VS Code, etc) will loose the review status.
  2. I can try storing the metadata using Memento in workspace scoped storage so the reviewed file status persists across vscode restarts and PR refreshes.

The other thing I will need to take care of is to automatically remove the review flag from a file if the file gets updated. So I am thinking to key the review flag using file SHA. Will need to investigate this further.

ImanMahmoudinasab commented 3 years ago

Yeah, you are right about the API, I mention it here because I thought it might be standard API, but I couldn't find the API.

I think option 2 is a better choice as the review process may take more time, and in the meanwhile, the reviewer, for any reason(updating VScode to a newer version, for example), may want to close/restart the VScode. When review result in code change, ideally reviewer would like to see which files should be reviewed (including newly changed, added, and removed files)

ankitbko commented 3 years ago

This feature is released as part of v0.0.22. Read more on wiki. https://github.com/ankitbko/vscode-pull-request-azdo/wiki/Mark-file-as-Viewed image

image