tomasbjerre / pull-request-notifier-for-bitbucket

Bitbucket Server plugin that invokes a custom URL when a pull request event is triggered.
Other
184 stars 74 forks source link

Erroneous button visible for Declined Pull Requests #227

Open Rychard opened 7 years ago

Rychard commented 7 years ago

Despite having no buttons configured, one appears for pull requests that are in the Declined status.

Additionally, this button does not appear for the user that submitted the pull request, nor does it appear for anyone listed as a reviewer for the pull request. I noticed both of these conditions when trying to reproduce the issue prior in our environment.

When clicked, nothing happens. The page doesn't refresh, no HTTP requests are made, and there is no output in the console, so this is just an visual annoyance and not a big deal.

The default text for the button is pr-triggerbutton, so perhaps it's related to one of these files?

tomasbjerre commented 7 years ago

Yes... it should be removed byt this line: https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/blob/ba712899a44e6f8261fb4633f7cd963e72f17c51/src/main/resources/pr-triggerbutton.js#L16

Rychard commented 7 years ago

Are you saying the issue has been resolved but not released? Or are you saying that the mentioned line was merely intended to resolve the issue, but perhaps is inadequate to remove the button in every scenario?

It doesn't appear that we have any pending updates to be installed, so I'm inclined to believe this particular issue is an edge-case even with the currently released version for Bitbucket 4.x (and possibly Bitbucket 5.x, as that file seems to be the same on the master branch as well).

I went back and checked a few dozen declined pull requests from our repositories, and while I have never seen the item shown when either of my two original conditions were met, I have seen instances where neither condition was met, and the button was not present. It seems that there exists some tertiary scenario that isn't accounted for by the code, but I can't seem to figure out what might be causing it even after a more thorough investigation. Can you think of anything I can check to identify the missing piece of the puzzle?

tomasbjerre commented 7 years ago

I just pointed out how it is intended to be removed :) So the bug is not fixed.

Would be interesting to see if the pr-triggerbutton.js file is being loaded. Perhaps in the network tab in Chrome.

Also if the parts of the javascript can be copied into the console and run to see what part does not work.

Den 23 juni 2017 23:11 skrev "Joshua Shearer" notifications@github.com:

Are you saying the issue has been resolved but not released? Or are you saying that the mentioned line was merely intended to resolve the issue, but perhaps is inadequate to remove the button in every scenario?

It doesn't appear that we have any pending updates to be installed, so I'm inclined to believe this particular issue is an edge-case.

I went back and checked a few dozen declined pull requests from our repositories, and while I have never seen the item shown when either of my two original conditions were met, I have seen instances where neither condition was met, and the button was not present. It seems that there exists some tertiary scenario that isn't accounted for by the code, but I can't seem to figure out what might be causing it even after a more thorough investigation. Can you think of anything I can check to identify the missing piece of the puzzle?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/227#issuecomment-310774025, or mute the thread https://github.com/notifications/unsubscribe-auth/AAa1E9RJAOxxX6KHzJZjbRW9oVhtGbvhks5sHCn_gaJpZM4OD9dJ .

omerfarukdogan commented 6 years ago

Same issue here. Note that it is removed for OPEN pull requests, but not removed for others. Looks like when 'plugin/prnfb/pr-triggerbutton' is called, '#pull-request-header-more' is not rendered yet.

image

image