I'm looking into custom merge checks with forge.
What I want to implement is a merge check that prevents merging a PR if the linked Jira issue is not in the correct status. Only once a Jira ticket has gone through approval do we want to merge the PRs.
Looking at the documentation for custom merge checks, I see that there are triggers to evaluate the merge check when code is pushed to the PR branch etc.
For my check to work, I need to also be able to trigger based on events in jira, i.e. I need to re-evaluate the merge check when the linked jira issue changes its status.
Is this possible?
Hi Nick,
There is no trigger to invoke the merge check based on the linked Jira tickets' status. You can see the available triggers here:
However, the on-merge trigger can be used, which is invoked when someone tries to merge a PR. If this type of check fails and if the check was configured to be Required, then the merge will be aborted.
Would this work for you?
Kind regards,
Theodora
Thanks for your response Theodora.
It's not great since it requires that the developer tries to merge and then gets rejected. It would be much better if they can know ahead of time whether this is good to merge or not. I'd even want to notify them somehow (e.g. through an automated comment on the PR) that the result of the check has changed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nick,
Thank you for the feedback.
I created a feature request for what you're asking in our public issue tracker:
I suggest adding your vote to that feature request (by selecting the Vote for this issue link) as the number of votes helps our product managers better understand the demand for features. You are more than welcome to leave feedback, and you can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to be notified via email on updates.
Implementation of new features is done as per our policy here and any updates will be posted in the feature request.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Theodora Boudale !
If there was an easy way to trigger the re-computation of a custom merge check through a Jira automation rule, that might also be a step in the right direction.
Is that possible?
Then I can have the triggering logic on the Jira side but implement the more complex merge-check logic in code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nick,
I don't believe that is possible, but I haven't worked extensively with Forge apps so I am not 100% sure. You can ask your question here:
This group is specifically for Forge for Bitbucket Cloud and and they may be able to give you a workaround, if a workaround exists.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.