reconquest / atlassian-external-hooks

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

Pre Receive Hook behavior on Jira Create Branch #92

Closed aronfe closed 4 years ago

aronfe commented 5 years ago

Suspecting different behavior using Pre Receive Hook add-on in Bitbucket version 4.02 vs. Bitbucket version 6.4.0

When we are creating a branch in Jira 7.13.4 it does NOT trigger the Pre Receive Hook in Bitbucket 4.02, however when we are creating the branch in Jira 7.13.4 it DOES trigger the Pre Receive Hook in Bitbucket 6.4.0

Could this be correct?

kovetskiy commented 5 years ago

Hi, yes, that's correct.

Here is the list of events that will trigger Pre Receive Hook: https://github.com/reconquest/atlassian-external-hooks/blob/465c5dd51551b8ccea5ca9da630fb477c529e3b0/src/main/java/com/ngs/stash/externalhooks/hook/ExternalPreReceiveHook.java#L54-L60

We can expose this list of triggers and make them configurable if the current behavior disrupts your workflow.

Thank you for the report.

ericfru commented 5 years ago

Hi There,

Thank you for that information. Just for potential other issues we may come across, are you able to provide us with a list of the major changes done between these versions? (I know it's a lot I'm sure as we're making a big jump).

Thank you,

seletskiy commented 5 years ago

Adding to the fact that Pre- and Post- hooks are now triggered on Tag/Branch Creation/Deletion most important changes outlined below.

Following environment variables are now marked as deprecated and their alternatives should be considered to be used instead. No immediate change required.

    STASH_USER_NAME → BB_USER_DISPLAY_NAME
    STASH_USER_NAME → BB_USER_DISPLAY_NAME
    STASH_USER_EMAIL → BB_USER_EMAIL
    STASH_REPO_NAME → BB_REPO_SLUG
    STASH_REPO_IS_FORK → BB_REPO_IS_FORK
    STASH_PROJECT_KEY → BB_PROJECT_KEY
    STASH_BASE_URL → BB_BASE_URL
    STASH_REPO_CLONE_SSH → BB_REPO_CLONE_SSH
    STASH_REPO_CLONE_HTTP → BB_REPO_CLONE_HTTP 

Following environment variables were removed without replacement due limitations in Bitbucket Server starting from 6.2.0.

    STASH_PROJECT_NAME
    STASH_IS_DIRECT_WRITE
    STASH_IS_DIRECT_ADMIN 

Merge Check will no longer add comments to Pull Requests or automatically reject them and no such configuration is possible.

Pre- and Post-Receive Hooks will now always pass theirs' output to user no matter which exit code was returned from script.

justin-rush commented 4 years ago

Support Entitlement Number: SEN-15105760

We are not able to upgrade our version of BitBucket due to

triggers.add(StandardRepositoryHookTrigger.TAG_DELETE); triggers.add(StandardRepositoryHookTrigger.TAG_CREATE); triggers.add(StandardRepositoryHookTrigger.BRANCH_DELETE); triggers.add(StandardRepositoryHookTrigger.BRANCH_CREATE);

Our internal build processes and user workflow will not work with these triggers calling our pre-receive script. Can you make them configurable as commented on July 10th?

seletskiy commented 4 years ago

@justin-rush: Hello.

We're on it. To implement it best usability-wise it will be very helpful for us if you could answer on the following questions:

  1. Do you have External Hooks configured on project-level or repository-level?
  2. How many projects/repositories you have External Hooks configured for?
justin-rush commented 4 years ago

Thank you for your assistance.

  1. We have External Hooks configured solely at the repository level.
  2. We have External Hooks configured for approximately 200 repositories.
seletskiy commented 4 years ago

@justin-rush: Thanks!

We're going to implement global plugin configuration page where tag/branch triggers can be disabled. Will post update here as soon as new version will be available via Atlassian Marketplace.

In meantime we can issue a workaround release with triggers in question disabled, so let me know if it's critical and you need it ASAP.

justin-rush commented 4 years ago

Excellent, we can wait for it to propagate through the Atlassian Marketplace. Just keep me posted when it is available. Thanks again.

kovetskiy commented 4 years ago

@justin-rush Hi! Just letting you know that we've finished the development stage of the settings page and have moved the task to our QA. We're planning to release it this week.

Here is demo gif: external-hooks settings

kovetskiy commented 4 years ago

@justin-rush we've released the feature, please check v9.0.0, you can install it via official marketplace or via 'Manage Apps' page in the admin panel.

https://marketplace.atlassian.com/apps/1211631/external-hooks-by-reconquest/version-history#b6452

Docs: https://external-hooks.reconquest.io/docs/triggers/

Please close the issue if the issue is resolved for you.

kovetskiy commented 4 years ago

@justin-rush Hi! Have you had a chance to check the new feature? Is the issue resolved for you?

cc @ericfru @aronfe

justin-rush commented 4 years ago

Sorry for the delay, my team tested your new feature extensively in our sandbox environment and your change meets our needs. Thank you for your timely feature work. I would close your issue if I could but it appears that I hijacked aronfe's initial issue.

kovetskiy commented 4 years ago

Thank you for letting us know! Feel free to re-open the issue in any case.