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 9e3de43

Browse filesBrowse files
committed
Merge remote-tracking branch 'upstream/master' into feat/credential-provider-refresh
2 parents 610b029 + dc615e4 commit 9e3de43
Copy full SHA for 9e3de43

File tree

Expand file treeCollapse file tree

312 files changed

+14029
-2492
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

312 files changed

+14029
-2492
lines changed

‎CONTRIBUTING.md

Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+28-8Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ Example:
1414

1515
This the default behavior.
1616

17+
Example for a single test case:
18+
19+
`mvn install -Dtest=WireMockStatusReporterTest#user_whenProxying_AuthCorrectlyConfigured`
20+
1721

1822
### Setting up credential
1923

@@ -27,21 +31,37 @@ This the default behavior.
2731

2832
`WireMockStatusReporterTest: GitHub proxying and user auth correctly configured for user login: <your login>`
2933

30-
Whenever you run tests with `-Dtest.github.useProxy`, they will try to get data from local files but will fallback to proxying to github if not found.
31-
34+
Whenever you run tests with `-Dtest.github.useProxy`, they will try to get data from local files but will fallback to proxying to GitHub if not found.
3235

3336
### Writing a new test
3437

3538
Once you have credentials setup, you add new test classes and test methods as you would normally.
36-
Keep `useProxy` enabled and iterate on your tests as needed. Remember, while proxying your tests are interacting with GitHub - you will need to clean up your state between runs.
3739

38-
When you are ready to create a snapshot of your test data,
39-
run your test with `test.github.takeSnapshot` ("-Dtest.github.takeSnapshot" as a Java VM option). For example:
40+
#### Running tests using GitHub test proxy
41+
42+
Keep `useProxy` enabled and iterate on your tests as needed. With `useProxy` enabled your tests will interact with
43+
GitHub - you will need to clean up your server-state between runs. This can be done manually to start with.
44+
Once your test code is somewhat stable, use `getGitHubBeforeAfter()` to get a `GitHub` instance for test setup and cleanup.
45+
Interactions with that `GitHub` instance will not be recorded as part of the test, keeping the test data files to a minimum.
46+
47+
#### Running tests against your personal GitHub user account
48+
49+
By default, test helper methods such as `getTempRepository()` target the `hub4j-test-org` GitHub organization.
50+
Please request access to this org to record your tests before submitting a PR. This helps keep the project stable and nimble.
51+
Until you have access (or if you don't want access), you can set the following additional system property to target
52+
your personal github account.
53+
54+
`mvn install -Dtest.github.org=false -Dtest=YourTestClassName`
55+
56+
#### Taking a snapshot
57+
58+
When you are ready to create a snapshot of your test data, run your test with `test.github.takeSnapshot` ("-Dtest.github.takeSnapshot" as
59+
a Java VM option). For example:
4060

41-
`mvn install -Dtest.github.takeSnapshot -Dtest=YourTestClassName`
61+
`mvn install -Dtest.github.takeSnapshot -Dtest.github.org=false -Dtest=YourTestClassName`
4262

43-
The above command would create snapshot WireMock data files under the path `src/test/resources/org/kohsuhke/github/YourTestClassName/wiremock`.
44-
Each method would get a separate director that would hold the data files for that test method.
63+
The above command will create snapshot WireMock data files under the path `src/test/resources/org/kohsuhke/github/YourTestClassName/wiremock`.
64+
Each method will get a separate directory that will hold the data files for that test method.
4565

4666
Add all files including the generated data to your commit and submit a PR.
4767

‎pom.xml

Copy file name to clipboardExpand all lines: pom.xml
+62-38Lines changed: 62 additions & 38 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.117-SNAPSHOT</version>
5+
<version>1.118-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,14 +33,13 @@
3333

3434
<properties>
3535
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
36-
<spotbugs-maven-plugin.version>4.0.4</spotbugs-maven-plugin.version>
37-
<spotbugs.version>4.1.2</spotbugs.version>
36+
<spotbugs-maven-plugin.version>4.1.4</spotbugs-maven-plugin.version>
37+
<spotbugs.version>4.1.3</spotbugs.version>
3838
<spotbugs-maven-plugin.failOnError>true</spotbugs-maven-plugin.failOnError>
3939
<hamcrest.version>2.2</hamcrest.version>
4040
<okhttp3.version>4.4.1</okhttp3.version>
4141
<okio.version>2.5.0</okio.version>
42-
<formatter-maven-plugin.goal>format</formatter-maven-plugin.goal>
43-
<impsort-maven-plugin.goal>sort</impsort-maven-plugin.goal>
42+
<spotless-maven-plugin.goal>apply</spotless-maven-plugin.goal>
4443
<!-- Using this as the minimum bar for code coverage. Adding methods without covering them will fail this. -->
4544
<jacoco.coverage.target.bundle.method>0.60</jacoco.coverage.target.bundle.method>
4645
<jacoco.coverage.target.class.method>0.25</jacoco.coverage.target.class.method>
@@ -101,7 +100,7 @@
101100
<plugin>
102101
<groupId>org.jacoco</groupId>
103102
<artifactId>jacoco-maven-plugin</artifactId>
104-
<version>0.8.5</version>
103+
<version>0.8.6</version>
105104
<executions>
106105
<execution>
107106
<goals>
@@ -263,7 +262,7 @@
263262
<plugin>
264263
<groupId>org.apache.maven.plugins</groupId>
265264
<artifactId>maven-project-info-reports-plugin</artifactId>
266-
<version>3.1.0</version>
265+
<version>3.1.1</version>
267266
<dependencies>
268267
<dependency>
269268
<groupId>org.apache.bcel</groupId>
@@ -345,37 +344,34 @@
345344
</executions>
346345
</plugin>
347346
<plugin>
348-
<groupId>net.revelc.code.formatter</groupId>
349-
<artifactId>formatter-maven-plugin</artifactId>
350-
<version>2.12.1</version>
347+
<groupId>com.diffplug.spotless</groupId>
348+
<artifactId>spotless-maven-plugin</artifactId>
349+
<version>2.6.1</version>
351350
<executions>
352351
<execution>
352+
<id>spotless-check</id>
353+
<phase>process-sources</phase>
353354
<goals>
354-
<goal>${formatter-maven-plugin.goal}</goal>
355+
<goal>${spotless-maven-plugin.goal}</goal>
355356
</goals>
356-
<configuration>
357-
<configFile>src/main/resources/eclipse/formatter.xml</configFile>
358-
<cachedir>${project.build.directory}/.cache</cachedir>
359-
</configuration>
360357
</execution>
361358
</executions>
362-
</plugin>
363-
<plugin>
364-
<groupId>net.revelc.code</groupId>
365-
<artifactId>impsort-maven-plugin</artifactId>
366-
<version>1.4.1</version>
367359
<configuration>
368-
<groups>*,java.,javax.</groups>
369-
<removeUnused>true</removeUnused>
370-
<staticAfter>true</staticAfter>
360+
<java>
361+
<eclipse>
362+
<file>${basedir}/src/build/eclipse/formatter.xml</file>
363+
</eclipse>
364+
365+
<importOrder>
366+
<file>${basedir}/src/build/eclipse/eclipse.importorder</file>
367+
</importOrder>
368+
<removeUnusedImports />
369+
370+
<trimTrailingWhitespace />
371+
<endWithNewline />
372+
373+
</java>
371374
</configuration>
372-
<executions>
373-
<execution>
374-
<goals>
375-
<goal>${impsort-maven-plugin.goal}</goal>
376-
</goals>
377-
</execution>
378-
</executions>
379375
</plugin>
380376
<plugin>
381377
<groupId>com.github.spotbugs</groupId>
@@ -412,6 +408,12 @@
412408
<artifactId>commons-lang3</artifactId>
413409
<version>3.9</version>
414410
</dependency>
411+
<dependency>
412+
<groupId>com.tngtech.archunit</groupId>
413+
<artifactId>archunit</artifactId>
414+
<version>0.15.0</version>
415+
<scope>test</scope>
416+
</dependency>
415417
<dependency>
416418
<groupId>org.hamcrest</groupId>
417419
<artifactId>hamcrest</artifactId>
@@ -434,7 +436,7 @@
434436
<dependency>
435437
<groupId>junit</groupId>
436438
<artifactId>junit</artifactId>
437-
<version>4.13</version>
439+
<version>4.13.1</version>
438440
<scope>test</scope>
439441
</dependency>
440442
<dependency>
@@ -483,7 +485,25 @@
483485
<dependency>
484486
<groupId>org.eclipse.jgit</groupId>
485487
<artifactId>org.eclipse.jgit</artifactId>
486-
<version>5.7.0.202003110725-r</version>
488+
<version>5.10.0.202012080955-r</version>
489+
<scope>test</scope>
490+
</dependency>
491+
<dependency>
492+
<groupId>io.jsonwebtoken</groupId>
493+
<artifactId>jjwt-api</artifactId>
494+
<version>0.11.2</version>
495+
<scope>test</scope>
496+
</dependency>
497+
<dependency>
498+
<groupId>io.jsonwebtoken</groupId>
499+
<artifactId>jjwt-impl</artifactId>
500+
<version>0.11.2</version>
501+
<scope>test</scope>
502+
</dependency>
503+
<dependency>
504+
<groupId>io.jsonwebtoken</groupId>
505+
<artifactId>jjwt-jackson</artifactId>
506+
<version>0.11.2</version>
487507
<scope>test</scope>
488508
</dependency>
489509
<dependency>
@@ -521,7 +541,7 @@
521541
<dependency>
522542
<groupId>org.mockito</groupId>
523543
<artifactId>mockito-core</artifactId>
524-
<version>3.5.7</version>
544+
<version>3.6.28</version>
525545
<scope>test</scope>
526546
</dependency>
527547
<dependency>
@@ -533,7 +553,7 @@
533553
<dependency>
534554
<groupId>com.github.tomakehurst</groupId>
535555
<artifactId>wiremock-jre8-standalone</artifactId>
536-
<version>2.27.1</version>
556+
<version>2.27.2</version>
537557
<scope>test</scope>
538558
</dependency>
539559
<dependency>
@@ -562,6 +582,12 @@
562582
<scope>provided</scope>
563583
</dependency>
564584
<!-- end JWT Dependencies -->
585+
<dependency>
586+
<groupId>org.slf4j</groupId>
587+
<artifactId>slf4j-simple</artifactId>
588+
<version>1.7.30</version>
589+
<scope>test</scope>
590+
</dependency>
565591
</dependencies>
566592
<repositories>
567593
<repository>
@@ -587,8 +613,7 @@
587613
</os>
588614
</activation>
589615
<properties>
590-
<formatter-maven-plugin.goal>validate</formatter-maven-plugin.goal>
591-
<impsort-maven-plugin.goal>check</impsort-maven-plugin.goal>
616+
<spotless-maven-plugin.goal>check</spotless-maven-plugin.goal>
592617
</properties>
593618
</profile>
594619
<profile>
@@ -613,8 +638,7 @@
613638
<profile>
614639
<id>release</id>
615640
<properties>
616-
<formatter-maven-plugin.goal>validate</formatter-maven-plugin.goal>
617-
<impsort-maven-plugin.goal>check</impsort-maven-plugin.goal>
641+
<spotless-maven-plugin.goal>check</spotless-maven-plugin.goal>
618642
</properties>
619643
<build>
620644
<plugins>

‎src/build/eclipse/eclipse.importorder

Copy file name to clipboard
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Organize Import Order
2+
# Import this file in Window -> Preferences -> Java -> Code Style -> Organize Imports -> Import...
3+
0=
4+
1=java
5+
2=javax
6+
3=\#

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/AbstractBuilder.java
+7-6Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
* <p>
1313
* Batching looks like this:
1414
* </p>
15-
*
15+
*
1616
* <pre>
1717
* update().someName(value).otherName(value).done()
1818
* </pre>
1919
* <p>
2020
* Single changes look like this:
2121
* </p>
22-
*
22+
*
2323
* <pre>
2424
* set().someName(value);
2525
* set().otherName(value);
@@ -38,7 +38,7 @@
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)}.
4040
*/
41-
abstract class AbstractBuilder<R, S> {
41+
abstract class AbstractBuilder<R, S> extends GitHubInteractiveObject {
4242

4343
@Nonnull
4444
private final Class<R> returnType;
@@ -75,6 +75,7 @@ protected AbstractBuilder(@Nonnull Class<R> finalReturnType,
7575
@Nonnull Class<S> intermediateReturnType,
7676
@Nonnull GitHub root,
7777
@CheckForNull R baseInstance) {
78+
super(root);
7879
this.requester = root.createRequest();
7980
this.returnType = finalReturnType;
8081
this.commitChangesImmediately = returnType.equals(intermediateReturnType);
@@ -97,7 +98,7 @@ protected AbstractBuilder(@Nonnull Class<R> finalReturnType,
9798
* if there is an I/O Exception
9899
*/
99100
@Nonnull
100-
@Preview
101+
@BetaApi
101102
@Deprecated
102103
public R done() throws IOException {
103104
R result;
@@ -127,7 +128,7 @@ public R done() throws IOException {
127128
* if an I/O error occurs
128129
*/
129130
@Nonnull
130-
@Preview
131+
@BetaApi
131132
@Deprecated
132133
protected S with(@Nonnull String name, Object value) throws IOException {
133134
requester.with(name, value);
@@ -148,7 +149,7 @@ protected S with(@Nonnull String name, Object value) throws IOException {
148149
* if an I/O error occurs
149150
*/
150151
@Nonnull
151-
@Preview
152+
@BetaApi
152153
@Deprecated
153154
protected S continueOrDone() throws IOException {
154155
// This little bit of roughness in this base class means all inheriting builders get to create Updater and
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package org.kohsuke.github;
2+
3+
import java.lang.annotation.Documented;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
7+
/**
8+
* Indicates that the method/class/etc marked is a beta implementation of an sdk feature.
9+
* <p>
10+
* These APIs are subject to change and not a part of the backward compatibility commitment. Always used in conjunction
11+
* with 'deprecated' to raise awareness to clients.
12+
* </p>
13+
*
14+
*/
15+
@Retention(RetentionPolicy.RUNTIME)
16+
@Documented
17+
public @interface BetaApi {
18+
}

0 commit comments

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