Automatically link Magento Patches in Bitbucket

Bitbucket includes a really nifty feature for linking issues using regex — that way it can easily integrate with any system that utilizes ticket keys as a URL part identifier.

Image for post
Image for post

Thanks to the existence of Magento.com/security/patches — we can now utilize this same system to automatically link Magento Patch names to their patch posts (for more information!)

Setting this up couldn’t possibly be easier (though time consuming if you want to do it for a lot of projects — as it has to be setup on a project-by-project basis).

Load up your Project in Bitbucket, and go to Settings > [Integrations] Links

Image for post
Image for post

Click “Add a custom link” (all the way there at the bottom)

Image for post
Image for post

And fill out the pop-up thusly:

Image for post
Image for post

For copy/paste purposes, thats:

Replacement URL: https://magento.com/security/patches/\1
Raw regex: ((?<!\w)((SUPEE)-\d+)(?!\w))

And voila! SUPEE-6788 (for example) will automatically link to https://magento.com/security/patches/SUPEE-6788 in any commits, pull requests, etc.

Written by

Magento, PHP, Minecraft (Shotbow) & More

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store