Questionnaire/Checklist for Bitbucket Pullrequest reviewers
Asked Answered
A

5

12

I am trying to see if I can enforce a questionnaire in Bitbucket before reviewers approve a Pull-request. Sample questions that I would like to use are..

  1. If the changes made are to a global repository shared among many regions, did you check with the reviewers if he/she informed the global team or any particular individuals?
  2. Did you check variable naming conventions?
  3. Are there enough comments around any complex logic?
  4. Are there enough unit tests around the new logic and where it is relevant, did you check the code coverage report?

These are just some sample questions and some of them of course can be monitored using various plugins during the build process or in Sonar etc, but there are always things where we have no immediate way of automating, like the first sample question above. So, until they can be automated, I at least want to make sure those questions are addressed before a pull-request is approved.

Question: Has anybody thought of a similar situation and found any support directly with in Bitbucket or using any plugins? My quick google search didn't yield any useful results

Acropetal answered 17/7, 2016 at 14:22 Comment(0)
D
5

Edit: As correctly pointed out, this was discontinued.

We encourage teams to use tasks for any guidelines they wish to enforce, and we encourage teams to continue to use a CONTRIBUTING.md file for contribution guidelines.


Obsolete Answer:

Check the Pull Request Guidelines plugin:

https://prguidelines.services.atlassian.com/

Description answered 24/8, 2016 at 18:27 Comment(1)
That's a dead link now - Atlassian have discontinued BB PR Guidelines. See community.atlassian.com/t5/Bitbucket-articles/…Informal
L
4

The Scriptrunner add-on reports being able to create tasks within a pull request when the pull request is created.

You can also watch and vote for the feature suggestion for adding the behaviour as core on jira.atlassian.com.

That said, it is a somewhat unusual request in that it may be adding process overhead too late in the process. The things you list as tasks would, to me, be things that should be checked (hopefully as a matter of course) before creating a pull request, and that reviewers would call out as missing as part of their review.

Disclosure: I work for Atlassian

Lehrer answered 19/7, 2016 at 9:0 Comment(0)
J
2

If you're looking for a way to have simple custom check lists (tasks) in your pull-requests, this appears to be a feature in the Premium version of Bitbucket as discussed in this bitbucket blog post, you can create tasks from comments (any version of bitbucket):

click Create task from a comment

However, you'll need the 'Premium' plan if you want to be able to "Require pull request task completion.".

Using the dedfault tasks for bitbucket app, you can setup default tasks on a per-repository basis. e.g. if you have a repository which is heavy on schema changes, you may wish to always include a task of "Have you checked with DBA team if this schema affects downstream processes", or "Does the code conform to company coding standards and conventions".

Joashus answered 21/6, 2018 at 4:4 Comment(0)
R
1

I don't have solutions for all your requests, but have for at least 2 of them:

Did you check variable naming conventions? That should be done automatically before PR even created. You could use checkstyle/findbugs or any other linting/static analysis tool. Let the people concentrate on reviewing actual changes rather than naming.

Are there enough unit tests around the new logic and where it is relevant, did you check the code coverage report? The one thing i learned - people never checks coverage (or any other) report. So bring that coverage information inside the PR instead. There is a Code Coverage Plugin for Bitbucket Server you could use.

Reform answered 30/4, 2018 at 7:19 Comment(0)
P
0

According to this discussion recommended way to keep code review checklist is pull request checklist buddy feature, which is implemented and still supported.

Photosensitive answered 20/8 at 4:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.