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

Fix binary compatibility for PullRequestSCMRevision.getPull #817

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.infradna.tool</groupId>
<artifactId>bridge-method-annotation</artifactId>
<version>1.29</version>
</dependency>
Comment on lines +157 to +161
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is delivered by Jenkins core, so this dependency isn't needed. While in general it is a best practice to declare direct dependencies rather than consuming a transitive dependency without declaring it, with Jenkins plugins we usually recommend the opposite (not declaring a dependency and consuming it transitively via core) in order to avoid bloating JPIs with unused JARs in WEB-INF/lib and dealing with Enforcer issues.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn't in my classpath when I did the implementation.

</dependencies>

<repositories>
Expand Down Expand Up @@ -218,6 +223,18 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.infradna.tool</groupId>
<artifactId>bridge-method-injector</artifactId>
<version>1.29</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@

package com.cloudbees.jenkins.plugins.bitbucket;

import com.infradna.tool.bridge_method_injector.WithBridgeMethods;
import edu.umd.cs.findbugs.annotations.NonNull;
import jenkins.plugins.git.AbstractGitSCMSource;
import jenkins.scm.api.SCMRevision;
import jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy;
import jenkins.scm.api.mixin.ChangeRequestSCMRevision;

Expand Down Expand Up @@ -64,7 +66,7 @@ public PullRequestSCMRevision(@NonNull PullRequestSCMHead head, @NonNull Abstrac
*
* @return the pull revision.
*/
@NonNull
@NonNull @WithBridgeMethods(SCMRevision.class)
public AbstractGitSCMSource.SCMRevisionImpl getPull() {
return pull;
}
Expand Down
Loading