reconquest / atlassian-external-hooks

External Hooks plugin for Atlassian Bitbucket
https://external-hooks.reconquest.io
Other
44 stars 37 forks source link

Unable to merge changes: summaryMessage #75

Closed kchawlaSP closed 4 years ago

kchawlaSP commented 5 years ago

I upgraded external hooks to 4.5-3 and I now see an error "summaryMessage" when trying to merge a change. I am using bitbucket server 5.14.1

kchawlaSP commented 5 years ago

After downgrading back to 4.5-2, I am able to merge changes.

kovetskiy commented 5 years ago

@kchawlaSP Hi, thank you for your feedback, I'm looking into it.

kovetskiy commented 5 years ago

@kchawlaSP Hi again, I have tested plugin version 4.5-3 on bitbucket version 5.14.1 and was not able to reproduce your problem, I have tested merge check hook that returns exit 0 and exit 1 (with message) and exit 1 (without message). Everything was working as expected.

Can you please help me to investigate this problem by providing steps to reproduce your problem? Also, can you send a screenshot of this "summaryMessage" error? Because I can't even find a place in the code where such error could happen (we have summaryMesssage variable, but I can't imagine in which case variable name can be transformed to an error message).

Thanks.

kchawlaSP commented 5 years ago

@kovetskiy, i just upgraded our production instance and I am seeing the issue there. I am actually seeing it on 4.5-2 now as well. It happens when I first open the PR. If I go ahead and add another commit to my branch, I am able to merge. I am not sure exactly what is happening.

screen shot 2018-11-15 at 7 31 43 am
kchawlaSP commented 5 years ago

Editing the pull request title/description will get rid of the message.

kchawlaSP commented 5 years ago

I downgraded to 4.4-1 and everything seems to work.

kovetskiy commented 5 years ago

@kchawlaSP I believe I understand the nature of your problem now.

The plugin doesn't run merge check hook on every page visit, the plugin runs merge check hook once for every pull-request update, stores the result in the database and shows it next time when you visit pull-request's page.

You can see this logic here: https://github.com/reconquest/atlassian-external-hooks/blob/f2a1bbcf10fb77e069dd33e3bdfbf7f466a47c14/src/main/java/com/ngs/stash/externalhooks/hook/ExternalMergeCheckHook.java#L129-L156

There is only one explanation of "summaryMessage" error, some time ago you had a hook that was showing "summaryMessage" text message and now plugin remembers that state and shows this message for that version of pull-request.

As you said, editing the pull request itself in any way (title, description or commit) will update version (internal terminology) of pull request and merge check hook will be triggered again.

In 4.5-2 we just don't have this feature.

I hope it is helpful for you.

kchawlaSP commented 5 years ago

But that isn't the entire problem. it shows summaryMessage, which is not coming from my merge check hook. Feel free to send me your hook and I can test it on my server.

If there are additional logs I can send you, let me know how to do that as well.

seletskiy commented 5 years ago

@kchawlaSP: can you try to upgrade plugin to version 4.6-1? We introduced additional check here so merge check is called everytime underlying script changed.

andrewkro commented 5 years ago

@kovetskiy thanks for the details.

we currently use the merge check to do custom work in JIRA, which updates over the life of the PR. so having it never check back and re-run the script has broken the workflow for us.

Would it be possible to make the caching result configurable so we can turn it off forcing merge to run on every page refresh (or set a custom TTL on the cache?)

Ill have to downgrade as well for the moment.

Thanks!

kovetskiy commented 5 years ago

@andrewkro Hello, yes, we are going to make this caching configurable. There is no ETA, but I will keep you posted.

seletskiy commented 4 years ago

Closed due architecture changes made in BB.