vscode-pull-request-github icon indicating copy to clipboard operation
vscode-pull-request-github copied to clipboard

Resolve Conversation with Commit

Open JustinGrote opened this issue 2 years ago • 6 comments

When working through a review, I like to resolve conversations with one commit per conversation request. Right now the workflow is pretty cumbersome, I create the commit via vscode source editor, then copy the commit ID, then paste it into the conversation request as "Resolved<commitID>" and finally close the issue.

I would like a "Fix with Commit" button on a conversation that will take my staged changes (or all changes if none staged) and once clicked, automate these steps:

  1. Commit to the PR
  2. Update the conversation where the button was clicked with a new "Resolved <commitId>" comment
  3. Resolve the conversation.

JustinGrote avatar Feb 02 '24 00:02 JustinGrote

I would like to work on this, any suggestions on where to start, things to consider ? @alexr00

mohamedamara1 avatar Mar 06 '24 16:03 mohamedamara1

I don't think we should reinvent the wheel (or the git commit flow) for this. An alternative flow:

  1. Commit to the PR
  2. Go to the conversation that you want to resolve
  3. Click a new "Resolve with Existing Commit" action
  4. A picker shows to choose which commit resolves the conversation.
  5. User chooses which commit applies to this conversation
  6. An automatic reply is added to the conversation with the text "Resolved with "
  7. The conversation is resolved

@JustinGrote what do you think of this?

alexr00 avatar Mar 12 '24 11:03 alexr00

While not ideal, it's a reasonable compromise, thanks @alexr00!

JustinGrote avatar Mar 12 '24 16:03 JustinGrote

@mohamedamara1 if you want to work on this then please feel free. https://github.com/microsoft/vscode-pull-request-github/issues/5710#issuecomment-1991397726 outlines the flow.

The "Resolve thread" command shows how to resolve a thread:

https://github.com/microsoft/vscode-pull-request-github/blob/92476fcb79c94cdfdbd8fc99ad1749f7640f7207/src/commands.ts#L942-L955

The "create comment" command shows how to reply to a comment:

https://github.com/microsoft/vscode-pull-request-github/blob/92476fcb79c94cdfdbd8fc99ad1749f7640f7207/src/commands.ts#L998-L1010

I don't know if this action should be given the same prominence as the existing "resolve" action. It could be placed here instead:

https://github.com/microsoft/vscode-pull-request-github/blob/92476fcb79c94cdfdbd8fc99ad1749f7640f7207/package.json#L2473-L2474

This is where the current resolve action is:

https://github.com/microsoft/vscode-pull-request-github/blob/92476fcb79c94cdfdbd8fc99ad1749f7640f7207/package.json#L2408-L2409

alexr00 avatar Mar 13 '24 16:03 alexr00