pull-request-notifier-for-bitbucket
pull-request-notifier-for-bitbucket copied to clipboard
Is there a way to hide a button depending on the ChangeSet?
I want to add buttons to kick a Jenkins Job that will build and Publish an rpm package. However, if the repo changes in Bitbucket do not have changes to the packaging/ sub directory... I do not want to show the button as an option. Triggering that build job would be meaningless for the 99% of PRs that do not have that change set. Is there a way to have a script run that will hide the button if it doesn't find the required changes?
Can we disable the button if the pull request is not approved? Use case : we have added a sanity button to trigger some tests and we want this button to be enabled only if the pull request is approved.Is it feasible?
@mkjkec2005 yes by setting the filter text to ${PULL_REQUEST_REVIEWERS_APPROVED_COUNT} and the filter regexp to ^[^0]+?.
I have 2 buttons to run UT and sanity and each of the button trigger a specific Jenkins job . For sanity button , i have already configured Filter string as ${BUTTON_TRIGGER_TITLE} and Filter regexp as "Sanity" ( title of the button) . Can i still use the mechanism you suggested to keep the button disabled if PR is not approved ? Note: We are using plugin version 3.24 and BB version is 5.14.1
Yes. You can have several variables in the filter text ${BUTTON_TRIGGER_TITLE}${PULL_REQUEST_REVIEWERS_APPROVED_COUNT}. And the regrxp would be Sanity[^0]+?
Thank you so much . This is Awesome !!
Can we also link this button to failed build ? For instance , i want to hide the button if the pull request has failed build ? My pull request is linked to 2 jobs - unit test and sanity. If unit test fails , i want to hide sanity button. So in summary , sanity button should be visible only if pull request is approved and has 1 successful build.
Can i also filter based on the comment text ? I tried ${PULL_REQUEST_COMMENT_TEXT} but it is coming as empty string.
Current regex (working fine for showing sanity button only if we have approval by default reviewers) ${BUTTON_TRIGGER_TITLE}${PULL_REQUEST_REVIEWERS_APPROVED_COUNT}${PULL_REQUEST_REVIEWERS_APPROVED_DISPLAY_NAME}
Since the requirement is to attach it with build status , i was planning to post a comment to PR if build is successful and use the comment text to filter the Sanity button. Please let me know if this is fine or we have a better alternative.
This is the only requirement pending and other than this the plugin works exceptionally well. Thanks again!