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

Add support to assign reviewer / approver when creating topic #243

Open
dcaixinha opened this issue Feb 11, 2020 · 13 comments
Open

Add support to assign reviewer / approver when creating topic #243

dcaixinha opened this issue Feb 11, 2020 · 13 comments
Labels
area: topic info enhancement New feature or request

Comments

@dcaixinha
Copy link

Hey @tarsius, first of all thanks for this incredibly amazing package 🎉

One thing that I'd love to have is the ability to assign the reviewers for a Pull Request from forge. At work I'm using GitLab and after some digging it looks like they have an endpoint to do this.

I'm an Emacs Lisp noob but would be up to study this package and try to make a contribution. Would you be open to such a contribution? In your opinion should this functionality work for GitLab and GitHub at the same time? If you're open for such contribution, please give me some pointers on where to being 🙏

Thanks again 🙇‍♂️

@tarsius
Copy link
Member

tarsius commented Feb 17, 2020

This already supported. Move the cursor onto Assignees: none and press C-c C-e.

@tarsius tarsius added the support User needs some help label Feb 17, 2020
@mpolden
Copy link

mpolden commented Feb 19, 2020

Is it possible to assign reviewers when initially creating a pull request?

I'm a heavy Magit user and and Forge looks perfect for working with GitHub. Previously I used https://github.com/github/hub where I could create a pull request and assign reviewer(s) in a single step with hub pull-request -r username.

@tarsius
Copy link
Member

tarsius commented Feb 19, 2020

That's not supported yet. If you want to implement this yourself, then look at forge--submit-create-issue and forge--topic-parse-yaml, and draw your conclusions from that.

@dcaixinha
Copy link
Author

@tarsius but your suggestion (to use C-c C-e) will edit/add an Assignee to the MR, not a reviewer, right? My question was to have this exact same functionality but for reviewers.

@tarsius
Copy link
Member

tarsius commented Feb 23, 2020

Yes, but my advice "look at how it is done for X and do the same for Y" still stands.

@tarsius
Copy link
Member

tarsius commented Feb 23, 2020

Looks like I was wrong though.

  1. Forge does not provide an interface for conveniently setting the assignee (or to request a review). It does however support issue templates and the user can manually write what one would put into such a template. But its inconvenient.
  2. Issue templates support assignees but not review requests so we actually can't "just do the same" here.

See https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#creating-issue-templates.

@tarsius tarsius added enhancement New feature or request and removed support User needs some help labels Feb 23, 2020
@dcaixinha dcaixinha changed the title Add support to assing reviewer / approver Add support to assign reviewer / approver Feb 28, 2020
@dcaixinha
Copy link
Author

I think we're talking about two different issues here:

  1. The ability to set a reviewer the same way we're able to set an assignee (as we do with C-c C-e on a PR – especially in GitLab (is this already possible with GitHub?)
  2. The ability to create a PR an set a reviewer in one single step

Should this be split into 2 issues?

@tarsius
Copy link
Member

tarsius commented Feb 28, 2020

Should this be split into 2 issues?

No.

@dcaixinha
Copy link
Author

Any reason why? Do you agree these are two different issues?

@tarsius
Copy link
Member

tarsius commented Feb 28, 2020

While maybe not the same, they are still closely related and I will likely tackle both of them at the same time. Also I sleep better if there are fewer issues.

@rbugajewski
Copy link

This comment might be of interest to people who are researching this subject.

I’ve searched for a way to change the reviewer & assignee for GitLab Merge Requests (MR) from inside forge, because I was always visiting the website, which is kind of clunky and slow compared to an Emacs-native workflow.

So in addition to the ability to use C-c C-e on the corresponding fields in the topic, I discovered that there are already two functions present in the current version of forge that aid in both use cases: forge-edit-topic-assignees and forge-edit-topic-review-requests (I couldn’t find a way to add a field to a forge topic, and I prefer evil-like key bindings, hence the search for an alternative solution).

After I discovered that these two functions exist and indeed work perfectly for my use case, I tried to add them to the forge transient buffer, but initially failed, because the available documentation is of a rather theoretical nature, and I’m not proficient enough with either Lisp or the Emacs ecosystem to build a working example out of it. After some web research I finally cobbled together a working solution, added it to my init.el, and it looks way easier than initially thought:

(require 'forge)
(transient-append-suffix 'forge-dispatch '(0)
 ["Edit"
  ("e a" "assignees" forge-edit-topic-assignees)
  ("e r" "review requests" forge-edit-topic-review-requests)])

I didn’t meant to hijack this thread, but in my opinion the above addition already solves this issue for me.

@gf3
Copy link

gf3 commented Mar 22, 2023

For anyone finding this in 2023 and onward, you can assign a reviewer after a pull request is open by selecting the Review-Requests line and hitting C-c C-e

Screenshot 2023-03-22 at 4 35 25 PM

@bklebe
Copy link

bklebe commented Oct 31, 2023

any way to assign a team under an organization with this mechanism (e.g. org/team)? all I see are users.

@tarsius tarsius changed the title Add support to assign reviewer / approver Add support to assign reviewer / approver when creating topic Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: topic info enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants