Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/bb post webhooks (#694) #700

Merged
merged 4 commits into from
Apr 10, 2021
Merged

Conversation

ghost
Copy link

@ghost ghost commented Apr 1, 2021

Description

Implementation of BitBucket Server third-party webhook plugin Post Web Hooks resolves #651. Embedded wiki files have been updated to reflect the change. As part of the implementation, this fixes #650 to avoid additional scans by handling the MERGED event.

As part of the customer's deployment, they needed to have the ability to use multiple instances of BitBucket server to test the configuration and workflow before using it in their production instance. As such, this resolves #674 with changes that allow for multiple BitBucket servers. The implementation may need some work given when looking at the multi-SCM feature, it was written to accommodate GitHub/GitLab type configurations where there is a URL for the SCM and a URL for the API. Since BitBucket uses one URL for the SCM and an additional "api-path" configuration, the "optional-instances" clause is configured differently to make multi-SCM with BBS work.

UPDATE: Also resolves #699 out of necessity for deployment.

Testing

Multi-SCM testing was done with a BB Server as the primary instance, a BB Server, and BB Cloud as secondary instances. Issue #675 will remain open until testing is performed with BB Cloud as the primary SCM with one or more BB Servers as secondary.

Currently, it is deployed and functional at a customer site with their production BB Server as the primary and their sandbox BB Server as the secondary.

The Post Web Hook plugin was also tested locally using BB Server and is in the customer's environment. Locally I validated that Post Web Hook events and BB Server native events were handled with no changes from the handling of the BB Server native events.

Post Web Hook global events are configured in the customer's sandbox and are being used in combination with config-as-code to provide override configurations on a per-repository basis. Per-repository Post Web Hook events were tested in my local setup. The customer has native BB Server events coming from their production instance, so CxFlow is handling both without issue.

Tested issue #699 with both Jira Data Center and Jira Cloud.

Author - Nathan Leach

Checklist

  • I have added documentation for new/changed functionality in this PR (if applicable).
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used

* WIP - probably does not compile

* fixed the merge so it compiles

* full path tested for existing BB server

* remove refactoring comments

* Postwebhook push events work

* added PR DTOs

* full path working

* fixed some logging outputs

* reorg handler namespace

* added project delete capability for postwebhook

* clarification of delete impl

* bug fix

* docs update for post webhook

* removing MERGED event handler

* comment cleanup

* Fix issues #674, 675

* scm multi-instance for BB

* postwebhook branch creation fix

* docs update

* handle empty commit

* Fix for issue #699
@ghost ghost requested a review from AvivCx April 1, 2021 15:47
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 1, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@ghost ghost requested a review from kmcdon83 April 1, 2021 19:36
@AvivCx AvivCx merged commit e1034fc into develop Apr 10, 2021
@AvivCx AvivCx deleted the pr-nathan-bitbucket-post-webhooks branch April 12, 2021 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants