Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e54d410

Browse filesBrowse files
committed
Merge branch 'main' into deleted-user-scenarios
2 parents 2335168 + 7df326e commit e54d410
Copy full SHA for e54d410

File tree

Expand file treeCollapse file tree

55 files changed

+5827
-435
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

55 files changed

+5827
-435
lines changed

‎pom.xml

Copy file name to clipboardExpand all lines: pom.xml
+153-43Lines changed: 153 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>org.kohsuke</groupId>
44
<artifactId>github-api</artifactId>
5-
<version>1.136-SNAPSHOT</version>
5+
<version>1.301-SNAPSHOT</version>
66
<name>GitHub API for Java</name>
77
<url>https://github-api.kohsuke.org/</url>
88
<description>GitHub API for Java</description>
@@ -33,8 +33,8 @@
3333

3434
<properties>
3535
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
36-
<spotbugs-maven-plugin.version>4.4.2.2</spotbugs-maven-plugin.version>
37-
<spotbugs.version>4.4.2</spotbugs.version>
36+
<spotbugs-maven-plugin.version>4.5.0.0</spotbugs-maven-plugin.version>
37+
<spotbugs.version>4.5.0</spotbugs.version>
3838
<spotbugs-maven-plugin.failOnError>true</spotbugs-maven-plugin.failOnError>
3939
<hamcrest.version>2.2</hamcrest.version>
4040
<okhttp3.version>4.9.2</okhttp3.version>
@@ -103,32 +103,40 @@
103103
<groupId>org.jacoco</groupId>
104104
<artifactId>jacoco-maven-plugin</artifactId>
105105
<version>0.8.7</version>
106+
<configuration>
107+
<!-- no need to get data about external code. It dramatically reduces performance of JaCoCo for nothing -->
108+
<excludes>
109+
<exclude>/org/kohsuke/github/extras/HttpClient*</exclude>
110+
<exclude>/org/kohsuke/github/example/*</exclude>
111+
<exclude>/org/kohsuke/github/extras/OkHttpConnector*</exclude>
112+
<exclude>/org/kohsuke/github/extras/OkHttp3Connector*</exclude>
113+
<exclude>/org/kohsuke/github/extras/okhttp3/ObsoleteUrlFactory*</exclude>
114+
</excludes>
115+
</configuration>
106116
<executions>
107117
<execution>
108118
<goals>
109-
<goal>prepare-agent</goal>
119+
<goal>prepare-agent-integration</goal>
110120
</goals>
111121
<configuration>
112122
<propertyName>jacoco.surefire.argLine</propertyName>
113-
<!-- no need to get data about external code. It dramatically reduces performance of JaCoCo for nothing -->
114-
<include>org.kohsuke.*</include>
115123
</configuration>
116124
</execution>
117125
<!-- attached to Maven test phase -->
118126
<execution>
119127
<id>report</id>
120-
<phase>test</phase>
121128
<goals>
122-
<goal>report</goal>
129+
<goal>report-integration</goal>
123130
</goals>
124131
</execution>
125132
<execution>
126133
<id>check</id>
127-
<phase>test</phase>
134+
<phase>verify</phase>
128135
<goals>
129136
<goal>check</goal>
130137
</goals>
131138
<configuration>
139+
<dataFile>${project.build.directory}/jacoco-it.exec</dataFile>
132140
<rules>
133141
<rule>
134142
<element>BUNDLE</element>
@@ -153,14 +161,17 @@
153161
</limit>
154162
</limits>
155163
<excludes>
164+
<!-- Java 11 multi-release overlay problems -->
165+
<exclude>org.kohsuke.github.extras.HttpClientGitHubConnector.**</exclude>
166+
<exclude>org.kohsuke.github.extras.HttpClientGitHubConnector</exclude>
167+
156168
<!-- Code implemented externally -->
157169
<exclude>org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory.**</exclude>
158170
<exclude>org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory</exclude>
159171

160172
<!-- Sample only -->
161173
<exclude>org.kohsuke.github.example.*</exclude>
162174

163-
164175
<!-- Deprecated -->
165176
<exclude>org.kohsuke.github.extras.OkHttpConnector</exclude>
166177
<exclude>org.kohsuke.github.extras.OkHttp3Connector</exclude>
@@ -220,6 +231,27 @@
220231
<autoReleaseAfterClose>true</autoReleaseAfterClose>
221232
</configuration>
222233
</plugin>
234+
<plugin>
235+
<groupId>org.codehaus.mojo</groupId>
236+
<artifactId>animal-sniffer-maven-plugin</artifactId>
237+
<version>1.20</version>
238+
<configuration>
239+
<signature>
240+
<groupId>org.codehaus.mojo.signature</groupId>
241+
<artifactId>java18</artifactId>
242+
<version>1.0</version>
243+
</signature>
244+
</configuration>
245+
<executions>
246+
<execution>
247+
<id>ensure-java-1.8-class-library</id>
248+
<phase>test</phase>
249+
<goals>
250+
<goal>check</goal>
251+
</goals>
252+
</execution>
253+
</executions>
254+
</plugin>
223255
</plugins>
224256
</pluginManagement>
225257
<plugins>
@@ -285,23 +317,6 @@
285317
<plugin>
286318
<groupId>org.codehaus.mojo</groupId>
287319
<artifactId>animal-sniffer-maven-plugin</artifactId>
288-
<version>1.20</version>
289-
<configuration>
290-
<signature>
291-
<groupId>org.codehaus.mojo.signature</groupId>
292-
<artifactId>java18</artifactId>
293-
<version>1.0</version>
294-
</signature>
295-
</configuration>
296-
<executions>
297-
<execution>
298-
<id>ensure-java-1.8-class-library</id>
299-
<phase>test</phase>
300-
<goals>
301-
<goal>check</goal>
302-
</goals>
303-
</execution>
304-
</executions>
305320
</plugin>
306321
<plugin>
307322
<groupId>com.infradna.tool</groupId>
@@ -331,6 +346,12 @@
331346
</executions>
332347
<configuration>
333348
<java>
349+
<includes>
350+
<include>src/main/java/**/*.java</include>
351+
<include>src/main/java11/**/*.java</include>
352+
<include>src/test/java/**/*.java</include>
353+
</includes>
354+
334355
<eclipse>
335356
<file>${basedir}/src/build/eclipse/formatter.xml</file>
336357
</eclipse>
@@ -520,7 +541,7 @@
520541
<dependency>
521542
<groupId>org.mockito</groupId>
522543
<artifactId>mockito-core</artifactId>
523-
<version>4.0.0</version>
544+
<version>4.1.0</version>
524545
<scope>test</scope>
525546
</dependency>
526547
<dependency>
@@ -576,33 +597,24 @@
576597
<executions>
577598
<execution>
578599
<id>okhttp-test</id>
579-
<phase>test</phase>
600+
<phase>integration-test</phase>
580601
<goals>
581602
<goal>test</goal>
582603
</goals>
583604
<configuration>
605+
<classesDirectory>${project.basedir}/target/github-api-${project.version}.jar</classesDirectory>
584606
<excludesFile>src/test/resources/slow-or-flaky-tests.txt</excludesFile>
585607
<argLine>@{jacoco.surefire.argLine} ${surefire.argLine} -Dtest.github.connector=okhttp</argLine>
586608
</configuration>
587609
</execution>
588-
<execution>
589-
<id>okhttpconnector-test</id>
590-
<phase>test</phase>
591-
<goals>
592-
<goal>test</goal>
593-
</goals>
594-
<configuration>
595-
<excludesFile>src/test/resources/slow-or-flaky-tests.txt</excludesFile>
596-
<argLine>@{jacoco.surefire.argLine} ${surefire.argLine} -Dtest.github.connector=okhttpconnector</argLine>
597-
</configuration>
598-
</execution>
599610
<execution>
600611
<id>slow-or-flaky-test</id>
601-
<phase>test</phase>
612+
<phase>integration-test</phase>
602613
<goals>
603614
<goal>test</goal>
604615
</goals>
605616
<configuration>
617+
<classesDirectory>${project.basedir}/target/github-api-${project.version}.jar</classesDirectory>
606618
<rerunFailingTestsCount>2</rerunFailingTestsCount>
607619
<!-- There are some tests that take longer or are a little
608620
flaky. Run them here. -->
@@ -672,7 +684,7 @@
672684
<rules>
673685
<requireFilesExist>
674686
<files>
675-
<file>${project.build.directory}/jacoco.exec</file>
687+
<file>${project.build.directory}/jacoco-it.exec</file>
676688
</files>
677689
</requireFilesExist>
678690
</rules>
@@ -738,6 +750,104 @@
738750
</plugins>
739751
</build>
740752
</profile>
753+
<profile>
754+
<id>multirelease</id>
755+
<activation>
756+
<jdk>[11,)</jdk>
757+
</activation>
758+
<build>
759+
<plugins>
760+
<plugin>
761+
<groupId>org.codehaus.mojo</groupId>
762+
<artifactId>animal-sniffer-maven-plugin</artifactId>
763+
<configuration>
764+
<ignores>
765+
java.net.http.*
766+
</ignores>
767+
</configuration>
768+
</plugin>
769+
<plugin>
770+
<artifactId>maven-compiler-plugin</artifactId>
771+
<version>3.8.1</version>
772+
<executions>
773+
<execution>
774+
<id>compile-java-11</id>
775+
<phase>compile</phase>
776+
<goals>
777+
<goal>compile</goal>
778+
</goals>
779+
<configuration>
780+
<release>11</release>
781+
<source>11</source>
782+
<target>11</target>
783+
<compileSourceRoots>
784+
<compileSourceRoot>${project.basedir}/src/main/java11</compileSourceRoot>
785+
</compileSourceRoots>
786+
<multiReleaseOutput>true</multiReleaseOutput>
787+
</configuration>
788+
</execution>
789+
</executions>
790+
</plugin>
791+
<plugin>
792+
<groupId>org.apache.maven.plugins</groupId>
793+
<artifactId>maven-jar-plugin</artifactId>
794+
<version>3.2.0</version>
795+
<configuration>
796+
<archive>
797+
<manifestEntries>
798+
<Multi-Release>true</Multi-Release>
799+
</manifestEntries>
800+
</archive>
801+
</configuration>
802+
</plugin>
803+
</plugins>
804+
</build>
805+
</profile>
806+
<profile>
807+
<id>multirelease-test</id>
808+
<activation>
809+
<jdk>[11,)</jdk>
810+
<property>
811+
<name>!test</name>
812+
</property>
813+
</activation>
814+
<build>
815+
<plugins>
816+
<plugin>
817+
<artifactId>maven-surefire-plugin</artifactId>
818+
<executions>
819+
<execution>
820+
<id>java11-test</id>
821+
<phase>integration-test</phase>
822+
<goals>
823+
<goal>test</goal>
824+
</goals>
825+
<configuration>
826+
<classesDirectory>${project.basedir}/target/github-api-${project.version}.jar</classesDirectory>
827+
<useSystemClassLoader>false</useSystemClassLoader>
828+
<excludesFile>src/test/resources/slow-or-flaky-tests.txt</excludesFile>
829+
<argLine>@{jacoco.surefire.argLine} ${surefire.argLine} -Dtest.github.connector=httpclient</argLine>
830+
</configuration>
831+
</execution>
832+
<execution>
833+
<id>java11-urlconnection-test</id>
834+
<phase>integration-test</phase>
835+
<goals>
836+
<goal>test</goal>
837+
</goals>
838+
<configuration>
839+
<classesDirectory>${project.basedir}/target/github-api-${project.version}.jar</classesDirectory>
840+
<useSystemClassLoader>false</useSystemClassLoader>
841+
<excludesFile>src/test/resources/slow-or-flaky-tests.txt</excludesFile>
842+
<argLine>@{jacoco.surefire.argLine} ${surefire.argLine} -Dtest.github.connector=urlconnection</argLine>
843+
</configuration>
844+
</execution>
845+
</executions>
846+
</plugin>
847+
</plugins>
848+
</build>
849+
</profile>
850+
741851
</profiles>
742852
<reporting>
743853
<plugins>
@@ -748,7 +858,7 @@
748858
<reportSet>
749859
<reports>
750860
<!-- select non-aggregate reports -->
751-
<report>report</report>
861+
<report>report-integration</report>
752862
</reports>
753863
</reportSet>
754864
</reportSets>

‎src/main/java/org/kohsuke/github/AbstractBuilder.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/AbstractBuilder.java
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
* @param <S>
3838
* Intermediate return type for this builder returned by calls to {@link #with(String, Object)}. If {@link S}
3939
* the same as {@link R}, this builder will commit changes after each call to {@link #with(String, Object)}.
40+
*
41+
* @author Liam Newman
4042
*/
4143
abstract class AbstractBuilder<R, S> extends GitHubInteractiveObject {
4244

‎src/main/java/org/kohsuke/github/AbuseLimitHandler.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/AbuseLimitHandler.java
+10-6Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@
1212
* Pluggable strategy to determine what to do when the API abuse limit is hit.
1313
*
1414
* @author Kohsuke Kawaguchi
15-
* @see GitHubBuilder#withAbuseLimitHandler(AbuseLimitHandler) GitHubBuilder#withAbuseLimitHandler(AbuseLimitHandler)
15+
* @see GitHubBuilder#withAbuseLimitHandler(GitHubAbuseLimitHandler)
16+
* GitHubBuilder#withAbuseLimitHandler(GitHubAbuseLimitHandler)
1617
* @see <a href="https://developer.github.com/v3/#abuse-rate-limits">documentation</a>
1718
* @see RateLimitHandler
19+
* @deprecated Switch to {@link GitHubAbuseLimitHandler}.
1820
*/
19-
public abstract class AbuseLimitHandler {
21+
@Deprecated
22+
public abstract class AbuseLimitHandler extends GitHubAbuseLimitHandler {
2023

2124
/**
2225
* Called when the library encounters HTTP error indicating that the API abuse limit is reached.
@@ -37,7 +40,7 @@ public abstract class AbuseLimitHandler {
3740
*
3841
*/
3942
public void onError(@Nonnull GitHubConnectorResponse connectorResponse) throws IOException {
40-
GHIOException e = new HttpException("Abuse limit violation",
43+
GHIOException e = new HttpException("Abuse limit reached",
4144
connectorResponse.statusCode(),
4245
connectorResponse.header("Status"),
4346
connectorResponse.request().url().toString()).withResponseHeaderFields(connectorResponse.allHeaders());
@@ -66,12 +69,12 @@ public void onError(@Nonnull GitHubConnectorResponse connectorResponse) throws I
6669
*
6770
*/
6871
@Deprecated
69-
public void onError(IOException e, HttpURLConnection uc) throws IOException {
70-
}
72+
public abstract void onError(IOException e, HttpURLConnection uc) throws IOException;
7173

7274
/**
7375
* Wait until the API abuse "wait time" is passed.
7476
*/
77+
@Deprecated
7578
public static final AbuseLimitHandler WAIT = new AbuseLimitHandler() {
7679
@Override
7780
public void onError(IOException e, HttpURLConnection uc) throws IOException {
@@ -94,10 +97,11 @@ private long parseWaitTime(HttpURLConnection uc) {
9497
/**
9598
* Fail immediately.
9699
*/
100+
@Deprecated
97101
public static final AbuseLimitHandler FAIL = new AbuseLimitHandler() {
98102
@Override
99103
public void onError(IOException e, HttpURLConnection uc) throws IOException {
100-
throw (IOException) new IOException("Abuse limit reached").initCause(e);
104+
throw e;
101105
}
102106
};
103107
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.