A Chrome extension to warn a user if a pull request that can be merged contains multiple commits.
Bitbucket Merge Check Extension
The Bitbucket Merge Check Chrome extension helps to ensure that individuals with merge rights do not accidentally merge a pull request that contains multiple commits.
If a pull request has multiple commits, it can be configured to:
- change the colour of the web page around the 'Merge' button to 'Yellow' to visibly warn the user that the pull request contains multiple commits
- when the 'Merge' button is clicked, prompt the individual to confirm that the merge operation should proceed with multiple commits being merged
- display the number of commits in the pull request in the text of the 'Merge' button
If a pull request has only a single commit, it can be configured to change the colour of the web page around the 'Merge' button to 'Green' to indicate that it is safe to merge the pull request.
If a pull request cannot be merged, it can be configured to change the colour of the section around the 'Merge' button to 'Grey' to indicate that the pull request cannot be merged.
Commit Message Widening:
The extension can be configured to allow for widening of commit message pop-up dialogs so they will wrap at around 80 characters in length. If commit messages follow best practices of stopping around 72-75 characters, this means no wrapping will occur. As a result, the commit messages look better (no unexpected short lines, due to early wrapping of the prior line) are easier to read because they will wrap when the author intended.
This feature can be enabled/disabled by the 'Widen Commit Message Popup' option in the configuration options of the extension.
Pull Request List Highlighting:
The extension can be configured to highlight pull requests in the list of pull requests with a background colour so that the status of the pull request is more immediately evident to a reviewer.
Pull requests are highlighted with the following background colours:
* red: A build has failed
* yellow: There are conflicts or a reviewer has marked the pull request 'Needs Work'
* blue: A build is in progress or has succeeded; it needs review (no reviewer has marked the pull request 'Needs Work' or 'Approved')
* green: A build has succeeded and a reviewer has marked the pull request 'Approved'
This feature can be enabled by the 'Highlight Pull Requests' option in the configuration options of the extension.
Add Jira Status to Branch List Information:
The extension can be configured to add the status of the Jira issue into the information displayed for the list of branches.
By default, for each branch in the repository, Bitbucket provides the Jira issue associated with the most recent commit. This feature queries Jira to determine the status of the issue and includes this information in what is displayed, so it is easier to make a decision about a branch at a glance.
This feature can be enabled by the 'Add Jira Status to Branches List' option in the configuration options of the extension. A Jira host and token must be configured in the extension options in order to enable this feature.
Order Tags in Drop-down Lists:
The extension can be configured to order the tags displayed in the 'Tags' dropdown list according to Semantic Versioning v2 with the most recent version displayed at the top of the list.
By default, Bitbucket provides the tags in the order in which they were created which can make it difficult to locate an older tag by scrolling the list as the tag may appear randomly in the list (applying a filter is really the only solution to reliably locate it).
This feature can be enabled by the 'Order Tags in Drop-down Lists' option in the configuration options of the extension.
Pull Request Jira Issue Version Information
The extension can be configured to display the version information for the Jira issue that is associated with a pull request. When enabled, if an associated Jira issue's `fixVersions` field is populated with values, the versions will be displayed immediately below the link to the Jira issue.
Additionally, the link to the Jira issue is given a tooltip of the Jira issue's summary so that this information is more easily accessible to the reviewer.
This feature can be enabled by the 'Order Tags in Drop-down Lists' option in the configuration options of the extension.
Notes:
This extension is only applicable to Bitbucket Server 7 and beyond; it does not work with Bitbucket Cloud or Bitbucket Server 6 and lower.
Change Log:
2.7 (2024-12-11)
* Remove the unused `activeTab` permission from the manifest
2.6 (2024-12-02)
* Update npm package dependencies
* Improve the instructions for host name values
* Gracefully handle a failure to retrieve Jira information
* Address 'merge check' issues introduced by the the recently added 'auto-merge' feature.
* Add the display of version information for Jira issues associated with pull requests.
2.5 (2023-02-13)
* Update to Chrome Extension Manifest format v3.
* Order tags according to Semantic Versioning v2 with the latest version appearing at the top of the list.
2.4 (2022-09-07)
* Add the status of the Jira issue next to the Jira issue id in the Bitbucket branches list of a repository.
2.3 (2022-08-08)
* Correct an issue where the width of commit message pop-ups on pull request
pages were not extended.
* Correct an issue where feature-specific styles were enabled/active when the
associated feature was disabled in extension options.
- Feature-specific styles are only enabled now when the feature is enabled.
2.2 (2022-08-02)
* Highlight pull requests when viewing them in the pull requests list so that
the status is more clearly communicated to reviewers.
- The rows are highlighted as follows (worst -> best):
* red: A build has failed
* yellow: There are conflicts or a reviewer has marked the pull request
'Needs Work'
* blue: A build is in progress or has succeeded; it needs review (no
reviewer has marked the pull request 'Needs Work' or 'Approved')
* green: A build has succeeded and a reviewer has marked the pull request
'Approved'
2.1 (2021-04-05)
* Extend the width of the Bitbucket commit message pop-up
- When hovering over a commit or a message in a pull request or commit
list, Bitbucket displayed a pop-up window with the Git commit message
that wrapped at approximately 60 characters with font-family 'monospace'
and font-size '12px'
- By extending the width, Git commit messages that adhere to the standard
width of 72 characters are not displayed with wrapped lines
2.0 (2021-03-01)
* Support for Bitbucket Server 7+
- Tested with Bitbucket Server 7.6 (LTS)
- Bitbucket Server 6 and lower are no longer supported.
1.0 (2020-04-01)
* Initial version
Read more
If a pull request has multiple commits, it can be configured to:
- change the colour of the web page around the 'Merge' button to 'Yellow' to visibly warn the user that the pull request contains multiple commits
- when the 'Merge' button is clicked, prompt the individual to confirm that the merge operation should proceed with multiple commits being merged
- display the number of commits in the pull request in the text of the 'Merge' button
If a pull request has only a single commit, it can be configured to change the colour of the web page around the 'Merge' button to 'Green' to indicate that it is safe to merge the pull request.
If a pull request cannot be merged, it can be configured to change the colour of the section around the 'Merge' button to 'Grey' to indicate that the pull request cannot be merged.
Commit Message Widening:
The extension can be configured to allow for widening of commit message pop-up dialogs so they will wrap at around 80 characters in length. If commit messages follow best practices of stopping around 72-75 characters, this means no wrapping will occur. As a result, the commit messages look better (no unexpected short lines, due to early wrapping of the prior line) are easier to read because they will wrap when the author intended.
This feature can be enabled/disabled by the 'Widen Commit Message Popup' option in the configuration options of the extension.
Pull Request List Highlighting:
The extension can be configured to highlight pull requests in the list of pull requests with a background colour so that the status of the pull request is more immediately evident to a reviewer.
Pull requests are highlighted with the following background colours:
* red: A build has failed
* yellow: There are conflicts or a reviewer has marked the pull request 'Needs Work'
* blue: A build is in progress or has succeeded; it needs review (no reviewer has marked the pull request 'Needs Work' or 'Approved')
* green: A build has succeeded and a reviewer has marked the pull request 'Approved'
This feature can be enabled by the 'Highlight Pull Requests' option in the configuration options of the extension.
Add Jira Status to Branch List Information:
The extension can be configured to add the status of the Jira issue into the information displayed for the list of branches.
By default, for each branch in the repository, Bitbucket provides the Jira issue associated with the most recent commit. This feature queries Jira to determine the status of the issue and includes this information in what is displayed, so it is easier to make a decision about a branch at a glance.
This feature can be enabled by the 'Add Jira Status to Branches List' option in the configuration options of the extension. A Jira host and token must be configured in the extension options in order to enable this feature.
Order Tags in Drop-down Lists:
The extension can be configured to order the tags displayed in the 'Tags' dropdown list according to Semantic Versioning v2 with the most recent version displayed at the top of the list.
By default, Bitbucket provides the tags in the order in which they were created which can make it difficult to locate an older tag by scrolling the list as the tag may appear randomly in the list (applying a filter is really the only solution to reliably locate it).
This feature can be enabled by the 'Order Tags in Drop-down Lists' option in the configuration options of the extension.
Pull Request Jira Issue Version Information
The extension can be configured to display the version information for the Jira issue that is associated with a pull request. When enabled, if an associated Jira issue's `fixVersions` field is populated with values, the versions will be displayed immediately below the link to the Jira issue.
Additionally, the link to the Jira issue is given a tooltip of the Jira issue's summary so that this information is more easily accessible to the reviewer.
This feature can be enabled by the 'Order Tags in Drop-down Lists' option in the configuration options of the extension.
Notes:
This extension is only applicable to Bitbucket Server 7 and beyond; it does not work with Bitbucket Cloud or Bitbucket Server 6 and lower.
Change Log:
2.7 (2024-12-11)
* Remove the unused `activeTab` permission from the manifest
2.6 (2024-12-02)
* Update npm package dependencies
* Improve the instructions for host name values
* Gracefully handle a failure to retrieve Jira information
* Address 'merge check' issues introduced by the the recently added 'auto-merge' feature.
* Add the display of version information for Jira issues associated with pull requests.
2.5 (2023-02-13)
* Update to Chrome Extension Manifest format v3.
* Order tags according to Semantic Versioning v2 with the latest version appearing at the top of the list.
2.4 (2022-09-07)
* Add the status of the Jira issue next to the Jira issue id in the Bitbucket branches list of a repository.
2.3 (2022-08-08)
* Correct an issue where the width of commit message pop-ups on pull request
pages were not extended.
* Correct an issue where feature-specific styles were enabled/active when the
associated feature was disabled in extension options.
- Feature-specific styles are only enabled now when the feature is enabled.
2.2 (2022-08-02)
* Highlight pull requests when viewing them in the pull requests list so that
the status is more clearly communicated to reviewers.
- The rows are highlighted as follows (worst -> best):
* red: A build has failed
* yellow: There are conflicts or a reviewer has marked the pull request
'Needs Work'
* blue: A build is in progress or has succeeded; it needs review (no
reviewer has marked the pull request 'Needs Work' or 'Approved')
* green: A build has succeeded and a reviewer has marked the pull request
'Approved'
2.1 (2021-04-05)
* Extend the width of the Bitbucket commit message pop-up
- When hovering over a commit or a message in a pull request or commit
list, Bitbucket displayed a pop-up window with the Git commit message
that wrapped at approximately 60 characters with font-family 'monospace'
and font-size '12px'
- By extending the width, Git commit messages that adhere to the standard
width of 72 characters are not displayed with wrapped lines
2.0 (2021-03-01)
* Support for Bitbucket Server 7+
- Tested with Bitbucket Server 7.6 (LTS)
- Bitbucket Server 6 and lower are no longer supported.
1.0 (2020-04-01)
* Initial version
Source Manifest.json
{"update_url": "https://clients2.google.com/service/update2/crx", "name": "Bitbucket Merge Check", "version": "2.7.0", "description": "A Chrome extension to warn a user if a pull request that can be merged contains multiple commits.", "background": { "service_worker": "background.js" }, "content_scripts": [ { "matches": [ "https://*/*" ], "css": [ "contentScript.css" ], "js": [ "contentScript.js" ] } ], "icons": { "16": "images/merge16.png", "32": "images/merge32.png", "48": "images/merge48.png", "128": "images/merge128.png" }, "options_page": "options.html", "options_ui": { "page": "options.html", "open_in_tab": false }, "action": { "default_icon": { "16": "images/merge16-deactivated.png", "32": "images/merge32-deactivated.png", "48": "images/merge48-deactivated.png", "128": "images/merge128-deactivated.png" } }, "permissions": [ "storage" ], "web_accessible_resources": [ { "resources": [ "commitMessageWidening.css", "pullRequestHighlighting.css" ], "matches": [ "https://*/*" ] } ], "manifest_version": 3}
Read more