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

removed outdated okhttp lib, and updated java native library changes #230

Merged
merged 1 commit into from
Sep 27, 2023
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
7 changes: 0 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,6 @@
</exclusions>
</dependency>

<!-- Included for backward compatibility, should be removed once downstream plugins are updated to use okhttp3 -->
Copy link
Member

Choose a reason for hiding this comment

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

Has this been verified?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, It has been verified and confirmed by @jtnord that "okhttp-urlconnnection 2.7.5" dependency need to be completely removed from the github-api-plugin and updated with the java native library changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The okhttp java native library changes made based on the the github-api release.

https://github.com/hub4j/github-api/releases/tag/github-api-1.300

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @amuniz . Yes The changes has been verified by running the usage-in-plugins under Rudi Controller. After running the job, I don't see any deprecated plugin usage. The verified link here:
https://gauntlet-3.cloudbees.com/rudi/job/usage-in-plugins/298/artifact/output/usage-by-plugin.html

Could you please confirm on it. Thank you
image

<dependency>
<groupId>com.squareup.okhttp</groupId>
<artifactId>okhttp-urlconnection</artifactId>
<version>2.7.5</version>
</dependency>

</dependencies>

<dependencyManagement>
Expand Down
13 changes: 4 additions & 9 deletions src/test/java/jenkins/plugins/github/api/SmokeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
import java.util.Set;
import java.util.TreeSet;

import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.OkUrlFactory;
import jenkins.plugins.github.api.mock.MockGitHub;
import jenkins.plugins.github.api.mock.MockOrganization;
import jenkins.plugins.github.api.mock.MockUser;
import okhttp3.OkHttpClient;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
Expand All @@ -18,8 +17,7 @@
import org.kohsuke.github.GHUser;
import org.kohsuke.github.GitHub;
import org.kohsuke.github.GitHubBuilder;
import org.kohsuke.github.HttpConnector;
import org.kohsuke.github.extras.OkHttpConnector;
import org.kohsuke.github.connector.GitHubConnector;
import org.kohsuke.github.extras.okhttp3.OkHttpGitHubConnector;

import edu.umd.cs.findbugs.annotations.NonNull;
Expand Down Expand Up @@ -52,13 +50,10 @@ public SmokeTest(IOFunction connectFunction) {

@Parameterized.Parameters(name = "connectFunction={index}")
public static IOFunction[] connectFunctions() {
HttpConnector okHttpConnector = new OkHttpConnector(new OkUrlFactory(new OkHttpClient()));
HttpConnector okHttp3Connector = new org.kohsuke.github.extras.okhttp3.OkHttpConnector(new okhttp3.OkHttpClient());
OkHttpGitHubConnector okHttpGitHubConnector = new OkHttpGitHubConnector(new okhttp3.OkHttpClient());
OkHttpClient okHttpClient = new OkHttpClient();
GitHubConnector okHttpGitHubConnector = new OkHttpGitHubConnector(okHttpClient);
ArrayList<IOFunction> list = new ArrayList<>();
list.add ((mock) -> GitHub.connectToEnterpriseAnonymously(mock.open()));
list.add ((mock) -> new GitHubBuilder().withConnector(okHttpConnector).withEndpoint(mock.open()).build());
list.add ((mock) -> new GitHubBuilder().withConnector(okHttp3Connector).withEndpoint(mock.open()).build());
list.add ((mock) -> new GitHubBuilder().withConnector(okHttpGitHubConnector).withEndpoint(mock.open()).build());

return list.toArray(new IOFunction[] {});
Expand Down