jenkinsci / bitbucket-branch-source-plugin

Bitbucket Branch Source Plugin
https://plugins.jenkins.io/cloudbees-bitbucket-branch-source
MIT License
217 stars 349 forks source link

Fix binary compatibility for PullRequestSCMRevision.getPull #817

Closed rsandell closed 4 months ago

rsandell commented 4 months ago

The signature change in recent release caused NoSuchMethodError in plugins that are compiled against the old code.

I've tested it with the PCT and ATH of the affected plugin (cloudbees internal).

Your checklist for this pull request

rsandell commented 4 months ago

@andrey-fomin For some reason I can't request you as a reviewer, so here is a normal ping. :shrug:

andrey-fomin commented 4 months ago

For me this fix looks ok. Another approach can be just returning method with old signature and casting to required type where needed.

andrey-fomin commented 4 months ago

Created #818 with alternative fix. Please can you check it. For me both approaches are ok.

Just little comment maybe for future development. I would suggest to use approach similar to atlassian-bitbucket-server-integration plugin. In this plugin all the hashes are stored in the Head object. And Revision objects are just created from the Head objects. It allows to properly handle the case when revision is not available. For example when build is stared using following method https://github.com/jenkinsci/scm-api-plugin/blob/master/src/main/java/jenkins/scm/api/SCMSource.java#L934