I recently moved to the new Bitbucket interface and what I remarked is that I need to approve commits after pushing them.
It's a good feature, but it's inconvenient for my work-flow. Is there an option to disable it and have the commits automatically approved?
Edit: I uploaded an image of the Approve button.
"Approve" is not necessary, is an extra feature to know who reviewed the commit. From Bibucket's blog post:
Giving the green light
Bitbucket has a light-weight approval process that allows participants
to Approve a commit or pull request – this signifies that a user has
reviewed a change and that it LGTM.
Later, when browsing the list of commits or pull requests, Bitbucket
displays the total number approvals for a particular change as a gray
circle.
A gray badge shows how many reviewers have approved a particular
change – now, for those commits or pull requests that you personally
have approved, the badge is now green giving you a quick summary of
changes that are yet to be reviewed by you.
Related
In Bitbucket, on any Pull Request, reviews are disabled after the PR is merged.
I'd like to continue to allow reviews after a PR is merged. Is this possible?
NOTE: I am not asking about requiring review approval pre-merge, though I may or may not have those requirements as well. I want post-merge reviews.
In Github, by way of comparison, it is possible to "review" a PR even after it is merged.
I tried clicking the greyed-out "review" button after merging, which obviously did nothing. If the page is reloaded the "review" button is entirely gone.
I have been in contact with a wonderful Product Manager at Atlassian, and he let me know that this used to be an accidental "feature" of BitBucket, which they considered a bug, and fixed as of several months ago. This is why people have a memory of post-merge reviews, which seem to no longer be possible (because, they indeed are no longer possible).
He explained that once they "fixed" the bug they heard from users who had built workflows around it, and wanted the "bug/feature" back.
There is a public issue tracker for this if you are interested in weighing in on it!
https://jira.atlassian.com/browse/BCLOUD-22396
Atlassian has not yet decided if/when/how they will bring the "bug/feature" back.
I have used a few code review programs. I am now using pull requests in Bitbucket. I am expecting a certain process:
Create review (ie pull request)
Comments are added by reviewers. ( am used to a graded system where someone can mark the change as a bug which needs to be fixed before being merged)
The review is sent back to the originator who fixes any problems that are marked
(!!)The originator pushes their changes to their branch and then the code review is done again by all reviewers who then approve or reject the new changes.
With all things being good, the review is approved and then merged.
What I am wondering about are steps 3 and 4. There seems no grading to the comments and there seems to be no way for the originator to see quickly the comments (in some condensed format). Also, how do new changes update a pull request? Is this just missing from the Bitbucket system or is there a way to achieve this?
"there seems to be no way for the originator to see quickly the comments (in some condensed format)". Open a pull request, and look over on the right hand side. I see 3 tabs: Details / Files / Activity. Under "Activity", I can filter to "All Comments".
"how do new changes update a pull request?" When creating a pull request, you are requesting approval from your colleagues to pull code from some source branch to some target branch. So, when the source branch is updated with changes, the pull request should automatically reflect that. In other words, you shouldn't have to take any extra action.
"There seems no grading to the comments" A reviewer can check a box that says "merge not allowed until the 'issue fixed' box is checked." The repo admin has some latitude to set how strict the PR / merge policies will be, including whether approval is needed from anyone or from specific individuals.
So I understand that once I open a pull request, I automatically get a code review for the code that's about to be merged, that's great! But is there a a way to create a Code review without creating a Pull Request? For example, let's say I am working on a feature and I would like to do a code review with peers, but I don't want to do a Pull Request as the feature is still Work In Progress.
I understand that I can use the "compare" feature in BitBucket to see the code diff, but I needed the "Codereview" kind of feature explicitly so that I can:
Share the code review link with my peers so that they can see it
They can comment and open "tasks" on the code
and all of it while not creating a Pull Request. Is that possible?
Question is already asked here.
The usual process is to start code review based on a pull-request (this is how I understand the usage in BitBucket).
It is acceptable to create the pull-request and mark it as in progress and you can always add more commits on the PR later.
This is explained in the official doc:
But, the pull request is more than just a notification—it’s a dedicated forum for discussing the proposed feature. If there are any problems with the changes, teammates can post feedback in the pull request and even tweak the feature by pushing follow-up commits. All of this activity is tracked directly inside of the pull request.
Your peers must be aware that you don't need immediate approval but just comments until you finish the feature (PR ready to be merged)
Question
How do you search for commits which have ever received CodeReview-2 in the past from a given reviewer?
Context
Basically I want to do a retrospective on every commits I've ever rejected so that I can share those the comments to more people.
It's very easy to get the commits I'm currently rejecting using the search terms reviewer:self label:CodeReview-2.
But once the owner of the commit fixes the issue with a new patchset and I put a +2 on it, I won't be able to search for that commit anymore.
So I'm looking for something like had-label:CodeReview-2.
At our local installation we get an email from gerrit at each scoring.
Thus, as a workaround, you can search for emails from gerrit containing "< your login > has posted comments on this change." and "Code-Review-2".
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I have a small team of developers that use bitbucket as our git repository.
I want to know how to limit who can merge code on a pull request in bitbucket? AND/OR force at least one approval before the merge can be done. Basically I am looking to force a code review.
As of now the creator of a pull-request (and everyone else) can not only approve but also merge the code in which can be an issue for quality purposes. Thanks in advance.
Update:
Bitbucket now allows for control over push permissions, branch deletion, and history re-writing. The full management instructions are here: https://confluence.atlassian.com/bitbucket/branch-management-385912271.html
There still is not a way to force a minimum number of approvals however.
I want to know how to limit who can merge code on a pull request in bitbucket? AND/OR force at least one approval before the merge can be done. Basically I am looking to force a code review.
This functionality is not available in Bitbucket right now, but Atlassian's behind-the-firewall version of Git hosting has it.
Stash allows you to:
limit who can change branches
enforce a minimum number of approvals before merging pull requests (it can do a similar thing for Bamboo builds - i.e. the code must compile before it can be merged)
reset approvals if a pull request changes
It's a curious asymmetry in Atlassian's own products.
Answer from attlassian:
Mary Anthony [Atlassian Technical Writer]
Hi,
So, a repository can have branches. Within that repository, you can't
set permissions on a branch that are different from the repository.
You can set permissions on the repository that would allow developers
to fork the repository and issue pull requests against it. To
configure this:
Create a group on your account and call it "developers".
Give the group read permissions.
Add all the developers to that group.
Edit the groups on the repository and add developers.
Hope this helps.
Mary
Here it is: https://confluence.atlassian.com/display/BITBUCKET/Work+with+pull+requests?focusedCommentId=321851850#comment-321851850
In other words, you can make your dev fork the project and issue pull requests from their fork. In your project , you can set the project to disallow public fork. I assume that they will fork the project and it will be hidden. That said, they will be able to issue pull request and edit their own repository. It looks quite akward but it should work.
I don't have the feeling that there is a good way to handle permissions on github/bitbucket and so on.
edit
Not really a solution to enforce it but still quite valid. Since approval of pull-request is quite optional. Doesn't mean that you're screwed and in fact, if I were you. I wouldn't try to enforce a system. The reality is that code review is important. Pull request makes it easier to review sets of commits.
I worked many months being the only one in my team to create/approve pull requests. The team in which I worked decided that pull requests was a waste of time and I guess that none of them did code review until I left. Last thing I heard is that my team mate is currently refactoring my code because he has no idea how it works.
What I'm trying to say is that code review shouldn't be enforced and your team should see it as a quite important thing to do. Each member of your team should work together and code review each others on their own. By doing code review, they will have the right to deny code that they feel is "ugly" or should be designed in a different way. Each member get to stay updated on what other devs are working and may not have much problem switching on anybody's work in case of illness, departure or death!
Enforcing the process in the system could be good from a manager's point of view. But I believe that having approval as optional isn't bad either. And then, the manager's job will be to check the merged pull request for the pull request with 1 or less approved person. Check who merged the pull request and who approved. Find someone to review the code anyway.
On the other hand, if a pull request is hanging around forever and nobody is reviewing it. It's the dev task to ask a mate to review it.