Skip to content

[JENKINS-74913] Allow extension point in bitbucket source plugin to provide a implementation for web-hooks management #1061

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nfalco79
Copy link
Member

@nfalco79 nfalco79 commented Jun 14, 2025

Add extension point interface to register hook processor provided by other plugins
Remove management of hook events that does ship any king of changes in the source code like reviewer changed or PR approved, they was used only to trigger builds if that kind of event was enabled in bitbucket manually.
Reindex on empty changes has been turn-off by default, this to avoid scan all repositories if not required.

WIP

@nfalco79 nfalco79 force-pushed the feature/JENKINS-74913 branch 2 times, most recently from 4981e8f to a90ddbd Compare June 22, 2025 13:30
@nfalco79 nfalco79 marked this pull request as ready for review June 22, 2025 13:30
@nfalco79 nfalco79 force-pushed the feature/JENKINS-74913 branch 3 times, most recently from 87759dc to b75fa8d Compare June 22, 2025 13:51
@nfalco79 nfalco79 force-pushed the feature/JENKINS-74913 branch 2 times, most recently from c4adf2d to 695fb85 Compare July 2, 2025 11:29
@nfalco79 nfalco79 force-pushed the feature/JENKINS-74913 branch 7 times, most recently from f34291b to ef896c0 Compare July 7, 2025 10:25
@nfalco79 nfalco79 force-pushed the feature/JENKINS-74913 branch from ef896c0 to 26b9cb9 Compare July 19, 2025 12:26
@@ -314,7 +237,7 @@
* @param value the URL to check.
* @return the validation results.
*/
public static FormValidation doCheckServerUrl(@QueryParameter String value) {
public static FormValidation doCheckServerURL(@QueryParameter String value) {

Check warning

Code scanning / Jenkins Security Scan

Stapler: Missing POST/RequirePOST annotation Warning

Potential CSRF vulnerability: If DescriptorImpl#doCheckServerURL connects to user-specified URLs, modifies state, or is expensive to run, it should be annotated with @POST or @RequirePOST
@@ -314,7 +237,7 @@
* @param value the URL to check.
* @return the validation results.
*/
public static FormValidation doCheckServerUrl(@QueryParameter String value) {
public static FormValidation doCheckServerURL(@QueryParameter String value) {

Check warning

Code scanning / Jenkins Security Scan

Stapler: Missing permission check Warning

Potential missing permission check in DescriptorImpl#doCheckServerURL
if (getBitbucketJenkinsRootUrl() != null) {
setBitbucketJenkinsRootUrl(getBitbucketJenkinsRootUrl());
@RequirePOST
public Collection<? extends Descriptor<?>> getWebhookDescriptors() {

Check warning

Code scanning / Jenkins Security Scan

Stapler: Missing permission check Warning

Potential missing permission check in DescriptorImpl#getWebhookDescriptors
@@ -323,6 +222,14 @@
return FormValidation.ok();
}

@RequirePOST
public Collection<? extends Descriptor<?>> getWebhookDescriptors() {

Check warning

Code scanning / Jenkins Security Scan

Stapler: Missing permission check Warning

Potential missing permission check in DescriptorImpl#getWebhookDescriptors
@nfalco79 nfalco79 force-pushed the feature/JENKINS-74913 branch 2 times, most recently from 7e9f003 to 7370183 Compare August 10, 2025 07:40
…rovide a implementation for web-hooks management

WIP refactor the webhook registration, I should create yet another interface that melt global configuration trait configurations, SCMOwner information (repository name and owner) and use a authenticated client to perform calls.
Fix CasC configuration
change UI
make readResolve compatible with old format
Add webhook extensible interface to provide custom implementation of wehbook from configuration to the APIs to register it on Bitbucket
Add extension point interface to register hook processor provided by other plugins
Remove manage of hook events that does ship any king of changes in the source code like reviewer changed or PR approved, they was used only to trigger builds if that kind of changes was enabled bitbucket side.
Reindex on empty changes has been turn-off by default, this to avoid scan all repositories if not required.
@nfalco79 nfalco79 force-pushed the feature/JENKINS-74913 branch from 7370183 to ae6585c Compare August 11, 2025 06:35
…rovide a implementation for web-hooks management

new interface to apply a webhook configuration to the Bitbucket
@nfalco79 nfalco79 force-pushed the feature/JENKINS-74913 branch from ae6585c to e20e512 Compare August 11, 2025 07:35
…rovide a implementation for web-hooks management

new interface to apply a webhook configuration to the Bitbucket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant