Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

A disapprove button for pull requests

Lailoken42 August 16, 2013

If I click decline, it will shut down the pull request. If I make some comments then leave the pull request open, it will stay in my inbox. What I would like is a button that means I don't think the code should be merged yet, but I don't want to shut down the conversation for other code reviewers, and I don't want the pull request to stay in my inbox.

Is this something that already exists? Or would creating this button with a plugin be difficult?

4 answers

1 accepted

1 vote
Answer accepted
ThomasA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 19, 2013

Hi Corin,

I haven't seen a disapproval plugin for Stash yet. You could create a plugin which stores disapprovals against a pull request and even stop pull requests with disapprovals being merged (using a merge check). However with custom disapprovals there will be no integration with other pull request features such as the inbox.

It sounds like you may want to just mark the pull request as 'read' for the inbox rather than stopping merging?

Regards,

Tom.

Lailoken42 August 19, 2013

Actually we (the company I am interning at) want disapproval to behave exactly like approval, except display a little red X instead of a check mark and send out an email indicating disapproval. We don't even want to block the ability to merge (we leave that up to the developer).

I was thinking I could add another boolean representing disapproval, and just check for both in the places that matter to me, that way it wouldn't affect integration with the other features you mentioned.

So then what I need to do is to store an extra boolean with a PullRequestParticipant, modify the approve button slightly (to change it's toggling behavior a little bit), and modify the thumbnails and approval emails to look for a disapprove boolean as well.

The Stash developer guide is great for doing things like merge checks, but I'm not sure where to look if I need to change the behavior of existing code. The Jira dev guide seems to have some information regarding this, but I'm not sure how relevant that is to Stash. I was hoping someone could point me in the right direction to get started on this.

Thanks again,

Corin

ThomasA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2013

Hi Corin,

We don't really encourage or support changing existing Stash code, mainly as it could lead to issues as we refactor and enhance our code. Generally we provide extension points, an API and an SPI as described in the developer documentation. Most of the bevhaviour you would like to change does not have an extension point currently.

The supported way of adding dissapprovals yourself would be to write a plugin. The plugin would maintain a table linking disapprovals to pullrequests, add a seperate button to the pull request UI and some UI elements to show the number of disapprovals. However you will hit some limitations like reviewers being able to both approval and disapprove.

All in all given this is a such a core feature you are likely to run into some issues with integerating your feature, so it may end up being more work than you think. It may be better to raise a feature request for Stash at jira.atlassian.com

One of the best ways to look at how you can integrate with Stash is to look at the Stash source code which you can download as a license holder.

Hope that helps,

Tom.

0 votes
Dzianis Hurau July 6, 2020

Is there something for the current bitucket version?

0 votes
Carl Myers March 29, 2016

FYI, I wrote a version of this called the "stash disapproval plugin" - I think we only open-sourced it after this original question in 2013.

The company I worked for (and no longer work for) isn't really maintaining it anymore but I do occasionally work on fixes.  It is here:

https://github.com/terabyte/stash-disapproval-plugin

 

It supports stash 3.X and I am working on a Bitbucket 4.x version now.

 

0 votes
Lailoken42 August 19, 2013

An add on to my progonal questions is that I would like disapprove to show a red X instead of a green check mark as well.

After some digging, it seems the button itself would be trivial to make, however the disapprove state seems less obvious. Approval currently seems to be represented by a boolean in the PullRequestParticipant entity.

Is there a way to modify this? Is this functionality planned for a future release of Stash? If not, does anybody have any suggestions for how to go about implementing this?

Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events