mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-20 15:50:29 +00:00
Compare commits
69 Commits
github-api
...
github-api
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2844542efa | ||
|
|
e3fcae9392 | ||
|
|
c6ccfa91f3 | ||
|
|
b6fcee1cb9 | ||
|
|
9071befb04 | ||
|
|
bdd5fe98f3 | ||
|
|
a3d3e83a49 | ||
|
|
08bde72028 | ||
|
|
108a136368 | ||
|
|
57d87ad6b1 | ||
|
|
0c22815ff7 | ||
|
|
0ca792ecfd | ||
|
|
987c34c69e | ||
|
|
c1c02bc8ab | ||
|
|
4ee369f27c | ||
|
|
c9012efdcb | ||
|
|
41524fc67d | ||
|
|
04ff61e981 | ||
|
|
532468dc67 | ||
|
|
9c9a2dae47 | ||
|
|
c8a868b57f | ||
|
|
4b3f81ee34 | ||
|
|
afa170ba7c | ||
|
|
46e3b2272e | ||
|
|
52472e90ec | ||
|
|
4ef0d00846 | ||
|
|
580f2537f2 | ||
|
|
3d9fd96026 | ||
|
|
f449b92721 | ||
|
|
3b0216b023 | ||
|
|
98cf839737 | ||
|
|
0bb0846505 | ||
|
|
70969400a3 | ||
|
|
147e8d5d12 | ||
|
|
cacc3e6edd | ||
|
|
a284eca147 | ||
|
|
0d3ba9d7f0 | ||
|
|
be8064d642 | ||
|
|
e30dba742d | ||
|
|
44b72ed647 | ||
|
|
666bd77dac | ||
|
|
0a6613e60d | ||
|
|
62e186c123 | ||
|
|
50dd8f5bcc | ||
|
|
d5fcac9c45 | ||
|
|
c2bed85190 | ||
|
|
183b463ef2 | ||
|
|
92fdac44a0 | ||
|
|
12829ecc73 | ||
|
|
51319c3b26 | ||
|
|
8fd827040b | ||
|
|
5ec46eae0d | ||
|
|
32c03301be | ||
|
|
df7f29b2ab | ||
|
|
e863113c36 | ||
|
|
8e2c1d7382 | ||
|
|
ab7b9cccba | ||
|
|
81bf61a161 | ||
|
|
b40f008647 | ||
|
|
734e41702b | ||
|
|
038dd20a91 | ||
|
|
1dd62b8550 | ||
|
|
715deebe05 | ||
|
|
b3fe3d8590 | ||
|
|
f74c3ed3ea | ||
|
|
2c9aebeeed | ||
|
|
7474f1e11f | ||
|
|
dba9c55b64 | ||
|
|
b432364397 |
12
.github/dependabot.yml
vendored
Normal file
12
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "maven"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
time: "02:00"
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
time: "02:00"
|
||||||
2
.github/release-drafter.yml
vendored
2
.github/release-drafter.yml
vendored
@@ -1,5 +1,5 @@
|
|||||||
name-template: 'v$NEXT_PATCH_VERSION 🌈'
|
name-template: 'v$NEXT_PATCH_VERSION 🌈'
|
||||||
tag-template: 'v$NEXT_PATCH_VERSION'
|
tag-template: 'github-api-$NEXT_MINOR_VERSION'
|
||||||
categories:
|
categories:
|
||||||
- title: '🚀 Features'
|
- title: '🚀 Features'
|
||||||
labels:
|
labels:
|
||||||
|
|||||||
6
.github/workflows/maven-build.yml
vendored
6
.github/workflows/maven-build.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
java-version: ${{ matrix.java }}
|
java-version: ${{ matrix.java }}
|
||||||
- name: Cached .m2
|
- name: Cached .m2
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||||
@@ -37,7 +37,7 @@ jobs:
|
|||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: ${{ matrix.java }}
|
java-version: ${{ matrix.java }}
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||||
@@ -58,7 +58,7 @@ jobs:
|
|||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: ${{ matrix.java }}
|
java-version: ${{ matrix.java }}
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||||
|
|||||||
54
pom.xml
54
pom.xml
@@ -2,7 +2,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.kohsuke</groupId>
|
<groupId>org.kohsuke</groupId>
|
||||||
<artifactId>github-api</artifactId>
|
<artifactId>github-api</artifactId>
|
||||||
<version>1.114</version>
|
<version>1.115</version>
|
||||||
<name>GitHub API for Java</name>
|
<name>GitHub API for Java</name>
|
||||||
<url>https://github-api.kohsuke.org/</url>
|
<url>https://github-api.kohsuke.org/</url>
|
||||||
<description>GitHub API for Java</description>
|
<description>GitHub API for Java</description>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
<connection>scm:git:git@github.com/hub4j/${project.artifactId}.git</connection>
|
<connection>scm:git:git@github.com/hub4j/${project.artifactId}.git</connection>
|
||||||
<developerConnection>scm:git:ssh://git@github.com/hub4j/${project.artifactId}.git</developerConnection>
|
<developerConnection>scm:git:ssh://git@github.com/hub4j/${project.artifactId}.git</developerConnection>
|
||||||
<url>https://github.com/hub4j/github-api/</url>
|
<url>https://github.com/hub4j/github-api/</url>
|
||||||
<tag>github-api-1.114</tag>
|
<tag>github-api-1.115</tag>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
@@ -33,8 +33,8 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<spotbugs-maven-plugin.version>4.0.0</spotbugs-maven-plugin.version>
|
<spotbugs-maven-plugin.version>4.0.4</spotbugs-maven-plugin.version>
|
||||||
<spotbugs.version>4.0.4</spotbugs.version>
|
<spotbugs.version>4.0.6</spotbugs.version>
|
||||||
<spotbugs-maven-plugin.failOnError>true</spotbugs-maven-plugin.failOnError>
|
<spotbugs-maven-plugin.failOnError>true</spotbugs-maven-plugin.failOnError>
|
||||||
<hamcrest.version>2.2</hamcrest.version>
|
<hamcrest.version>2.2</hamcrest.version>
|
||||||
<okhttp3.version>4.4.1</okhttp3.version>
|
<okhttp3.version>4.4.1</okhttp3.version>
|
||||||
@@ -79,6 +79,14 @@
|
|||||||
</testResources>
|
</testResources>
|
||||||
<pluginManagement>
|
<pluginManagement>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
<configuration>
|
||||||
|
<!-- SUREFIRE-1226 workaround -->
|
||||||
|
<trimStackTrace>false</trimStackTrace>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
@@ -233,7 +241,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-site-plugin</artifactId>
|
<artifactId>maven-site-plugin</artifactId>
|
||||||
<version>3.9.0</version>
|
<version>3.9.1</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
@@ -280,16 +288,31 @@
|
|||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>2.22.2</version>
|
<executions>
|
||||||
<configuration>
|
<execution>
|
||||||
<!-- SUREFIRE-1226 workaround -->
|
<id>default-test</id>
|
||||||
<trimStackTrace>false</trimStackTrace>
|
<configuration>
|
||||||
</configuration>
|
<excludesFile>src/test/resources/slow-or-flaky-tests.txt</excludesFile>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>slow-or-flaky-test</id>
|
||||||
|
<phase>test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>test</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<rerunFailingTestsCount>2</rerunFailingTestsCount>
|
||||||
|
<!-- There are some tests that take longer or are a little flaky. Run them here. -->
|
||||||
|
<includesFile>src/test/resources/slow-or-flaky-tests.txt</includesFile>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>animal-sniffer-maven-plugin</artifactId>
|
<artifactId>animal-sniffer-maven-plugin</artifactId>
|
||||||
<version>1.18</version>
|
<version>1.19</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<signature>
|
<signature>
|
||||||
<groupId>org.codehaus.mojo.signature</groupId>
|
<groupId>org.codehaus.mojo.signature</groupId>
|
||||||
@@ -322,7 +345,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>net.revelc.code.formatter</groupId>
|
<groupId>net.revelc.code.formatter</groupId>
|
||||||
<artifactId>formatter-maven-plugin</artifactId>
|
<artifactId>formatter-maven-plugin</artifactId>
|
||||||
<version>2.11.0</version>
|
<version>2.12.1</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<goals>
|
<goals>
|
||||||
@@ -330,6 +353,7 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<configFile>src/main/resources/eclipse/formatter.xml</configFile>
|
<configFile>src/main/resources/eclipse/formatter.xml</configFile>
|
||||||
|
<cachedir>${project.build.directory}/.cache</cachedir>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
@@ -445,7 +469,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kohsuke.stapler</groupId>
|
<groupId>org.kohsuke.stapler</groupId>
|
||||||
<artifactId>stapler</artifactId>
|
<artifactId>stapler</artifactId>
|
||||||
<version>1.259</version>
|
<version>1.260</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -495,7 +519,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mockito</groupId>
|
<groupId>org.mockito</groupId>
|
||||||
<artifactId>mockito-core</artifactId>
|
<artifactId>mockito-core</artifactId>
|
||||||
<version>3.3.3</version>
|
<version>3.4.0</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -507,7 +531,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.tomakehurst</groupId>
|
<groupId>com.github.tomakehurst</groupId>
|
||||||
<artifactId>wiremock-jre8-standalone</artifactId>
|
<artifactId>wiremock-jre8-standalone</artifactId>
|
||||||
<version>2.26.3</version>
|
<version>2.27.1</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -74,8 +74,14 @@ public class GHCheckRun extends GHObject {
|
|||||||
return conclusion;
|
return conclusion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Final conclusion of the check.
|
||||||
|
*
|
||||||
|
* From <a href="https://docs.github.com/en/rest/reference/checks#create-a-check-run--parameters">Check Run
|
||||||
|
* Parameters - <code>conclusion</code></a>.
|
||||||
|
*/
|
||||||
public static enum Conclusion {
|
public static enum Conclusion {
|
||||||
SUCCESS, FAILURE, NEUTRAL, CANCELLED, TIMED_OUT, ACTION_REQUIRED
|
SUCCESS, FAILURE, NEUTRAL, CANCELLED, TIMED_OUT, ACTION_REQUIRED, SKIPPED
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ public class GHContent implements Refreshable {
|
|||||||
private String sha;
|
private String sha;
|
||||||
private String name;
|
private String name;
|
||||||
private String path;
|
private String path;
|
||||||
|
private String target;
|
||||||
private String content;
|
private String content;
|
||||||
private String url; // this is the API url
|
private String url; // this is the API url
|
||||||
private String git_url; // this is the Blob url
|
private String git_url; // this is the Blob url
|
||||||
@@ -99,6 +100,15 @@ public class GHContent implements Refreshable {
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets target of a symlink. This will only be set if {@code "symlink".equals(getType())}
|
||||||
|
*
|
||||||
|
* @return the target
|
||||||
|
*/
|
||||||
|
public String getTarget() {
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the decoded content that is stored at this location.
|
* Retrieve the decoded content that is stored at this location.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ public enum GHEvent {
|
|||||||
TEAM,
|
TEAM,
|
||||||
TEAM_ADD,
|
TEAM_ADD,
|
||||||
WATCH,
|
WATCH,
|
||||||
|
WORKFLOW_DISPATCH,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Special event type that means "every possible event"
|
* Special event type that means "every possible event"
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.time.Duration;
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.time.format.DateTimeParseException;
|
import java.time.format.DateTimeParseException;
|
||||||
@@ -29,7 +30,7 @@ public class GHRateLimit {
|
|||||||
/**
|
/**
|
||||||
* Remaining calls that can be made.
|
* Remaining calls that can be made.
|
||||||
*
|
*
|
||||||
* @deprecated This value should never have been made public. Use {@link #getRemaining()}
|
* @deprecated This field should never have been made public. Use {@link #getRemaining()}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public int remaining;
|
public int remaining;
|
||||||
@@ -37,7 +38,7 @@ public class GHRateLimit {
|
|||||||
/**
|
/**
|
||||||
* Allotted API call per hour.
|
* Allotted API call per hour.
|
||||||
*
|
*
|
||||||
* @deprecated This value should never have been made public. Use {@link #getLimit()}
|
* @deprecated This field should never have been made public. Use {@link #getLimit()}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public int limit;
|
public int limit;
|
||||||
@@ -48,7 +49,7 @@ public class GHRateLimit {
|
|||||||
* date. To use this field in any meaningful way, it must be converted to a long using {@link Date#getTime()}
|
* date. To use this field in any meaningful way, it must be converted to a long using {@link Date#getTime()}
|
||||||
* multiplied by 1000.
|
* multiplied by 1000.
|
||||||
*
|
*
|
||||||
* @deprecated This value should never have been made public. Use {@link #getResetDate()}
|
* @deprecated This field should never have been made public. Use {@link #getResetDate()}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Date reset;
|
public Date reset;
|
||||||
@@ -65,17 +66,58 @@ public class GHRateLimit {
|
|||||||
@Nonnull
|
@Nonnull
|
||||||
private final Record integrationManifest;
|
private final Record integrationManifest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The default GHRateLimit provided to new {@link GitHubClient}s.
|
||||||
|
*
|
||||||
|
* Contains all expired records that will cause {@link GitHubClient#rateLimit(RateLimitTarget)} to refresh with new
|
||||||
|
* data when called.
|
||||||
|
*
|
||||||
|
* Private, but made internal for testing.
|
||||||
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static GHRateLimit Unknown() {
|
static final GHRateLimit DEFAULT = new GHRateLimit(UnknownLimitRecord.DEFAULT,
|
||||||
return new GHRateLimit(new UnknownLimitRecord(),
|
UnknownLimitRecord.DEFAULT,
|
||||||
new UnknownLimitRecord(),
|
UnknownLimitRecord.DEFAULT,
|
||||||
new UnknownLimitRecord(),
|
UnknownLimitRecord.DEFAULT);
|
||||||
new UnknownLimitRecord());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new {@link GHRateLimit} from a single record for the specified endpoint with place holders for other
|
||||||
|
* records.
|
||||||
|
*
|
||||||
|
* This is used to create {@link GHRateLimit} instances that can merged with other instances.
|
||||||
|
*
|
||||||
|
* @param record
|
||||||
|
* the rate limit record. Can be a regular {@link Record} constructed from header information or an
|
||||||
|
* {@link UnknownLimitRecord} placeholder.
|
||||||
|
* @param rateLimitTarget
|
||||||
|
* which rate limit record to fill
|
||||||
|
* @return a new {@link GHRateLimit} instance containing the supplied record
|
||||||
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static GHRateLimit fromHeaderRecord(Record header) {
|
static GHRateLimit fromRecord(@Nonnull Record record, @Nonnull RateLimitTarget rateLimitTarget) {
|
||||||
return new GHRateLimit(header, new UnknownLimitRecord(), new UnknownLimitRecord(), new UnknownLimitRecord());
|
if (rateLimitTarget == RateLimitTarget.CORE || rateLimitTarget == RateLimitTarget.NONE) {
|
||||||
|
return new GHRateLimit(record,
|
||||||
|
UnknownLimitRecord.DEFAULT,
|
||||||
|
UnknownLimitRecord.DEFAULT,
|
||||||
|
UnknownLimitRecord.DEFAULT);
|
||||||
|
} else if (rateLimitTarget == RateLimitTarget.SEARCH) {
|
||||||
|
return new GHRateLimit(UnknownLimitRecord.DEFAULT,
|
||||||
|
record,
|
||||||
|
UnknownLimitRecord.DEFAULT,
|
||||||
|
UnknownLimitRecord.DEFAULT);
|
||||||
|
} else if (rateLimitTarget == RateLimitTarget.GRAPHQL) {
|
||||||
|
return new GHRateLimit(UnknownLimitRecord.DEFAULT,
|
||||||
|
UnknownLimitRecord.DEFAULT,
|
||||||
|
record,
|
||||||
|
UnknownLimitRecord.DEFAULT);
|
||||||
|
} else if (rateLimitTarget == RateLimitTarget.INTEGRATION_MANIFEST) {
|
||||||
|
return new GHRateLimit(UnknownLimitRecord.DEFAULT,
|
||||||
|
UnknownLimitRecord.DEFAULT,
|
||||||
|
UnknownLimitRecord.DEFAULT,
|
||||||
|
record);
|
||||||
|
} else {
|
||||||
|
throw new IllegalArgumentException("Unknown rate limit target: " + rateLimitTarget.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
@@ -142,7 +184,7 @@ public class GHRateLimit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the rate limit reset date for this instance has passed.
|
* Whether the reset date for the Core API rate limit has passed.
|
||||||
*
|
*
|
||||||
* @return true if the rate limit reset date has passed. Otherwise false.
|
* @return true if the rate limit reset date has passed. Otherwise false.
|
||||||
* @since 1.100
|
* @since 1.100
|
||||||
@@ -152,7 +194,7 @@ public class GHRateLimit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The core object provides your rate limit status for all non-search-related resources in the REST API.
|
* The core object provides the rate limit status for all non-search-related resources in the REST API.
|
||||||
*
|
*
|
||||||
* @return a rate limit record
|
* @return a rate limit record
|
||||||
* @since 1.100
|
* @since 1.100
|
||||||
@@ -163,42 +205,43 @@ public class GHRateLimit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The search object provides your rate limit status for the Search API. TODO: integrate with header limit updating.
|
* The search record provides the rate limit status for the Search API.
|
||||||
* Issue #605.
|
|
||||||
*
|
*
|
||||||
* @return a rate limit record
|
* @return a rate limit record
|
||||||
|
* @since 1.115
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Record getSearch() {
|
public Record getSearch() {
|
||||||
return search;
|
return search;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The graphql object provides your rate limit status for the GraphQL API. TODO: integrate with header limit
|
* The graphql record provides the rate limit status for the GraphQL API.
|
||||||
* updating. Issue #605.
|
|
||||||
*
|
*
|
||||||
* @return a rate limit record
|
* @return a rate limit record
|
||||||
|
* @since 1.115
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Record getGraphQL() {
|
public Record getGraphQL() {
|
||||||
return graphql;
|
return graphql;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The integration_manifest object provides your rate limit status for the GitHub App Manifest code conversion
|
* The integration manifest record provides the rate limit status for the GitHub App Manifest code conversion
|
||||||
* endpoint. TODO: integrate with header limit updating. Issue #605.
|
* endpoint.
|
||||||
*
|
*
|
||||||
* @return a rate limit record
|
* @return a rate limit record
|
||||||
|
* @since 1.115
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Record getIntegrationManifest() {
|
public Record getIntegrationManifest() {
|
||||||
return integrationManifest;
|
return integrationManifest;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "GHRateLimit {" + "core " + getCore().toString() + "search " + getSearch().toString() + "graphql "
|
return "GHRateLimit {" + "core " + getCore().toString() + ", search " + getSearch().toString() + ", graphql "
|
||||||
+ getGraphQL().toString() + "integrationManifest " + getIntegrationManifest().toString() + '}';
|
+ getGraphQL().toString() + ", integrationManifest " + getIntegrationManifest().toString() + "}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -221,44 +264,111 @@ public class GHRateLimit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the appropriate {@link Record} for a particular url path.
|
* Merge a {@link GHRateLimit} with another one to create a new {@link GHRateLimit} keeping the latest
|
||||||
*
|
* {@link Record}s from each.
|
||||||
* @param urlPath
|
*
|
||||||
* the url path of the request
|
* @param newLimit
|
||||||
* @return the {@link Record} for a url path.
|
* {@link GHRateLimit} with potentially updated {@link Record}s.
|
||||||
|
* @return a merged {@link GHRateLimit} with the latest {@link Record}s from these two instances. If the merged
|
||||||
|
* instance is equal to the current instance, the current instance is returned.
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Record getRecordForUrlPath(@Nonnull String urlPath) {
|
GHRateLimit getMergedRateLimit(@Nonnull GHRateLimit newLimit) {
|
||||||
if (urlPath.equals("/rate_limit")) {
|
|
||||||
return new UnknownLimitRecord();
|
GHRateLimit merged = new GHRateLimit(getCore().currentOrUpdated(newLimit.getCore()),
|
||||||
} else if (urlPath.startsWith("/search")) {
|
getSearch().currentOrUpdated(newLimit.getSearch()),
|
||||||
return getSearch();
|
getGraphQL().currentOrUpdated(newLimit.getGraphQL()),
|
||||||
} else if (urlPath.startsWith("/graphql")) {
|
getIntegrationManifest().currentOrUpdated(newLimit.getIntegrationManifest()));
|
||||||
return getGraphQL();
|
|
||||||
} else if (urlPath.startsWith("/app-manifests")) {
|
if (merged.equals(this)) {
|
||||||
return getIntegrationManifest();
|
merged = this;
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
return merged;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the specified {@link Record}.
|
||||||
|
*
|
||||||
|
* {@link RateLimitTarget#NONE} will return {@link UnknownLimitRecord#DEFAULT} to prevent any clients from
|
||||||
|
* accidentally waiting on that record to reset before continuing.
|
||||||
|
*
|
||||||
|
* @param rateLimitTarget
|
||||||
|
* the target rate limit record
|
||||||
|
* @return the target {@link Record} from this instance.
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
Record getRecord(@Nonnull RateLimitTarget rateLimitTarget) {
|
||||||
|
if (rateLimitTarget == RateLimitTarget.CORE) {
|
||||||
return getCore();
|
return getCore();
|
||||||
|
} else if (rateLimitTarget == RateLimitTarget.SEARCH) {
|
||||||
|
return getSearch();
|
||||||
|
} else if (rateLimitTarget == RateLimitTarget.GRAPHQL) {
|
||||||
|
return getGraphQL();
|
||||||
|
} else if (rateLimitTarget == RateLimitTarget.INTEGRATION_MANIFEST) {
|
||||||
|
return getIntegrationManifest();
|
||||||
|
} else if (rateLimitTarget == RateLimitTarget.NONE) {
|
||||||
|
return UnknownLimitRecord.DEFAULT;
|
||||||
|
} else {
|
||||||
|
throw new IllegalArgumentException("Unknown rate limit target: " + rateLimitTarget.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A limit record used as a placeholder when the the actual limit is not known.
|
* A limit record used as a placeholder when the the actual limit is not known.
|
||||||
* <p>
|
|
||||||
* Has a large limit and long duration so that it will doesn't expire too often.
|
|
||||||
*
|
*
|
||||||
* @since 1.100
|
* @since 1.100
|
||||||
*/
|
*/
|
||||||
public static class UnknownLimitRecord extends Record {
|
public static class UnknownLimitRecord extends Record {
|
||||||
|
|
||||||
// One hour
|
private static final long defaultUnknownLimitResetSeconds = Duration.ofSeconds(30).getSeconds();
|
||||||
private static final long unknownLimitResetSeconds = 60L * 60L;
|
|
||||||
|
/**
|
||||||
|
* The number of seconds until a {@link UnknownLimitRecord} will expire.
|
||||||
|
*
|
||||||
|
* This is set to a somewhat short duration, rather than a long one. This avoids
|
||||||
|
* {@link {@link GitHubClient#rateLimit(RateLimitTarget)}} requesting rate limit updates continuously, but also
|
||||||
|
* avoids holding on to stale unknown records indefinitely.
|
||||||
|
*
|
||||||
|
* When merging {@link GHRateLimit} instances, {@link UnknownLimitRecord}s will be superseded by incoming
|
||||||
|
* regular {@link Record}s.
|
||||||
|
*
|
||||||
|
* @see GHRateLimit#getMergedRateLimit(GHRateLimit)
|
||||||
|
*/
|
||||||
|
static long unknownLimitResetSeconds = defaultUnknownLimitResetSeconds;
|
||||||
|
|
||||||
static final int unknownLimit = 1000000;
|
static final int unknownLimit = 1000000;
|
||||||
static final int unknownRemaining = 999999;
|
static final int unknownRemaining = 999999;
|
||||||
|
|
||||||
private UnknownLimitRecord() {
|
// The default UnknownLimitRecord is an expired record.
|
||||||
super(unknownLimit, unknownRemaining, System.currentTimeMillis() / 1000L + unknownLimitResetSeconds);
|
private static final UnknownLimitRecord DEFAULT = new UnknownLimitRecord(Long.MIN_VALUE);
|
||||||
|
|
||||||
|
// The starting current UnknownLimitRecord is an expired record.
|
||||||
|
private static UnknownLimitRecord current = DEFAULT;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new unknown record that resets at the specified time.
|
||||||
|
*
|
||||||
|
* @param resetEpochSeconds
|
||||||
|
* the epoch second time when this record will expire.
|
||||||
|
*/
|
||||||
|
private UnknownLimitRecord(long resetEpochSeconds) {
|
||||||
|
super(unknownLimit, unknownRemaining, resetEpochSeconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
static synchronized Record current() {
|
||||||
|
if (current.isExpired()) {
|
||||||
|
current = new UnknownLimitRecord(System.currentTimeMillis() / 1000L + unknownLimitResetSeconds);
|
||||||
|
}
|
||||||
|
return current;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset the current UnknownLimitRecord. For use during testing only.
|
||||||
|
*/
|
||||||
|
static synchronized void reset() {
|
||||||
|
current = DEFAULT;
|
||||||
|
unknownLimitResetSeconds = defaultUnknownLimitResetSeconds;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,14 +384,12 @@ public class GHRateLimit {
|
|||||||
private final int remaining;
|
private final int remaining;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allotted API call per hour.
|
* Allotted API call per time period.
|
||||||
*/
|
*/
|
||||||
private final int limit;
|
private final int limit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The time at which the current rate limit window resets in UTC epoch seconds.
|
* The time at which the current rate limit window resets in UTC epoch seconds.
|
||||||
*
|
|
||||||
* This is the raw value returned by the server.
|
|
||||||
*/
|
*/
|
||||||
private final long resetEpochSeconds;
|
private final long resetEpochSeconds;
|
||||||
|
|
||||||
@@ -291,9 +399,11 @@ public class GHRateLimit {
|
|||||||
private final long createdAtEpochSeconds = System.currentTimeMillis() / 1000;
|
private final long createdAtEpochSeconds = System.currentTimeMillis() / 1000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The time at which the rate limit will reset. This value is calculated based on
|
* The date at which the rate limit will reset, adjusted to local machine time if the local machine's clock not
|
||||||
* {@link #getResetEpochSeconds()} by calling {@link #calculateResetDate}. If the clock on the local machine not
|
* synchronized with to the same clock as the GitHub server.
|
||||||
* synchronized with the server clock, this time value will be adjusted to match the local machine's clock.
|
*
|
||||||
|
* @see #calculateResetDate(String)
|
||||||
|
* @see #getResetDate()
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
private final Date resetDate;
|
private final Date resetDate;
|
||||||
@@ -341,12 +451,58 @@ public class GHRateLimit {
|
|||||||
this.resetDate = calculateResetDate(updatedAt);
|
this.resetDate = calculateResetDate(updatedAt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if the current {@link Record} is outdated compared to another. Rate Limit dates are only accurate
|
||||||
|
* to the second, so we look at other information in the record as well.
|
||||||
|
*
|
||||||
|
* {@link Record}s with earlier {@link #getResetEpochSeconds()} are replaced by those with later.
|
||||||
|
* {@link Record}s with the same {@link #getResetEpochSeconds()} are replaced by those with less remaining
|
||||||
|
* count.
|
||||||
|
*
|
||||||
|
* {@link UnknownLimitRecord}s compare with each other like regular {@link Record}s.
|
||||||
|
*
|
||||||
|
* {@link Record}s are replaced by {@link UnknownLimitRecord}s only when the current {@link Record} is expired
|
||||||
|
* and the {@link UnknownLimitRecord} is not. Otherwise Regular {@link Record}s are not replaced by
|
||||||
|
* {@link UnknownLimitRecord}s.
|
||||||
|
*
|
||||||
|
* Expiration is only considered after other checks, meaning expired records may sometimes be replaced by other
|
||||||
|
* expired records.
|
||||||
|
*
|
||||||
|
* @param other
|
||||||
|
* the other {@link Record}
|
||||||
|
* @return the {@link Record} that is most current
|
||||||
|
*/
|
||||||
|
Record currentOrUpdated(@Nonnull Record other) {
|
||||||
|
// This set of checks avoids most calls to isExpired()
|
||||||
|
// Depends on UnknownLimitRecord.current() to prevent continuous updating of GHRateLimit rateLimit()
|
||||||
|
if (getResetEpochSeconds() > other.getResetEpochSeconds()
|
||||||
|
|| (getResetEpochSeconds() == other.getResetEpochSeconds()
|
||||||
|
&& getRemaining() <= other.getRemaining())) {
|
||||||
|
// If the current record has a later reset
|
||||||
|
// or the current record has the same reset and fewer or same requests remaining
|
||||||
|
// Then it is most recent
|
||||||
|
return this;
|
||||||
|
} else if (!(other instanceof UnknownLimitRecord)) {
|
||||||
|
// If the above is not the case that means other has a later reset
|
||||||
|
// or the same resent and fewer requests remaining.
|
||||||
|
// If the other record is not an unknown record, the the other is more recent
|
||||||
|
return other;
|
||||||
|
} else if (this.isExpired() && !other.isExpired()) {
|
||||||
|
// The other is an unknown record.
|
||||||
|
// If the current record has expired and the other hasn't, return the other.
|
||||||
|
return other;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If none of the above, the current record is most valid.
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recalculates the {@link #resetDate} relative to the local machine clock.
|
* Recalculates the {@link #resetDate} relative to the local machine clock.
|
||||||
* <p>
|
* <p>
|
||||||
* {@link RateLimitChecker}s and {@link RateLimitHandler}s use {@link #getResetDate()} to make decisions about
|
* {@link RateLimitChecker}s and {@link RateLimitHandler}s use {@link #getResetDate()} to make decisions about
|
||||||
* how long to wait for until for the rate limit to reset. That means that {@link #getResetDate()} needs to be
|
* how long to wait for until for the rate limit to reset. That means that {@link #getResetDate()} needs to be
|
||||||
* accurate to the local machine.
|
* calculated based on the local machine clock.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* When we say that the clock on two machines is "synchronized", we mean that the UTC time returned from
|
* When we say that the clock on two machines is "synchronized", we mean that the UTC time returned from
|
||||||
@@ -415,7 +571,7 @@ public class GHRateLimit {
|
|||||||
* {@link #getResetDate()} or implement a {@link RateLimitChecker} instead.
|
* {@link #getResetDate()} or implement a {@link RateLimitChecker} instead.
|
||||||
*
|
*
|
||||||
* @return a long representing the time in epoch seconds when the rate limit will reset
|
* @return a long representing the time in epoch seconds when the rate limit will reset
|
||||||
* @see #getResetDate() #getResetDate()
|
* @see #getResetDate()
|
||||||
*/
|
*/
|
||||||
public long getResetEpochSeconds() {
|
public long getResetEpochSeconds() {
|
||||||
return resetEpochSeconds;
|
return resetEpochSeconds;
|
||||||
@@ -424,6 +580,8 @@ public class GHRateLimit {
|
|||||||
/**
|
/**
|
||||||
* Whether the rate limit reset date indicated by this instance is expired
|
* Whether the rate limit reset date indicated by this instance is expired
|
||||||
*
|
*
|
||||||
|
* If attempting to wait for the rate limit to reset, consider implementing a {@link RateLimitChecker} instead.
|
||||||
|
*
|
||||||
* @return true if the rate limit reset date has passed. Otherwise false.
|
* @return true if the rate limit reset date has passed. Otherwise false.
|
||||||
*/
|
*/
|
||||||
public boolean isExpired() {
|
public boolean isExpired() {
|
||||||
@@ -431,8 +589,8 @@ public class GHRateLimit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the date at which the rate limit will reset, adjusted to local machine time if the local machine's
|
* The date at which the rate limit will reset, adjusted to local machine time if the local machine's clock not
|
||||||
* clock not synchronized with to the same clock as the GitHub server.
|
* synchronized with to the same clock as the GitHub server.
|
||||||
*
|
*
|
||||||
* If attempting to wait for the rate limit to reset, consider implementing a {@link RateLimitChecker} instead.
|
* If attempting to wait for the rate limit to reset, consider implementing a {@link RateLimitChecker} instead.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.kohsuke.github;
|
package org.kohsuke.github;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -90,6 +91,78 @@ public class GHRef {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrive a ref of the given type for the current GitHub repository.
|
||||||
|
*
|
||||||
|
* @param repository
|
||||||
|
* the repository to read from
|
||||||
|
* @param refName
|
||||||
|
* eg: heads/branch
|
||||||
|
* @return refs matching the request type
|
||||||
|
* @throws IOException
|
||||||
|
* on failure communicating with GitHub, potentially due to an invalid ref type being requested
|
||||||
|
*/
|
||||||
|
static GHRef read(GHRepository repository, String refName) throws IOException {
|
||||||
|
// Also accept e.g. "refs/heads/branch" for consistency with createRef().
|
||||||
|
if (refName.startsWith("refs/")) {
|
||||||
|
refName = refName.replaceFirst("refs/", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
// We would expect this to use `git/ref/%s` but some versions of GHE seem to not support it
|
||||||
|
// Instead use `git/refs/%s` and check the result actually matches the ref
|
||||||
|
GHRef result = null;
|
||||||
|
try {
|
||||||
|
result = repository.root.createRequest()
|
||||||
|
.withUrlPath(repository.getApiTailUrl(String.format("git/refs/%s", refName)))
|
||||||
|
.fetch(GHRef.class)
|
||||||
|
.wrap(repository.root);
|
||||||
|
} catch (IOException e) {
|
||||||
|
// If the parse exception is due to the above returning an array instead of a single ref
|
||||||
|
// that means the individual ref did not exist. Handled by result check below.
|
||||||
|
// Otherwise, rethrow.
|
||||||
|
if (!(e.getCause() instanceof JsonMappingException)) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verify that the ref returned is the one requested
|
||||||
|
// Used .endsWith(refName) instead of .equals("refs/" + refName) to workaround a GitBucket
|
||||||
|
// issue where the "ref" field omits the "refs/" prefix. "endsWith()" is functionally
|
||||||
|
// the same for this scenario - the server refs matching is prefix-based, so
|
||||||
|
// a ref that ends with the correct string will always be the correct one.
|
||||||
|
if (result == null || !result.getRef().endsWith(refName)) {
|
||||||
|
throw new GHFileNotFoundException(String.format("git/refs/%s", refName)
|
||||||
|
+ " {\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/git/refs/#get-a-reference\"}");
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves all refs of the given type for the current GitHub repository.
|
||||||
|
*
|
||||||
|
* @param repository
|
||||||
|
* the repository to read from
|
||||||
|
* @param refType
|
||||||
|
* the type of reg to search for e.g. <code>tags</code> or <code>commits</code>
|
||||||
|
* @return paged iterable of all refs of the specified type
|
||||||
|
* @throws IOException
|
||||||
|
* on failure communicating with GitHub, potentially due to an invalid ref type being requested
|
||||||
|
*/
|
||||||
|
static PagedIterable<GHRef> readMatching(GHRepository repository, String refType) throws IOException {
|
||||||
|
if (refType.startsWith("refs/")) {
|
||||||
|
refType = refType.replaceFirst("refs/", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
String url = repository.getApiTailUrl(String.format("git/refs/%s", refType));
|
||||||
|
// if no types, do not end with slash just to be safe.
|
||||||
|
if (refType.equals("")) {
|
||||||
|
url = url.substring(0, url.length() - 1);
|
||||||
|
}
|
||||||
|
return repository.root.createRequest()
|
||||||
|
.withUrlPath(url)
|
||||||
|
.toIterable(GHRef[].class, item -> item.wrap(repository.root));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type GHObject.
|
* The type GHObject.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ package org.kohsuke.github;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fasterxml.jackson.core.JsonParseException;
|
import com.fasterxml.jackson.core.JsonParseException;
|
||||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
|
||||||
import com.infradna.tool.bridge_method_injector.WithBridgeMethods;
|
import com.infradna.tool.bridge_method_injector.WithBridgeMethods;
|
||||||
import edu.umd.cs.findbugs.annotations.CheckForNull;
|
import edu.umd.cs.findbugs.annotations.CheckForNull;
|
||||||
import edu.umd.cs.findbugs.annotations.NonNull;
|
import edu.umd.cs.findbugs.annotations.NonNull;
|
||||||
@@ -1541,8 +1540,7 @@ public class GHRepository extends GHObject {
|
|||||||
* on failure communicating with GitHub, potentially due to an invalid ref type being requested
|
* on failure communicating with GitHub, potentially due to an invalid ref type being requested
|
||||||
*/
|
*/
|
||||||
public PagedIterable<GHRef> listRefs() throws IOException {
|
public PagedIterable<GHRef> listRefs() throws IOException {
|
||||||
final String url = String.format("/repos/%s/%s/git/refs", getOwnerName(), name);
|
return listRefs("");
|
||||||
return root.createRequest().withUrlPath(url).toIterable(GHRef[].class, item -> item.wrap(root));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1568,11 +1566,7 @@ public class GHRepository extends GHObject {
|
|||||||
* on failure communicating with GitHub, potentially due to an invalid ref type being requested
|
* on failure communicating with GitHub, potentially due to an invalid ref type being requested
|
||||||
*/
|
*/
|
||||||
public PagedIterable<GHRef> listRefs(String refType) throws IOException {
|
public PagedIterable<GHRef> listRefs(String refType) throws IOException {
|
||||||
if (refType.startsWith("refs/")) {
|
return GHRef.readMatching(this, refType);
|
||||||
refType = refType.replaceFirst("refs/", "");
|
|
||||||
}
|
|
||||||
final String url = String.format("/repos/%s/%s/git/refs/%s", getOwnerName(), name, refType);
|
|
||||||
return root.createRequest().withUrlPath(url).toIterable(GHRef[].class, item -> item.wrap(root));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1585,34 +1579,7 @@ public class GHRepository extends GHObject {
|
|||||||
* on failure communicating with GitHub, potentially due to an invalid ref type being requested
|
* on failure communicating with GitHub, potentially due to an invalid ref type being requested
|
||||||
*/
|
*/
|
||||||
public GHRef getRef(String refName) throws IOException {
|
public GHRef getRef(String refName) throws IOException {
|
||||||
// Also accept e.g. "refs/heads/branch" for consistency with createRef().
|
return GHRef.read(this, refName);
|
||||||
if (refName.startsWith("refs/")) {
|
|
||||||
refName = refName.replaceFirst("refs/", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
// We would expect this to use `git/ref/%s` but some versions of GHE seem to not support it
|
|
||||||
// Instead use `git/refs/%s` and check the result actually matches the ref
|
|
||||||
GHRef result = null;
|
|
||||||
try {
|
|
||||||
result = root.createRequest()
|
|
||||||
.withUrlPath(getApiTailUrl(String.format("git/refs/%s", refName)))
|
|
||||||
.fetch(GHRef.class)
|
|
||||||
.wrap(root);
|
|
||||||
} catch (IOException e) {
|
|
||||||
// If the parse exception is due to the above returning an array instead of a single ref
|
|
||||||
// that means the individual ref did not exist
|
|
||||||
if (!(e.getCause() instanceof JsonMappingException)) {
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Verify that the ref returned is the one requested
|
|
||||||
if (result == null || !result.getRef().equals("refs/" + refName)) {
|
|
||||||
throw new GHFileNotFoundException(String.format("git/refs/%s", refName)
|
|
||||||
+ " {\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/git/refs/#get-a-reference\"}");
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ public abstract class GHSearchBuilder<T> extends GHQueryBuilder<T> {
|
|||||||
super(root);
|
super(root);
|
||||||
this.receiverType = receiverType;
|
this.receiverType = receiverType;
|
||||||
req.withUrlPath(getApiUrl());
|
req.withUrlPath(getApiUrl());
|
||||||
|
req.rateLimit(RateLimitTarget.SEARCH);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -174,6 +174,19 @@ public class GHTeam extends GHObject implements Refreshable {
|
|||||||
return root.createRequest().withUrlPath(api("/members")).toIterable(GHUser[].class, item -> item.wrapUp(root));
|
return root.createRequest().withUrlPath(api("/members")).toIterable(GHUser[].class, item -> item.wrapUp(root));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the teams that are children of this team.
|
||||||
|
*
|
||||||
|
* @return the paged iterable
|
||||||
|
* @throws IOException
|
||||||
|
* the io exception
|
||||||
|
*/
|
||||||
|
public PagedIterable<GHTeam> listChildTeams() throws IOException {
|
||||||
|
return root.createRequest()
|
||||||
|
.withUrlPath(api("/teams"))
|
||||||
|
.toIterable(GHTeam[].class, item -> item.wrapUp(this.organization));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets members.
|
* Gets members.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public class GHTeamBuilder {
|
|||||||
* parentTeamId of team
|
* parentTeamId of team
|
||||||
* @return a builder to continue with building
|
* @return a builder to continue with building
|
||||||
*/
|
*/
|
||||||
public GHTeamBuilder parentTeamId(int parentTeamId) {
|
public GHTeamBuilder parentTeamId(long parentTeamId) {
|
||||||
this.builder.with("parent_team_id", parentTeamId);
|
this.builder.with("parent_team_id", parentTeamId);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -373,12 +373,20 @@ public class GitHub {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the current rate limit.
|
* Gets the current full rate limit information from the server.
|
||||||
|
*
|
||||||
|
* For some versions of GitHub Enterprise, the {@code /rate_limit} endpoint returns a {@code 404 Not Found}. In that
|
||||||
|
* case, the most recent {@link GHRateLimit} information will be returned, including rate limit information returned
|
||||||
|
* in the response header for this request in if was present.
|
||||||
|
*
|
||||||
|
* For most use cases it would be better to implement a {@link RateLimitChecker} and add it via
|
||||||
|
* {@link GitHubBuilder#withRateLimitChecker(RateLimitChecker)}.
|
||||||
*
|
*
|
||||||
* @return the rate limit
|
* @return the rate limit
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
* the io exception
|
* the io exception
|
||||||
*/
|
*/
|
||||||
|
@Nonnull
|
||||||
public GHRateLimit getRateLimit() throws IOException {
|
public GHRateLimit getRateLimit() throws IOException {
|
||||||
return client.getRateLimit();
|
return client.getRateLimit();
|
||||||
}
|
}
|
||||||
@@ -388,8 +396,11 @@ public class GitHub {
|
|||||||
* GitHub Enterprise) or if no requests have been made.
|
* GitHub Enterprise) or if no requests have been made.
|
||||||
*
|
*
|
||||||
* @return the most recently observed rate limit data or {@code null}.
|
* @return the most recently observed rate limit data or {@code null}.
|
||||||
|
* @deprecated implement a {@link RateLimitChecker} and add it via
|
||||||
|
* {@link GitHubBuilder#withRateLimitChecker(RateLimitChecker)}.
|
||||||
*/
|
*/
|
||||||
@CheckForNull
|
@Nonnull
|
||||||
|
@Deprecated
|
||||||
public GHRateLimit lastRateLimit() {
|
public GHRateLimit lastRateLimit() {
|
||||||
return client.lastRateLimit();
|
return client.lastRateLimit();
|
||||||
}
|
}
|
||||||
@@ -400,10 +411,13 @@ public class GitHub {
|
|||||||
* @return the current rate limit data.
|
* @return the current rate limit data.
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
* if we couldn't get the current rate limit data.
|
* if we couldn't get the current rate limit data.
|
||||||
|
* @deprecated implement a {@link RateLimitChecker} and add it via
|
||||||
|
* {@link GitHubBuilder#withRateLimitChecker(RateLimitChecker)}.
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
|
@Deprecated
|
||||||
public GHRateLimit rateLimit() throws IOException {
|
public GHRateLimit rateLimit() throws IOException {
|
||||||
return client.rateLimit();
|
return client.rateLimit(RateLimitTarget.CORE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -358,6 +358,18 @@ public class GitHubBuilder implements Cloneable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a {@link RateLimitChecker} for the Core API for this {@link GitHubBuilder}.
|
||||||
|
*
|
||||||
|
* @param coreRateLimitChecker
|
||||||
|
* the {@link RateLimitChecker} for core GitHub API requests
|
||||||
|
* @return the git hub builder
|
||||||
|
* @see #withRateLimitChecker(RateLimitChecker, RateLimitTarget)
|
||||||
|
*/
|
||||||
|
public GitHubBuilder withRateLimitChecker(@Nonnull RateLimitChecker coreRateLimitChecker) {
|
||||||
|
return withRateLimitChecker(coreRateLimitChecker, RateLimitTarget.CORE);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a {@link RateLimitChecker} to this {@link GitHubBuilder}.
|
* Adds a {@link RateLimitChecker} to this {@link GitHubBuilder}.
|
||||||
* <p>
|
* <p>
|
||||||
@@ -376,15 +388,15 @@ public class GitHubBuilder implements Cloneable {
|
|||||||
* request.
|
* request.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param coreRateLimitChecker
|
* @param rateLimitChecker
|
||||||
* the {@link RateLimitChecker} for core GitHub API requests
|
* the {@link RateLimitChecker} for requests
|
||||||
|
* @param rateLimitTarget
|
||||||
|
* the {@link RateLimitTarget} specifying which rate limit record to check
|
||||||
* @return the git hub builder
|
* @return the git hub builder
|
||||||
*/
|
*/
|
||||||
public GitHubBuilder withRateLimitChecker(@Nonnull RateLimitChecker coreRateLimitChecker) {
|
public GitHubBuilder withRateLimitChecker(@Nonnull RateLimitChecker rateLimitChecker,
|
||||||
this.rateLimitChecker = new GitHubRateLimitChecker(coreRateLimitChecker,
|
@Nonnull RateLimitTarget rateLimitTarget) {
|
||||||
RateLimitChecker.NONE,
|
this.rateLimitChecker = this.rateLimitChecker.with(rateLimitChecker, rateLimitTarget);
|
||||||
RateLimitChecker.NONE,
|
|
||||||
RateLimitChecker.NONE);
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import com.fasterxml.jackson.databind.ObjectWriter;
|
|||||||
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
|
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
|
||||||
import com.fasterxml.jackson.databind.introspect.VisibilityChecker;
|
import com.fasterxml.jackson.databind.introspect.VisibilityChecker;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
|
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -45,7 +44,7 @@ import static java.util.logging.Level.*;
|
|||||||
* A GitHub API Client
|
* A GitHub API Client
|
||||||
* <p>
|
* <p>
|
||||||
* A GitHubClient can be used to send requests and retrieve their responses. GitHubClient is thread-safe and can be used
|
* A GitHubClient can be used to send requests and retrieve their responses. GitHubClient is thread-safe and can be used
|
||||||
* to send multiple requests. GitHubClient also track some GitHub API information such as {@link #rateLimit()}.
|
* to send multiple requests. GitHubClient also track some GitHub API information such as {@link GHRateLimit}.
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
abstract class GitHubClient {
|
abstract class GitHubClient {
|
||||||
@@ -71,9 +70,10 @@ abstract class GitHubClient {
|
|||||||
|
|
||||||
private HttpConnector connector;
|
private HttpConnector connector;
|
||||||
|
|
||||||
private final Object headerRateLimitLock = new Object();
|
private final Object rateLimitLock = new Object();
|
||||||
private GHRateLimit headerRateLimit = null;
|
|
||||||
private volatile GHRateLimit rateLimit = null;
|
@Nonnull
|
||||||
|
private GHRateLimit rateLimit = GHRateLimit.DEFAULT;
|
||||||
|
|
||||||
private static final Logger LOGGER = Logger.getLogger(GitHubClient.class.getName());
|
private static final Logger LOGGER = Logger.getLogger(GitHubClient.class.getName());
|
||||||
|
|
||||||
@@ -142,10 +142,8 @@ abstract class GitHubClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private <T> T fetch(Class<T> type, String urlPath) throws IOException {
|
private <T> T fetch(Class<T> type, String urlPath) throws IOException {
|
||||||
return this
|
GitHubRequest request = GitHubRequest.newBuilder().withApiUrl(getApiUrl()).withUrlPath(urlPath).build();
|
||||||
.sendRequest(GitHubRequest.newBuilder().withApiUrl(getApiUrl()).withUrlPath(urlPath).build(),
|
return this.sendRequest(request, (responseInfo) -> GitHubResponse.parseBody(responseInfo, type)).body();
|
||||||
(responseInfo) -> GitHubResponse.parseBody(responseInfo, type))
|
|
||||||
.body();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -209,11 +207,14 @@ abstract class GitHubClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the current rate limit from the server.
|
* Gets the current full rate limit information from the server.
|
||||||
*
|
*
|
||||||
* For some versions of GitHub Enterprise, the {@code /rate_limit} endpoint returns a {@code 404 Not Found}. In
|
* For some versions of GitHub Enterprise, the {@code /rate_limit} endpoint returns a {@code 404 Not Found}. In that
|
||||||
* that, if {@link #lastRateLimit()} is not {@code null} and is not expired, it will be returned. Otherwise, a
|
* case, the most recent {@link GHRateLimit} information will be returned, including rate limit information returned
|
||||||
* placeholder {@link GHRateLimit} instance with {@link GHRateLimit.UnknownLimitRecord}s will be returned.
|
* in the response header for this request in if was present.
|
||||||
|
*
|
||||||
|
* For most use cases it would be better to implement a {@link RateLimitChecker} and add it via
|
||||||
|
* {@link GitHubBuilder#withRateLimitChecker(RateLimitChecker)}.
|
||||||
*
|
*
|
||||||
* @return the rate limit
|
* @return the rate limit
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
@@ -221,59 +222,95 @@ abstract class GitHubClient {
|
|||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public GHRateLimit getRateLimit() throws IOException {
|
public GHRateLimit getRateLimit() throws IOException {
|
||||||
|
return getRateLimit(RateLimitTarget.NONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
GHRateLimit getRateLimit(@Nonnull RateLimitTarget rateLimitTarget) throws IOException {
|
||||||
GHRateLimit result;
|
GHRateLimit result;
|
||||||
try {
|
try {
|
||||||
result = fetch(JsonRateLimit.class, "/rate_limit").resources;
|
GitHubRequest request = GitHubRequest.newBuilder()
|
||||||
|
.rateLimit(RateLimitTarget.NONE)
|
||||||
|
.withApiUrl(getApiUrl())
|
||||||
|
.withUrlPath("/rate_limit")
|
||||||
|
.build();
|
||||||
|
result = this
|
||||||
|
.sendRequest(request, (responseInfo) -> GitHubResponse.parseBody(responseInfo, JsonRateLimit.class))
|
||||||
|
.body().resources;
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
// For some versions of GitHub Enterprise, the rate_limit endpoint returns a 404.
|
// For some versions of GitHub Enterprise, the rate_limit endpoint returns a 404.
|
||||||
|
LOGGER.log(FINE, "/rate_limit returned 404 Not Found.");
|
||||||
|
|
||||||
// However some newer versions of GHE include rate limit header information
|
// However some newer versions of GHE include rate limit header information
|
||||||
// Use that if available
|
// If the header info is missing and the endpoint returns 404, fill the rate limit
|
||||||
result = lastRateLimit();
|
// with unknown
|
||||||
if (result == null || result.isExpired()) {
|
result = GHRateLimit.fromRecord(GHRateLimit.UnknownLimitRecord.current(), rateLimitTarget);
|
||||||
// return a default rate limit
|
|
||||||
result = GHRateLimit.Unknown();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return updateRateLimit(result);
|
||||||
return rateLimit = result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the most recently observed rate limit data or {@code null} if either there is no rate limit (for example
|
* Returns the most recently observed rate limit data.
|
||||||
* GitHub Enterprise) or if no requests have been made.
|
|
||||||
*
|
*
|
||||||
* @return the most recently observed rate limit data or {@code null}.
|
* Generally, instead of calling this you should implement a {@link RateLimitChecker} or call
|
||||||
|
*
|
||||||
|
* @return the most recently observed rate limit data. This may include expired or
|
||||||
|
* {@link GHRateLimit.UnknownLimitRecord} entries.
|
||||||
|
* @deprecated implement a {@link RateLimitChecker} and add it via
|
||||||
|
* {@link GitHubBuilder#withRateLimitChecker(RateLimitChecker)}.
|
||||||
*/
|
*/
|
||||||
@CheckForNull
|
@Nonnull
|
||||||
public GHRateLimit lastRateLimit() {
|
@Deprecated
|
||||||
synchronized (headerRateLimitLock) {
|
GHRateLimit lastRateLimit() {
|
||||||
return headerRateLimit;
|
synchronized (rateLimitLock) {
|
||||||
|
return rateLimit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the current rate limit while trying not to actually make any remote requests unless absolutely necessary.
|
* Gets the current rate limit for an endpoint while trying not to actually make any remote requests unless
|
||||||
|
* absolutely necessary.
|
||||||
*
|
*
|
||||||
* If {@link #lastRateLimit()} is not {@code null} and is not expired, it will be returned. If the information
|
* If the {@link GHRateLimit.Record} for {@code urlPath} is not expired, it is returned. If the
|
||||||
* returned from the last call to {@link #getRateLimit()} is not {@code null} and is not expired, then it will be
|
* {@link GHRateLimit.Record} for {@code urlPath} is expired, {@link #getRateLimit()} will be called to get the
|
||||||
* returned. Otherwise, the result of a call to {@link #getRateLimit()} will be returned.
|
* current rate limit.
|
||||||
*
|
*
|
||||||
* @return the current rate limit data.
|
* @param rateLimitTarget
|
||||||
|
* the endpoint to get the rate limit for.
|
||||||
|
*
|
||||||
|
* @return the current rate limit data. {@link GHRateLimit.Record}s in this instance may be expired when returned.
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
* if there was an error getting current rate limit data.
|
* if there was an error getting current rate limit data.
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public GHRateLimit rateLimit() throws IOException {
|
GHRateLimit rateLimit(@Nonnull RateLimitTarget rateLimitTarget) throws IOException {
|
||||||
synchronized (headerRateLimitLock) {
|
synchronized (rateLimitLock) {
|
||||||
if (headerRateLimit != null && !headerRateLimit.isExpired()) {
|
if (rateLimit.getRecord(rateLimitTarget).isExpired()) {
|
||||||
return headerRateLimit;
|
getRateLimit(rateLimitTarget);
|
||||||
}
|
}
|
||||||
|
return rateLimit;
|
||||||
}
|
}
|
||||||
GHRateLimit result = this.rateLimit;
|
}
|
||||||
if (result == null || result.isExpired()) {
|
|
||||||
result = getRateLimit();
|
/**
|
||||||
|
* Update the Rate Limit with the latest info from response header.
|
||||||
|
*
|
||||||
|
* Due to multi-threading, requests might complete out of order. This method calls
|
||||||
|
* {@link GHRateLimit#getMergedRateLimit(GHRateLimit)} to ensure the most current records are used.
|
||||||
|
*
|
||||||
|
* @param observed
|
||||||
|
* {@link GHRateLimit.Record} constructed from the response header information
|
||||||
|
*/
|
||||||
|
private GHRateLimit updateRateLimit(@Nonnull GHRateLimit observed) {
|
||||||
|
synchronized (rateLimitLock) {
|
||||||
|
observed = rateLimit.getMergedRateLimit(observed);
|
||||||
|
|
||||||
|
if (rateLimit != observed) {
|
||||||
|
rateLimit = observed;
|
||||||
|
LOGGER.log(FINE, "Rate limit now: {0}", rateLimit);
|
||||||
|
}
|
||||||
|
return rateLimit;
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -517,58 +554,25 @@ abstract class GitHubClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void noteRateLimit(@Nonnull GitHubResponse.ResponseInfo responseInfo) {
|
private void noteRateLimit(@Nonnull GitHubResponse.ResponseInfo responseInfo) {
|
||||||
if (responseInfo.request().urlPath().startsWith("/search")) {
|
|
||||||
// the search API uses a different rate limit
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
String limitString = responseInfo.headerField("X-RateLimit-Limit");
|
|
||||||
if (StringUtils.isBlank(limitString)) {
|
|
||||||
// if we are missing a header, return fast
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String remainingString = responseInfo.headerField("X-RateLimit-Remaining");
|
|
||||||
if (StringUtils.isBlank(remainingString)) {
|
|
||||||
// if we are missing a header, return fast
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String resetString = responseInfo.headerField("X-RateLimit-Reset");
|
|
||||||
if (StringUtils.isBlank(resetString)) {
|
|
||||||
// if we are missing a header, return fast
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int limit, remaining;
|
|
||||||
long reset;
|
|
||||||
try {
|
try {
|
||||||
|
String limitString = Objects.requireNonNull(responseInfo.headerField("X-RateLimit-Limit"),
|
||||||
|
"Missing X-RateLimit-Limit");
|
||||||
|
String remainingString = Objects.requireNonNull(responseInfo.headerField("X-RateLimit-Remaining"),
|
||||||
|
"Missing X-RateLimit-Remaining");
|
||||||
|
String resetString = Objects.requireNonNull(responseInfo.headerField("X-RateLimit-Reset"),
|
||||||
|
"Missing X-RateLimit-Reset");
|
||||||
|
int limit, remaining;
|
||||||
|
long reset;
|
||||||
limit = Integer.parseInt(limitString);
|
limit = Integer.parseInt(limitString);
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
if (LOGGER.isLoggable(FINEST)) {
|
|
||||||
LOGGER.log(FINEST, "Malformed X-RateLimit-Limit header value " + limitString, e);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
|
|
||||||
remaining = Integer.parseInt(remainingString);
|
remaining = Integer.parseInt(remainingString);
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
if (LOGGER.isLoggable(FINEST)) {
|
|
||||||
LOGGER.log(FINEST, "Malformed X-RateLimit-Remaining header value " + remainingString, e);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
reset = Long.parseLong(resetString);
|
reset = Long.parseLong(resetString);
|
||||||
} catch (NumberFormatException e) {
|
GHRateLimit.Record observed = new GHRateLimit.Record(limit, remaining, reset, responseInfo);
|
||||||
|
updateRateLimit(GHRateLimit.fromRecord(observed, responseInfo.request().rateLimitTarget()));
|
||||||
|
} catch (NumberFormatException | NullPointerException e) {
|
||||||
if (LOGGER.isLoggable(FINEST)) {
|
if (LOGGER.isLoggable(FINEST)) {
|
||||||
LOGGER.log(FINEST, "Malformed X-RateLimit-Reset header value " + resetString, e);
|
LOGGER.log(FINEST, "Missing or malformed X-RateLimit header: ", e);
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GHRateLimit.Record observed = new GHRateLimit.Record(limit, remaining, reset, responseInfo);
|
|
||||||
|
|
||||||
updateCoreRateLimit(observed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void detectOTPRequired(@Nonnull GitHubResponse.ResponseInfo responseInfo) throws GHIOException {
|
private static void detectOTPRequired(@Nonnull GitHubResponse.ResponseInfo responseInfo) throws GHIOException {
|
||||||
@@ -588,23 +592,6 @@ abstract class GitHubClient {
|
|||||||
"This operation requires a credential but none is given to the GitHub constructor");
|
"This operation requires a credential but none is given to the GitHub constructor");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the Rate Limit with the latest info from response header. Due to multi-threading requests might complete
|
|
||||||
* out of order, we want to pick the one with the most recent info from the server. Calls
|
|
||||||
* {@link #shouldReplace(GHRateLimit.Record, GHRateLimit.Record)}
|
|
||||||
*
|
|
||||||
* @param observed
|
|
||||||
* {@link GHRateLimit.Record} constructed from the response header information
|
|
||||||
*/
|
|
||||||
private void updateCoreRateLimit(@Nonnull GHRateLimit.Record observed) {
|
|
||||||
synchronized (headerRateLimitLock) {
|
|
||||||
if (headerRateLimit == null || shouldReplace(observed, headerRateLimit.getCore())) {
|
|
||||||
headerRateLimit = GHRateLimit.fromHeaderRecord(observed);
|
|
||||||
LOGGER.log(FINE, "Rate limit now: {0}", headerRateLimit);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class GHApiInfo {
|
private static class GHApiInfo {
|
||||||
private String rate_limit_url;
|
private String rate_limit_url;
|
||||||
|
|
||||||
@@ -654,37 +641,6 @@ abstract class GitHubClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine if one {@link GHRateLimit.Record} should replace another. Header date is only accurate to the second,
|
|
||||||
* so we look at the information in the record itself.
|
|
||||||
*
|
|
||||||
* {@link GHRateLimit.UnknownLimitRecord}s are always replaced by regular {@link GHRateLimit.Record}s. Regular
|
|
||||||
* {@link GHRateLimit.Record}s are never replaced by {@link GHRateLimit.UnknownLimitRecord}s. Candidates with
|
|
||||||
* resetEpochSeconds later than current record are more recent. Candidates with the same reset and a lower remaining
|
|
||||||
* count are more recent. Candidates with an earlier reset are older.
|
|
||||||
*
|
|
||||||
* @param candidate
|
|
||||||
* {@link GHRateLimit.Record} constructed from the response header information
|
|
||||||
* @param current
|
|
||||||
* the current {@link GHRateLimit.Record} record
|
|
||||||
*/
|
|
||||||
static boolean shouldReplace(@Nonnull GHRateLimit.Record candidate, @Nonnull GHRateLimit.Record current) {
|
|
||||||
if (candidate instanceof GHRateLimit.UnknownLimitRecord
|
|
||||||
&& !(current instanceof GHRateLimit.UnknownLimitRecord)) {
|
|
||||||
// Unknown candidate never replaces a regular record
|
|
||||||
return false;
|
|
||||||
} else if (current instanceof GHRateLimit.UnknownLimitRecord
|
|
||||||
&& !(candidate instanceof GHRateLimit.UnknownLimitRecord)) {
|
|
||||||
// Any real record should replace an unknown Record.
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
// records of the same type compare to each other as normal.
|
|
||||||
return current.getResetEpochSeconds() < candidate.getResetEpochSeconds()
|
|
||||||
|| (current.getResetEpochSeconds() == candidate.getResetEpochSeconds()
|
|
||||||
&& current.getRemaining() > candidate.getRemaining());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static URL parseURL(String s) {
|
static URL parseURL(String s) {
|
||||||
try {
|
try {
|
||||||
return s == null ? null : new URL(s);
|
return s == null ? null : new URL(s);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import static org.apache.commons.lang3.StringUtils.defaultString;
|
|||||||
* A GitHub API Client for HttpUrlConnection
|
* A GitHub API Client for HttpUrlConnection
|
||||||
* <p>
|
* <p>
|
||||||
* A GitHubClient can be used to send requests and retrieve their responses. GitHubClient is thread-safe and can be used
|
* A GitHubClient can be used to send requests and retrieve their responses. GitHubClient is thread-safe and can be used
|
||||||
* to send multiple requests. GitHubClient also track some GitHub API information such as {@link #rateLimit()}.
|
* to send multiple requests. GitHubClient also track some GitHub API information such as {@link GHRateLimit}.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* GitHubHttpUrlConnectionClient gets a new {@link HttpURLConnection} for each call to send.
|
* GitHubHttpUrlConnectionClient gets a new {@link HttpURLConnection} for each call to send.
|
||||||
|
|||||||
@@ -3,26 +3,28 @@ package org.kohsuke.github;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InterruptedIOException;
|
import java.io.InterruptedIOException;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A GitHub API Rate Limit Checker called before each request. This class provides the basic infrastructure for calling
|
* A GitHub API Rate Limit Checker called before each request.
|
||||||
* the appropriate {@link RateLimitChecker} for a request and retrying as many times as needed. This class supports more
|
*
|
||||||
* complex throttling strategies and polling, but leaves the specifics to the {@link RateLimitChecker} implementations.
|
|
||||||
* <p>
|
* <p>
|
||||||
* GitHub allots a certain number of requests to each user or application per period of time (usually per hour). The
|
* GitHub allots a certain number of requests to each user or application per period of time. The number of requests
|
||||||
* number of requests remaining is returned in the response header and can also be requested using
|
* remaining and the time when the number will be reset is returned in the response header and can also be requested
|
||||||
* {@link GitHub#getRateLimit()}. This requests per interval is referred to as the "rate limit".
|
* using {@link GitHub#getRateLimit()}. The "requests per interval" is referred to as the "rate limit".
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* GitHub prefers that clients stop before exceeding their rate limit rather than stopping after they exceed it. The
|
* Different parts of the GitHub API have separate rate limits, but most of REST API uses {@link RateLimitTarget#CORE}.
|
||||||
* {@link RateLimitChecker} is called before each request to check the rate limit and wait if the checker criteria are
|
* Checking your rate limit using {@link GitHub#getRateLimit()} does not effect your rate limit. GitHub prefers that
|
||||||
* met.
|
* clients stop before exceeding their rate limit rather than stopping after they exceed it.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* Checking your rate limit using {@link GitHub#getRateLimit()} does not effect your rate limit, but each {@link GitHub}
|
* This class provides the infrastructure for calling the appropriate {@link RateLimitChecker} before each request and
|
||||||
* instance will attempt to cache and reuse the last see rate limit rather than making a new request.
|
* retrying than call many times as needed. Each {@link RateLimitChecker} decides whether to wait and for how long. This
|
||||||
|
* allows for a wide range of {@link RateLimitChecker} implementations, including complex throttling strategies and
|
||||||
|
* polling.
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
class GitHubRateLimitChecker {
|
class GitHubRateLimitChecker {
|
||||||
@@ -39,6 +41,8 @@ class GitHubRateLimitChecker {
|
|||||||
@Nonnull
|
@Nonnull
|
||||||
private final RateLimitChecker integrationManifest;
|
private final RateLimitChecker integrationManifest;
|
||||||
|
|
||||||
|
private static final Logger LOGGER = Logger.getLogger(GitHubRateLimitChecker.class.getName());
|
||||||
|
|
||||||
GitHubRateLimitChecker() {
|
GitHubRateLimitChecker() {
|
||||||
this(RateLimitChecker.NONE, RateLimitChecker.NONE, RateLimitChecker.NONE, RateLimitChecker.NONE);
|
this(RateLimitChecker.NONE, RateLimitChecker.NONE, RateLimitChecker.NONE, RateLimitChecker.NONE);
|
||||||
}
|
}
|
||||||
@@ -48,40 +52,57 @@ class GitHubRateLimitChecker {
|
|||||||
@Nonnull RateLimitChecker graphql,
|
@Nonnull RateLimitChecker graphql,
|
||||||
@Nonnull RateLimitChecker integrationManifest) {
|
@Nonnull RateLimitChecker integrationManifest) {
|
||||||
this.core = Objects.requireNonNull(core);
|
this.core = Objects.requireNonNull(core);
|
||||||
|
|
||||||
// for now only support rate limiting on core
|
|
||||||
// remove these asserts when that changes
|
|
||||||
assert search == RateLimitChecker.NONE;
|
|
||||||
assert graphql == RateLimitChecker.NONE;
|
|
||||||
assert integrationManifest == RateLimitChecker.NONE;
|
|
||||||
|
|
||||||
this.search = Objects.requireNonNull(search);
|
this.search = Objects.requireNonNull(search);
|
||||||
this.graphql = Objects.requireNonNull(graphql);
|
this.graphql = Objects.requireNonNull(graphql);
|
||||||
this.integrationManifest = Objects.requireNonNull(integrationManifest);
|
this.integrationManifest = Objects.requireNonNull(integrationManifest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a new {@link GitHubRateLimitChecker} with a new checker for a particular target.
|
||||||
|
*
|
||||||
|
* Only one {@link RateLimitChecker} is allowed per target.
|
||||||
|
*
|
||||||
|
* @param checker
|
||||||
|
* the {@link RateLimitChecker} to apply.
|
||||||
|
* @param rateLimitTarget
|
||||||
|
* the {@link RateLimitTarget} for this checker. If {@link RateLimitTarget#NONE}, checker will be ignored
|
||||||
|
* and no change will be made.
|
||||||
|
* @return a new {@link GitHubRateLimitChecker}
|
||||||
|
*/
|
||||||
|
GitHubRateLimitChecker with(@Nonnull RateLimitChecker checker, @Nonnull RateLimitTarget rateLimitTarget) {
|
||||||
|
return new GitHubRateLimitChecker(rateLimitTarget == RateLimitTarget.CORE ? checker : core,
|
||||||
|
rateLimitTarget == RateLimitTarget.SEARCH ? checker : search,
|
||||||
|
rateLimitTarget == RateLimitTarget.GRAPHQL ? checker : graphql,
|
||||||
|
rateLimitTarget == RateLimitTarget.INTEGRATION_MANIFEST ? checker : integrationManifest);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether there is sufficient requests remaining within this client's rate limit quota to make the current
|
* Checks whether there is sufficient requests remaining within this client's rate limit quota to make the current
|
||||||
* request.
|
* request.
|
||||||
* <p>
|
* <p>
|
||||||
* This method does not do the actual check. Instead it select the appropriate {@link RateLimitChecker} and
|
* This method does not do the actual check. Instead it selects the appropriate {@link RateLimitChecker} and
|
||||||
* {@link GHRateLimit.Record} for the current request's urlPath. If the {@link RateLimitChecker} for this the
|
* {@link GHRateLimit.Record} for the current request's {@link RateLimitTarget}. It then calls
|
||||||
* current request's urlPath is {@link RateLimitChecker#NONE} the rate limit is not checked. If not, it calls
|
* {@link RateLimitChecker#checkRateLimit(GHRateLimit.Record, long)}.
|
||||||
* {@link RateLimitChecker#checkRateLimit(GHRateLimit.Record, long)}. which decides if the rate limit has been
|
|
||||||
* exceeded and then sleeps for as long is it choose.
|
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* It is up to the {@link RateLimitChecker#checkRateLimit(GHRateLimit.Record, long)} which decide if the rate limit
|
* It is up to {@link RateLimitChecker#checkRateLimit(GHRateLimit.Record, long)} to which decide if the rate limit
|
||||||
* has been exceeded. If it has, that method will sleep for as long is it chooses and then return {@code true}. If
|
* has been exceeded. If it has, {@link RateLimitChecker#checkRateLimit(GHRateLimit.Record, long)} will sleep for as
|
||||||
* not, that method will return {@code false}.
|
* long is it chooses and then return {@code true}. If not, that method will return {@code false}.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* As long as {@link RateLimitChecker#checkRateLimit(GHRateLimit.Record, long)} returns {@code true}, this method
|
* As long as {@link RateLimitChecker#checkRateLimit(GHRateLimit.Record, long)} returns {@code true}, this method
|
||||||
* will request updated rate limit information and call
|
* will request updated rate limit information and call
|
||||||
* {@link RateLimitChecker#checkRateLimit(GHRateLimit.Record, long)} again. This looping allows implementers of
|
* {@link RateLimitChecker#checkRateLimit(GHRateLimit.Record, long)} again. This looping allows different
|
||||||
* {@link RateLimitChecker#checkRateLimit(GHRateLimit.Record, long)} to apply any number of strategies to
|
* {@link RateLimitChecker} implementations to apply any number of strategies to controlling the speed at which
|
||||||
* controlling the speed at which requests are made. When it returns {@code false} this method will return and the
|
* requests are made.
|
||||||
* request will be sent.
|
* </p>
|
||||||
|
* <p>
|
||||||
|
* When the {@link RateLimitChecker} returns {@code false} this method will return and the request processing will
|
||||||
|
* continue.
|
||||||
|
* </p>
|
||||||
|
* <p>
|
||||||
|
* If the {@link RateLimitChecker} for this the current request's urlPath is {@link RateLimitChecker#NONE} the rate
|
||||||
|
* limit is not checked.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param client
|
* @param client
|
||||||
@@ -92,14 +113,14 @@ class GitHubRateLimitChecker {
|
|||||||
* if there is an I/O error
|
* if there is an I/O error
|
||||||
*/
|
*/
|
||||||
void checkRateLimit(GitHubClient client, GitHubRequest request) throws IOException {
|
void checkRateLimit(GitHubClient client, GitHubRequest request) throws IOException {
|
||||||
RateLimitChecker guard = selectChecker(request.urlPath());
|
RateLimitChecker guard = selectChecker(request.rateLimitTarget());
|
||||||
if (guard == RateLimitChecker.NONE) {
|
if (guard == RateLimitChecker.NONE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// For the first rate limit, accept the current limit if a valid one is already present.
|
// For the first rate limit, accept the current limit if a valid one is already present.
|
||||||
GHRateLimit rateLimit = client.rateLimit();
|
GHRateLimit rateLimit = client.rateLimit(request.rateLimitTarget());
|
||||||
GHRateLimit.Record rateLimitRecord = rateLimit.getRecordForUrlPath(request.urlPath());
|
GHRateLimit.Record rateLimitRecord = rateLimit.getRecord(request.rateLimitTarget());
|
||||||
long waitCount = 0;
|
long waitCount = 0;
|
||||||
try {
|
try {
|
||||||
while (guard.checkRateLimit(rateLimitRecord, waitCount)) {
|
while (guard.checkRateLimit(rateLimitRecord, waitCount)) {
|
||||||
@@ -112,8 +133,8 @@ class GitHubRateLimitChecker {
|
|||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
|
|
||||||
// After the first wait, always request a new rate limit from the server.
|
// After the first wait, always request a new rate limit from the server.
|
||||||
rateLimit = client.getRateLimit();
|
rateLimit = client.getRateLimit(request.rateLimitTarget());
|
||||||
rateLimitRecord = rateLimit.getRecordForUrlPath(request.urlPath());
|
rateLimitRecord = rateLimit.getRecord(request.rateLimitTarget());
|
||||||
}
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
throw (IOException) new InterruptedIOException(e.getMessage()).initCause(e);
|
throw (IOException) new InterruptedIOException(e.getMessage()).initCause(e);
|
||||||
@@ -121,25 +142,28 @@ class GitHubRateLimitChecker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the appropriate {@link RateLimitChecker} for a particular url path. Similar to
|
* Gets the appropriate {@link RateLimitChecker} for a particular target.
|
||||||
* {@link GHRateLimit#getRecordForUrlPath(String)}.
|
|
||||||
*
|
*
|
||||||
* @param urlPath
|
* Analogous with {@link GHRateLimit#getRecord(RateLimitTarget)}.
|
||||||
* the url path of the request
|
*
|
||||||
* @return the {@link RateLimitChecker} for a url path.
|
* @param rateLimitTarget
|
||||||
|
* the rate limit to check
|
||||||
|
* @return the {@link RateLimitChecker} for a particular target
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
private RateLimitChecker selectChecker(@Nonnull String urlPath) {
|
private RateLimitChecker selectChecker(@Nonnull RateLimitTarget rateLimitTarget) {
|
||||||
if (urlPath.equals("/rate_limit")) {
|
if (rateLimitTarget == RateLimitTarget.NONE) {
|
||||||
return RateLimitChecker.NONE;
|
return RateLimitChecker.NONE;
|
||||||
} else if (urlPath.startsWith("/search")) {
|
} else if (rateLimitTarget == RateLimitTarget.CORE) {
|
||||||
|
return core;
|
||||||
|
} else if (rateLimitTarget == RateLimitTarget.SEARCH) {
|
||||||
return search;
|
return search;
|
||||||
} else if (urlPath.startsWith("/graphql")) {
|
} else if (rateLimitTarget == RateLimitTarget.GRAPHQL) {
|
||||||
return graphql;
|
return graphql;
|
||||||
} else if (urlPath.startsWith("/app-manifests")) {
|
} else if (rateLimitTarget == RateLimitTarget.INTEGRATION_MANIFEST) {
|
||||||
return integrationManifest;
|
return integrationManifest;
|
||||||
} else {
|
} else {
|
||||||
return core;
|
throw new IllegalArgumentException("Unknown rate limit target: " + rateLimitTarget.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ class GitHubRequest {
|
|||||||
private final String apiUrl;
|
private final String apiUrl;
|
||||||
private final String urlPath;
|
private final String urlPath;
|
||||||
private final String method;
|
private final String method;
|
||||||
|
private final RateLimitTarget rateLimitTarget;
|
||||||
private final InputStream body;
|
private final InputStream body;
|
||||||
private final boolean forceBody;
|
private final boolean forceBody;
|
||||||
|
|
||||||
@@ -56,6 +57,7 @@ class GitHubRequest {
|
|||||||
@Nonnull String apiUrl,
|
@Nonnull String apiUrl,
|
||||||
@Nonnull String urlPath,
|
@Nonnull String urlPath,
|
||||||
@Nonnull String method,
|
@Nonnull String method,
|
||||||
|
@Nonnull RateLimitTarget rateLimitTarget,
|
||||||
@CheckForNull InputStream body,
|
@CheckForNull InputStream body,
|
||||||
boolean forceBody) throws MalformedURLException {
|
boolean forceBody) throws MalformedURLException {
|
||||||
this.args = Collections.unmodifiableList(new ArrayList<>(args));
|
this.args = Collections.unmodifiableList(new ArrayList<>(args));
|
||||||
@@ -64,6 +66,7 @@ class GitHubRequest {
|
|||||||
this.apiUrl = apiUrl;
|
this.apiUrl = apiUrl;
|
||||||
this.urlPath = urlPath;
|
this.urlPath = urlPath;
|
||||||
this.method = method;
|
this.method = method;
|
||||||
|
this.rateLimitTarget = rateLimitTarget;
|
||||||
this.body = body;
|
this.body = body;
|
||||||
this.forceBody = forceBody;
|
this.forceBody = forceBody;
|
||||||
String tailApiUrl = buildTailApiUrl();
|
String tailApiUrl = buildTailApiUrl();
|
||||||
@@ -119,6 +122,16 @@ class GitHubRequest {
|
|||||||
return method;
|
return method;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The rate limit target for this request.
|
||||||
|
*
|
||||||
|
* @return the rate limit to use for this request.
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
public RateLimitTarget rateLimitTarget() {
|
||||||
|
return rateLimitTarget;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The arguments for this request. Depending on the {@link #method()} and {@code #inBody()} these maybe added to the
|
* The arguments for this request. Depending on the {@link #method()} and {@code #inBody()} these maybe added to the
|
||||||
* url or to the request body.
|
* url or to the request body.
|
||||||
@@ -217,7 +230,15 @@ class GitHubRequest {
|
|||||||
* @return a {@link Builder} based on this request.
|
* @return a {@link Builder} based on this request.
|
||||||
*/
|
*/
|
||||||
public Builder<?> toBuilder() {
|
public Builder<?> toBuilder() {
|
||||||
return new Builder<>(args, headers, injectedMappingValues, apiUrl, urlPath, method, body, forceBody);
|
return new Builder<>(args,
|
||||||
|
headers,
|
||||||
|
injectedMappingValues,
|
||||||
|
apiUrl,
|
||||||
|
urlPath,
|
||||||
|
method,
|
||||||
|
rateLimitTarget,
|
||||||
|
body,
|
||||||
|
forceBody);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String buildTailApiUrl() {
|
private String buildTailApiUrl() {
|
||||||
@@ -281,6 +302,10 @@ class GitHubRequest {
|
|||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
private String method;
|
private String method;
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
private RateLimitTarget rateLimitTarget;
|
||||||
|
|
||||||
private InputStream body;
|
private InputStream body;
|
||||||
private boolean forceBody;
|
private boolean forceBody;
|
||||||
|
|
||||||
@@ -294,6 +319,7 @@ class GitHubRequest {
|
|||||||
GitHubClient.GITHUB_URL,
|
GitHubClient.GITHUB_URL,
|
||||||
"/",
|
"/",
|
||||||
"GET",
|
"GET",
|
||||||
|
RateLimitTarget.CORE,
|
||||||
null,
|
null,
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
@@ -304,6 +330,7 @@ class GitHubRequest {
|
|||||||
@Nonnull String apiUrl,
|
@Nonnull String apiUrl,
|
||||||
@Nonnull String urlPath,
|
@Nonnull String urlPath,
|
||||||
@Nonnull String method,
|
@Nonnull String method,
|
||||||
|
@Nonnull RateLimitTarget rateLimitTarget,
|
||||||
@CheckForNull @WillClose InputStream body,
|
@CheckForNull @WillClose InputStream body,
|
||||||
boolean forceBody) {
|
boolean forceBody) {
|
||||||
this.args = new ArrayList<>(args);
|
this.args = new ArrayList<>(args);
|
||||||
@@ -312,6 +339,7 @@ class GitHubRequest {
|
|||||||
this.apiUrl = apiUrl;
|
this.apiUrl = apiUrl;
|
||||||
this.urlPath = urlPath;
|
this.urlPath = urlPath;
|
||||||
this.method = method;
|
this.method = method;
|
||||||
|
this.rateLimitTarget = rateLimitTarget;
|
||||||
this.body = body;
|
this.body = body;
|
||||||
this.forceBody = forceBody;
|
this.forceBody = forceBody;
|
||||||
}
|
}
|
||||||
@@ -324,7 +352,15 @@ class GitHubRequest {
|
|||||||
* if the GitHub API URL cannot be constructed
|
* if the GitHub API URL cannot be constructed
|
||||||
*/
|
*/
|
||||||
public GitHubRequest build() throws MalformedURLException {
|
public GitHubRequest build() throws MalformedURLException {
|
||||||
return new GitHubRequest(args, headers, injectedMappingValues, apiUrl, urlPath, method, body, forceBody);
|
return new GitHubRequest(args,
|
||||||
|
headers,
|
||||||
|
injectedMappingValues,
|
||||||
|
apiUrl,
|
||||||
|
urlPath,
|
||||||
|
method,
|
||||||
|
rateLimitTarget,
|
||||||
|
body,
|
||||||
|
forceBody);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -562,6 +598,18 @@ class GitHubRequest {
|
|||||||
return (B) this;
|
return (B) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method requester.
|
||||||
|
*
|
||||||
|
* @param rateLimitTarget
|
||||||
|
* the rate limit target for this request. Default is {@link RateLimitTarget#CORE}.
|
||||||
|
* @return the request builder
|
||||||
|
*/
|
||||||
|
public B rateLimit(@Nonnull RateLimitTarget rateLimitTarget) {
|
||||||
|
this.rateLimitTarget = rateLimitTarget;
|
||||||
|
return (B) this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Content type requester.
|
* Content type requester.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -5,20 +5,17 @@ import java.util.logging.Logger;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A GitHub API Rate Limit Checker called before each request
|
* A GitHub API Rate Limit Checker called before each request
|
||||||
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* GitHub allots a certain number of requests to each user or application per period of time (usually per hour). The
|
* GitHub allots a certain number of requests to each user or application per period of time. The number of requests
|
||||||
* number of requests remaining is returned in the response header and can also be requested using
|
* remaining and the time when the number will be reset is returned in the response header and can also be requested
|
||||||
* {@link GitHub#getRateLimit()}. This requests per interval is referred to as the "rate limit".
|
* using {@link GitHub#getRateLimit()}. The "requests per interval" is referred to as the "rate limit".
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* GitHub prefers that clients stop before exceeding their rate limit rather than stopping after they exceed it. The
|
* GitHub prefers that clients stop before exceeding their rate limit rather than stopping after they exceed it. The
|
||||||
* {@link RateLimitChecker} is called before each request to check the rate limit and wait if the checker criteria are
|
* {@link RateLimitChecker} is called before each request to check the rate limit and wait if the checker criteria are
|
||||||
* met.
|
* met.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
|
||||||
* Checking your rate limit using {@link GitHub#getRateLimit()} does not effect your rate limit, but each {@link GitHub}
|
|
||||||
* instance will attempt to cache and reuse the last see rate limit rather than making a new request.
|
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
public abstract class RateLimitChecker {
|
public abstract class RateLimitChecker {
|
||||||
|
|
||||||
@@ -33,28 +30,21 @@ public abstract class RateLimitChecker {
|
|||||||
* free to choose whatever strategy they prefer for what is considered to exceed the budget and how long to sleep.
|
* free to choose whatever strategy they prefer for what is considered to exceed the budget and how long to sleep.
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* The caller of this method figures out which {@link GHRateLimit.Record} applies for the current request add
|
* The caller of this method figures out which {@link GHRateLimit.Record} applies for the current request and
|
||||||
* provides it to this method.
|
* provides it to this method.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* It is important to remember that rate limit reset times are only accurate to the second. Trying to sleep to
|
* As long as this method returns {@code true} it is guaranteed that {@link GitHubRateLimitChecker} will retrieve
|
||||||
* exactly the reset time would be likely to produce worse behavior rather than better. For this reason
|
* updated rate limit information and call this method again with {@code count} incremented by one. When this
|
||||||
* {@link GitHubRateLimitChecker} may choose to add more sleep times when a checker indicates the rate limit was
|
* checker returns {@code false}, the calling {@link GitHubRateLimitChecker} will let the request continue.
|
||||||
* exceeded.
|
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* As long as this method returns {@code true} it is guaranteed that {@link GitHubRateLimitChecker} will get updated
|
* Rate limit reset times are only accurate to the second. Trying to sleep to exactly the reset time could result in
|
||||||
* rate limit information and call this method again with {@code count} incremented by one. After this method
|
* requests being sent before the new rate limit was available. For this reason, if this method returned
|
||||||
* returns {@code true} at least once, the calling {@link GitHubRateLimitChecker} may choose to wait some additional
|
* {@code true} at least once for a particular request, {@link GitHubRateLimitChecker} may choose to sleep for some
|
||||||
* period of time between calls to this checker.
|
* small additional between calls and before letting the request continue.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
*
|
||||||
* After this checker returns {@code false}, the calling {@link GitHubRateLimitChecker} will let the request
|
|
||||||
* continue. If this method returned {@code true} at least once for a particular request, the calling
|
|
||||||
* {@link GitHubRateLimitChecker} may choose to wait some additional period of time before letting the request be
|
|
||||||
* sent.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param rateLimitRecord
|
* @param rateLimitRecord
|
||||||
* the current {@link GHRateLimit.Record} to check against.
|
* the current {@link GHRateLimit.Record} to check against.
|
||||||
* @param count
|
* @param count
|
||||||
|
|||||||
36
src/main/java/org/kohsuke/github/RateLimitTarget.java
Normal file
36
src/main/java/org/kohsuke/github/RateLimitTarget.java
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
package org.kohsuke.github;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specifies the rate limit record of an operation.
|
||||||
|
*
|
||||||
|
* @see GitHubBuilder#withRateLimitChecker(RateLimitChecker, RateLimitTarget)
|
||||||
|
*/
|
||||||
|
public enum RateLimitTarget {
|
||||||
|
/**
|
||||||
|
* Selects or updates the {@link GHRateLimit#getCore()} record.
|
||||||
|
*/
|
||||||
|
CORE,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Selects or updates the {@link GHRateLimit#getSearch()} record.
|
||||||
|
*/
|
||||||
|
SEARCH,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Selects or updates the {@link GHRateLimit#getGraphQL()} record.
|
||||||
|
*/
|
||||||
|
GRAPHQL,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Selects or updates the {@link GHRateLimit#getIntegrationManifest()} record.
|
||||||
|
*/
|
||||||
|
INTEGRATION_MANIFEST,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Selects no rate limit.
|
||||||
|
*
|
||||||
|
* This request uses no rate limit. If the response header includes rate limit information, it will apply to
|
||||||
|
* {@link #CORE}.
|
||||||
|
*/
|
||||||
|
NONE
|
||||||
|
}
|
||||||
31
src/site/apt/createorglevelresources.apt
Normal file
31
src/site/apt/createorglevelresources.apt
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
Creating resources at the organization level
|
||||||
|
|
||||||
|
In order to create resources in GitHub for a given organization, you must first create an object of type <<<GHOrganization>>>.
|
||||||
|
As an example:
|
||||||
|
|
||||||
|
+-----+
|
||||||
|
GHOrganization organizationClient(GitHub gitHub, String organizationName) throws IOException {
|
||||||
|
return gitHub.getOrganization(organizationName);
|
||||||
|
}
|
||||||
|
+-----+
|
||||||
|
|
||||||
|
Now you can easily work with the GHOrganization, and all methods that will create resources will create them
|
||||||
|
in the given organization.
|
||||||
|
|
||||||
|
One of the most common use cases is to create a repository in a given organization:
|
||||||
|
|
||||||
|
+-----+
|
||||||
|
void createRepository(GHOrganization organization) {
|
||||||
|
organization.createRepository("repository-name")
|
||||||
|
.private_(true)
|
||||||
|
.wiki(false)
|
||||||
|
.projects(false)
|
||||||
|
.description("Description")
|
||||||
|
.allowMergeCommit(true)
|
||||||
|
.allowSquashMerge(false)
|
||||||
|
.allowRebaseMerge(false)
|
||||||
|
.create()
|
||||||
|
}
|
||||||
|
+-----+
|
||||||
|
|
||||||
|
|
||||||
@@ -23,6 +23,7 @@
|
|||||||
<item name="JWT Authentication" href="/githubappjwtauth.html"/>
|
<item name="JWT Authentication" href="/githubappjwtauth.html"/>
|
||||||
<item name="App Installation Token " href="/githubappappinsttokenauth.html"/>
|
<item name="App Installation Token " href="/githubappappinsttokenauth.html"/>
|
||||||
</item>
|
</item>
|
||||||
|
<item name="Working with organizations" href="/createorglevelresources.html"/>
|
||||||
</menu>
|
</menu>
|
||||||
|
|
||||||
<menu name="References">
|
<menu name="References">
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import java.util.Map.Entry;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
import static org.hamcrest.CoreMatchers.*;
|
||||||
|
import static org.hamcrest.CoreMatchers.sameInstance;
|
||||||
import static org.hamcrest.Matchers.hasProperty;
|
import static org.hamcrest.Matchers.hasProperty;
|
||||||
import static org.hamcrest.Matchers.oneOf;
|
import static org.hamcrest.Matchers.oneOf;
|
||||||
|
|
||||||
@@ -108,7 +109,7 @@ public class AppTest extends AbstractGitHubWireMockTest {
|
|||||||
gitHub = getGitHubBuilder().withOAuthToken("bogus", "user")
|
gitHub = getGitHubBuilder().withOAuthToken("bogus", "user")
|
||||||
.withEndpoint(mockGitHub.apiServer().baseUrl())
|
.withEndpoint(mockGitHub.apiServer().baseUrl())
|
||||||
.build();
|
.build();
|
||||||
assertThat(gitHub.lastRateLimit(), nullValue());
|
assertThat(gitHub.lastRateLimit(), sameInstance(GHRateLimit.DEFAULT));
|
||||||
assertFalse(gitHub.isCredentialValid());
|
assertFalse(gitHub.isCredentialValid());
|
||||||
// For invalid credentials, we get a 401 but it includes anonymous rate limit headers
|
// For invalid credentials, we get a 401 but it includes anonymous rate limit headers
|
||||||
assertThat(gitHub.lastRateLimit().getCore(), not(instanceOf(GHRateLimit.UnknownLimitRecord.class)));
|
assertThat(gitHub.lastRateLimit().getCore(), not(instanceOf(GHRateLimit.UnknownLimitRecord.class)));
|
||||||
@@ -118,18 +119,22 @@ public class AppTest extends AbstractGitHubWireMockTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testCredentialValidEnterprise() throws IOException {
|
public void testCredentialValidEnterprise() throws IOException {
|
||||||
// Simulated GHE: getRateLimit returns 404
|
// Simulated GHE: getRateLimit returns 404
|
||||||
assertThat(gitHub.lastRateLimit(), nullValue());
|
assertThat(gitHub.lastRateLimit(), sameInstance(GHRateLimit.DEFAULT));
|
||||||
|
assertThat(gitHub.lastRateLimit().getCore().isExpired(), is(true));
|
||||||
assertTrue(gitHub.isCredentialValid());
|
assertTrue(gitHub.isCredentialValid());
|
||||||
// lastRateLimit stays null when 404 is encountered
|
|
||||||
assertThat(gitHub.lastRateLimit(), nullValue());
|
// lastRateLimitUpdates because 404 still includes header rate limit info
|
||||||
|
assertThat(gitHub.lastRateLimit(), notNullValue());
|
||||||
|
assertThat(gitHub.lastRateLimit(), not(equalTo(GHRateLimit.DEFAULT)));
|
||||||
|
assertThat(gitHub.lastRateLimit().getCore().isExpired(), is(false));
|
||||||
|
|
||||||
gitHub = getGitHubBuilder().withOAuthToken("bogus", "user")
|
gitHub = getGitHubBuilder().withOAuthToken("bogus", "user")
|
||||||
.withEndpoint(mockGitHub.apiServer().baseUrl())
|
.withEndpoint(mockGitHub.apiServer().baseUrl())
|
||||||
.build();
|
.build();
|
||||||
assertThat(gitHub.lastRateLimit(), nullValue());
|
assertThat(gitHub.lastRateLimit(), sameInstance(GHRateLimit.DEFAULT));
|
||||||
assertFalse(gitHub.isCredentialValid());
|
assertFalse(gitHub.isCredentialValid());
|
||||||
// Simulated GHE: For invalid credentials, we get a 401 that does not include ratelimit info
|
// Simulated GHE: For invalid credentials, we get a 401 that does not include ratelimit info
|
||||||
assertThat(gitHub.lastRateLimit(), nullValue());
|
assertThat(gitHub.lastRateLimit(), sameInstance(GHRateLimit.DEFAULT));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import java.nio.charset.StandardCharsets;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
import static org.hamcrest.CoreMatchers.*;
|
||||||
|
import static org.hamcrest.Matchers.hasProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Integration test for {@link GHContent}.
|
* Integration test for {@link GHContent}.
|
||||||
@@ -170,4 +171,24 @@ public class GHContentIntegrationTest extends AbstractGitHubWireMockTest {
|
|||||||
final GHContent fileContent2 = repo.getFileContent(fileContent.getPath());
|
final GHContent fileContent2 = repo.getFileContent(fileContent.getPath());
|
||||||
assertThat(IOUtils.readLines(fileContent2.read(), StandardCharsets.UTF_8), hasItems("test"));
|
assertThat(IOUtils.readLines(fileContent2.read(), StandardCharsets.UTF_8), hasItems("test"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetFileContentWithSymlink() throws Exception {
|
||||||
|
final GHRepository repo = gitHub.getRepository("hub4j-test-org/GHContentIntegrationTest");
|
||||||
|
|
||||||
|
final GHContent fileContent = repo.getFileContent("ghcontent-ro/a-symlink-to-a-file");
|
||||||
|
// for whatever reason GH says this is a file :-o
|
||||||
|
assertThat(IOUtils.toString(fileContent.read(), StandardCharsets.UTF_8), is("thanks for reading me\n"));
|
||||||
|
|
||||||
|
final GHContent dirContent = repo.getFileContent("ghcontent-ro/a-symlink-to-a-dir");
|
||||||
|
// but symlinks to directories are symlinks!
|
||||||
|
assertThat(dirContent,
|
||||||
|
allOf(hasProperty("target", is("a-dir-with-3-entries")), hasProperty("type", is("symlink"))));
|
||||||
|
|
||||||
|
// future somehow...
|
||||||
|
|
||||||
|
// final GHContent fileContent2 = repo.getFileContent("ghcontent-ro/a-symlink-to-a-dir/entry-one");
|
||||||
|
// this needs special handling and will 404 from GitHub
|
||||||
|
// assertThat(IOUtils.toString(fileContent.read(), StandardCharsets.UTF_8), is(""));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,13 +3,15 @@ package org.kohsuke.github;
|
|||||||
import com.fasterxml.jackson.databind.exc.MismatchedInputException;
|
import com.fasterxml.jackson.databind.exc.MismatchedInputException;
|
||||||
import com.fasterxml.jackson.databind.exc.ValueInstantiationException;
|
import com.fasterxml.jackson.databind.exc.ValueInstantiationException;
|
||||||
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
|
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
|
||||||
import org.hamcrest.CoreMatchers;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import static org.hamcrest.CoreMatchers.equalTo;
|
||||||
|
import static org.hamcrest.CoreMatchers.sameInstance;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.hamcrest.core.IsInstanceOf.instanceOf;
|
import static org.hamcrest.core.IsInstanceOf.instanceOf;
|
||||||
|
|
||||||
@@ -51,13 +53,16 @@ public class GHRateLimitTest extends AbstractGitHubWireMockTest {
|
|||||||
public void testGitHubRateLimit() throws Exception {
|
public void testGitHubRateLimit() throws Exception {
|
||||||
// Customized response that templates the date to keep things working
|
// Customized response that templates the date to keep things working
|
||||||
snapshotNotAllowed();
|
snapshotNotAllowed();
|
||||||
|
GHRateLimit.UnknownLimitRecord.reset();
|
||||||
|
|
||||||
assertThat(mockGitHub.getRequestCount(), equalTo(0));
|
assertThat(mockGitHub.getRequestCount(), equalTo(0));
|
||||||
|
|
||||||
// 4897 is just the what the limit was when the snapshot was taken
|
// 4897 is just the what the limit was when the snapshot was taken
|
||||||
previousLimit = GHRateLimit.fromHeaderRecord(new GHRateLimit.Record(5000,
|
previousLimit = GHRateLimit.fromRecord(
|
||||||
4897,
|
new GHRateLimit.Record(5000,
|
||||||
(templating.testStartDate.getTime() + Duration.ofHours(1).toMillis()) / 1000L));
|
4897,
|
||||||
|
(templating.testStartDate.getTime() + Duration.ofHours(1).toMillis()) / 1000L),
|
||||||
|
RateLimitTarget.CORE);
|
||||||
|
|
||||||
// -------------------------------------------------------------
|
// -------------------------------------------------------------
|
||||||
// /user gets response with rate limit information
|
// /user gets response with rate limit information
|
||||||
@@ -76,8 +81,8 @@ public class GHRateLimitTest extends AbstractGitHubWireMockTest {
|
|||||||
// Give this a moment
|
// Give this a moment
|
||||||
Thread.sleep(1500);
|
Thread.sleep(1500);
|
||||||
|
|
||||||
// ratelimit() uses headerRateLimit if available and headerRateLimit is not expired
|
// ratelimit() uses cached rate limit if available and not expired
|
||||||
assertThat(gitHub.rateLimit(), equalTo(headerRateLimit));
|
assertThat(gitHub.rateLimit(), sameInstance(headerRateLimit));
|
||||||
|
|
||||||
assertThat(mockGitHub.getRequestCount(), equalTo(1));
|
assertThat(mockGitHub.getRequestCount(), equalTo(1));
|
||||||
|
|
||||||
@@ -88,8 +93,13 @@ public class GHRateLimitTest extends AbstractGitHubWireMockTest {
|
|||||||
rateLimit = gitHub.getRateLimit();
|
rateLimit = gitHub.getRateLimit();
|
||||||
assertThat(mockGitHub.getRequestCount(), equalTo(2));
|
assertThat(mockGitHub.getRequestCount(), equalTo(2));
|
||||||
|
|
||||||
// Because remaining and reset date are unchanged, the header should be unchanged as well
|
// Because remaining and reset date are unchanged in core, the header should be unchanged as well
|
||||||
assertThat(gitHub.lastRateLimit(), sameInstance(headerRateLimit));
|
// But the overall instance has changed because of filling in of unknown data.
|
||||||
|
assertThat(gitHub.lastRateLimit(), not(sameInstance(headerRateLimit)));
|
||||||
|
// Identical Records should be preserved even when GHRateLimit is merged
|
||||||
|
assertThat(gitHub.lastRateLimit().getCore(), sameInstance(headerRateLimit.getCore()));
|
||||||
|
assertThat(gitHub.lastRateLimit().getSearch(), not(sameInstance(headerRateLimit.getSearch())));
|
||||||
|
headerRateLimit = gitHub.lastRateLimit();
|
||||||
|
|
||||||
// rate limit request is free, remaining is unchanged
|
// rate limit request is free, remaining is unchanged
|
||||||
verifyRateLimitValues(previousLimit, previousLimit.getRemaining());
|
verifyRateLimitValues(previousLimit, previousLimit.getRemaining());
|
||||||
@@ -141,9 +151,8 @@ public class GHRateLimitTest extends AbstractGitHubWireMockTest {
|
|||||||
verifyRateLimitValues(previousLimit, previousLimit.getRemaining(), true);
|
verifyRateLimitValues(previousLimit, previousLimit.getRemaining(), true);
|
||||||
previousLimit = rateLimit;
|
previousLimit = rateLimit;
|
||||||
|
|
||||||
// When getRateLimit() succeeds, headerRateLimit updates as usual as well (if needed)
|
// When getRateLimit() succeeds, cached rate limit updates as usual as well (if needed)
|
||||||
// These are separate instances, but should be equal
|
assertThat(gitHub.rateLimit(), sameInstance(rateLimit));
|
||||||
assertThat(gitHub.rateLimit(), not(sameInstance(rateLimit)));
|
|
||||||
|
|
||||||
// Verify different record instances can be compared
|
// Verify different record instances can be compared
|
||||||
assertThat(gitHub.rateLimit().getCore(), equalTo(rateLimit.getCore()));
|
assertThat(gitHub.rateLimit().getCore(), equalTo(rateLimit.getCore()));
|
||||||
@@ -154,8 +163,43 @@ public class GHRateLimitTest extends AbstractGitHubWireMockTest {
|
|||||||
|
|
||||||
assertThat(gitHub.rateLimit(), not(sameInstance(headerRateLimit)));
|
assertThat(gitHub.rateLimit(), not(sameInstance(headerRateLimit)));
|
||||||
assertThat(gitHub.rateLimit(), sameInstance(gitHub.lastRateLimit()));
|
assertThat(gitHub.rateLimit(), sameInstance(gitHub.lastRateLimit()));
|
||||||
|
headerRateLimit = gitHub.lastRateLimit();
|
||||||
|
|
||||||
assertThat(mockGitHub.getRequestCount(), equalTo(5));
|
assertThat(mockGitHub.getRequestCount(), equalTo(5));
|
||||||
|
|
||||||
|
// Verify the requesting a search url updates the search rate limit
|
||||||
|
assertThat(gitHub.lastRateLimit().getSearch().getRemaining(), equalTo(30));
|
||||||
|
|
||||||
|
HashMap<String, Object> searchResult = (HashMap<String, Object>) gitHub.createRequest()
|
||||||
|
.rateLimit(RateLimitTarget.SEARCH)
|
||||||
|
.setRawUrlPath(mockGitHub.apiServer().baseUrl()
|
||||||
|
+ "/search/repositories?q=tetris+language%3Aassembly&sort=stars&order=desc")
|
||||||
|
.fetch(HashMap.class);
|
||||||
|
|
||||||
|
assertThat(searchResult.get("total_count"), equalTo(1918));
|
||||||
|
|
||||||
|
assertThat(mockGitHub.getRequestCount(), equalTo(6));
|
||||||
|
|
||||||
|
assertThat(gitHub.lastRateLimit(), not(sameInstance(headerRateLimit)));
|
||||||
|
assertThat(gitHub.lastRateLimit().getCore(), sameInstance(headerRateLimit.getCore()));
|
||||||
|
assertThat(gitHub.lastRateLimit().getSearch(), not(sameInstance(headerRateLimit.getSearch())));
|
||||||
|
assertThat(gitHub.lastRateLimit().getSearch().getRemaining(), equalTo(29));
|
||||||
|
|
||||||
|
PagedSearchIterable<GHRepository> searchResult2 = gitHub.searchRepositories()
|
||||||
|
.q("tetris")
|
||||||
|
.language("assembly")
|
||||||
|
.sort(GHRepositorySearchBuilder.Sort.STARS)
|
||||||
|
.order(GHDirection.DESC)
|
||||||
|
.list();
|
||||||
|
|
||||||
|
assertThat(searchResult2.getTotalCount(), equalTo(1918));
|
||||||
|
|
||||||
|
assertThat(mockGitHub.getRequestCount(), equalTo(7));
|
||||||
|
|
||||||
|
assertThat(gitHub.lastRateLimit(), not(sameInstance(headerRateLimit)));
|
||||||
|
assertThat(gitHub.lastRateLimit().getCore(), sameInstance(headerRateLimit.getCore()));
|
||||||
|
assertThat(gitHub.lastRateLimit().getSearch(), not(sameInstance(headerRateLimit.getSearch())));
|
||||||
|
assertThat(gitHub.lastRateLimit().getSearch().getRemaining(), equalTo(28));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void verifyRateLimitValues(GHRateLimit previousLimit, int remaining) {
|
private void verifyRateLimitValues(GHRateLimit previousLimit, int remaining) {
|
||||||
@@ -194,6 +238,8 @@ public class GHRateLimitTest extends AbstractGitHubWireMockTest {
|
|||||||
public void testGitHubEnterpriseDoesNotHaveRateLimit() throws Exception {
|
public void testGitHubEnterpriseDoesNotHaveRateLimit() throws Exception {
|
||||||
// Customized response that results in file not found the same as GitHub Enterprise
|
// Customized response that results in file not found the same as GitHub Enterprise
|
||||||
snapshotNotAllowed();
|
snapshotNotAllowed();
|
||||||
|
GHRateLimit.UnknownLimitRecord.reset();
|
||||||
|
|
||||||
assertThat(mockGitHub.getRequestCount(), equalTo(0));
|
assertThat(mockGitHub.getRequestCount(), equalTo(0));
|
||||||
GHRateLimit rateLimit = null;
|
GHRateLimit rateLimit = null;
|
||||||
|
|
||||||
@@ -203,13 +249,14 @@ public class GHRateLimitTest extends AbstractGitHubWireMockTest {
|
|||||||
Thread.sleep(1500);
|
Thread.sleep(1500);
|
||||||
|
|
||||||
// -------------------------------------------------------------
|
// -------------------------------------------------------------
|
||||||
// Before any queries, rate limit starts as null but may be requested
|
// Before any queries, rate limit starts as default but may be requested
|
||||||
gitHub = GitHub.connectToEnterprise(mockGitHub.apiServer().baseUrl(), "bogus", "bogus");
|
gitHub = GitHub.connectToEnterprise(mockGitHub.apiServer().baseUrl(), "bogus", "bogus");
|
||||||
assertThat(mockGitHub.getRequestCount(), equalTo(0));
|
assertThat(mockGitHub.getRequestCount(), equalTo(0));
|
||||||
|
|
||||||
assertThat(gitHub.lastRateLimit(), CoreMatchers.nullValue());
|
assertThat(gitHub.lastRateLimit(), sameInstance(GHRateLimit.DEFAULT));
|
||||||
|
|
||||||
rateLimit = gitHub.rateLimit();
|
rateLimit = gitHub.rateLimit();
|
||||||
|
assertThat(gitHub.lastRateLimit(), not(equalTo(GHRateLimit.DEFAULT)));
|
||||||
assertThat(rateLimit.getCore(), instanceOf(GHRateLimit.UnknownLimitRecord.class));
|
assertThat(rateLimit.getCore(), instanceOf(GHRateLimit.UnknownLimitRecord.class));
|
||||||
assertThat(rateLimit.getLimit(), equalTo(GHRateLimit.UnknownLimitRecord.unknownLimit));
|
assertThat(rateLimit.getLimit(), equalTo(GHRateLimit.UnknownLimitRecord.unknownLimit));
|
||||||
assertThat(rateLimit.getRemaining(), equalTo(GHRateLimit.UnknownLimitRecord.unknownRemaining));
|
assertThat(rateLimit.getRemaining(), equalTo(GHRateLimit.UnknownLimitRecord.unknownRemaining));
|
||||||
@@ -218,8 +265,8 @@ public class GHRateLimitTest extends AbstractGitHubWireMockTest {
|
|||||||
|
|
||||||
assertThat(mockGitHub.getRequestCount(), equalTo(1));
|
assertThat(mockGitHub.getRequestCount(), equalTo(1));
|
||||||
|
|
||||||
// last is still null, because it actually means lastHeaderRateLimit
|
// lastRateLimit the same as rateLimit
|
||||||
assertThat(gitHub.lastRateLimit(), CoreMatchers.nullValue());
|
assertThat(gitHub.lastRateLimit(), sameInstance(rateLimit));
|
||||||
|
|
||||||
assertThat(mockGitHub.getRequestCount(), equalTo(1));
|
assertThat(mockGitHub.getRequestCount(), equalTo(1));
|
||||||
|
|
||||||
@@ -233,13 +280,14 @@ public class GHRateLimitTest extends AbstractGitHubWireMockTest {
|
|||||||
gitHub.getMyself();
|
gitHub.getMyself();
|
||||||
assertThat(mockGitHub.getRequestCount(), equalTo(2));
|
assertThat(mockGitHub.getRequestCount(), equalTo(2));
|
||||||
|
|
||||||
assertThat(gitHub.lastRateLimit(), CoreMatchers.nullValue());
|
assertThat(gitHub.lastRateLimit(), sameInstance(GHRateLimit.DEFAULT));
|
||||||
|
|
||||||
rateLimit = gitHub.rateLimit();
|
rateLimit = gitHub.rateLimit();
|
||||||
assertThat(rateLimit.getCore(), instanceOf(GHRateLimit.UnknownLimitRecord.class));
|
assertThat(rateLimit.getCore(), instanceOf(GHRateLimit.UnknownLimitRecord.class));
|
||||||
assertThat(rateLimit.getLimit(), equalTo(GHRateLimit.UnknownLimitRecord.unknownLimit));
|
assertThat(rateLimit.getLimit(), equalTo(GHRateLimit.UnknownLimitRecord.unknownLimit));
|
||||||
assertThat(rateLimit.getRemaining(), equalTo(GHRateLimit.UnknownLimitRecord.unknownRemaining));
|
assertThat(rateLimit.getRemaining(), equalTo(GHRateLimit.UnknownLimitRecord.unknownRemaining));
|
||||||
assertThat(rateLimit.getResetDate().compareTo(lastReset), equalTo(1));
|
// Same unknown instance is reused for a while
|
||||||
|
assertThat(rateLimit.getResetDate().compareTo(lastReset), equalTo(0));
|
||||||
lastReset = rateLimit.getResetDate();
|
lastReset = rateLimit.getResetDate();
|
||||||
|
|
||||||
assertThat(mockGitHub.getRequestCount(), equalTo(3));
|
assertThat(mockGitHub.getRequestCount(), equalTo(3));
|
||||||
@@ -258,17 +306,19 @@ public class GHRateLimitTest extends AbstractGitHubWireMockTest {
|
|||||||
assertThat(rateLimit.getCore(), instanceOf(GHRateLimit.UnknownLimitRecord.class));
|
assertThat(rateLimit.getCore(), instanceOf(GHRateLimit.UnknownLimitRecord.class));
|
||||||
assertThat(rateLimit.getLimit(), equalTo(GHRateLimit.UnknownLimitRecord.unknownLimit));
|
assertThat(rateLimit.getLimit(), equalTo(GHRateLimit.UnknownLimitRecord.unknownLimit));
|
||||||
assertThat(rateLimit.getRemaining(), equalTo(GHRateLimit.UnknownLimitRecord.unknownRemaining));
|
assertThat(rateLimit.getRemaining(), equalTo(GHRateLimit.UnknownLimitRecord.unknownRemaining));
|
||||||
assertThat(rateLimit.getResetDate().compareTo(lastReset), equalTo(1));
|
// When not expired, unknowns do not replace each other so last reset remains unchanged
|
||||||
|
assertThat(rateLimit.getResetDate().compareTo(lastReset), equalTo(0));
|
||||||
|
|
||||||
// Give this a moment
|
// Give this a moment
|
||||||
Thread.sleep(1500);
|
Thread.sleep(1500);
|
||||||
|
|
||||||
// last is still null, because it actually means lastHeaderRateLimit
|
// lastRateLimit the same as rateLimit
|
||||||
assertThat(gitHub.lastRateLimit(), CoreMatchers.nullValue());
|
assertThat(gitHub.lastRateLimit(), sameInstance(rateLimit));
|
||||||
|
|
||||||
// ratelimit() tries not to make additional requests, uses queried rate limit since header not available
|
// ratelimit() tries not to make additional requests, uses queried rate limit since header not available
|
||||||
Thread.sleep(1500);
|
Thread.sleep(1500);
|
||||||
assertThat(gitHub.rateLimit(), sameInstance(rateLimit));
|
assertThat(gitHub.rateLimit(), sameInstance(rateLimit));
|
||||||
|
assertThat(mockGitHub.getRequestCount(), equalTo(4));
|
||||||
|
|
||||||
// -------------------------------------------------------------
|
// -------------------------------------------------------------
|
||||||
// Some versions of GHE include header rate limit information, some do not
|
// Some versions of GHE include header rate limit information, some do not
|
||||||
@@ -282,10 +332,12 @@ public class GHRateLimitTest extends AbstractGitHubWireMockTest {
|
|||||||
assertThat(rateLimit, notNullValue());
|
assertThat(rateLimit, notNullValue());
|
||||||
assertThat(rateLimit.getLimit(), equalTo(5000));
|
assertThat(rateLimit.getLimit(), equalTo(5000));
|
||||||
assertThat(rateLimit.getRemaining(), equalTo(4978));
|
assertThat(rateLimit.getRemaining(), equalTo(4978));
|
||||||
// The previous record was an "Unknown", so even though this records resets sooner we take it
|
assertThat(rateLimit.getResetDate().compareTo(lastReset), equalTo(1));
|
||||||
assertThat(rateLimit.getResetDate().compareTo(lastReset), equalTo(-1));
|
|
||||||
lastReset = rateLimit.getResetDate();
|
lastReset = rateLimit.getResetDate();
|
||||||
|
|
||||||
|
// When getting only header updates, the unknowns are also expired
|
||||||
|
assertThat(rateLimit.getSearch().isExpired(), is(true));
|
||||||
|
|
||||||
GHRateLimit headerRateLimit = rateLimit;
|
GHRateLimit headerRateLimit = rateLimit;
|
||||||
|
|
||||||
// Give this a moment
|
// Give this a moment
|
||||||
@@ -320,14 +372,49 @@ public class GHRateLimitTest extends AbstractGitHubWireMockTest {
|
|||||||
// getRateLimit() uses headerRateLimit if /rate_limit returns a 404
|
// getRateLimit() uses headerRateLimit if /rate_limit returns a 404
|
||||||
// and headerRateLimit is available and not expired
|
// and headerRateLimit is available and not expired
|
||||||
assertThat(rateLimit, sameInstance(gitHub.lastRateLimit()));
|
assertThat(rateLimit, sameInstance(gitHub.lastRateLimit()));
|
||||||
|
headerRateLimit = rateLimit;
|
||||||
|
|
||||||
// ratelimit() should prefer headerRateLimit when getRateLimit fails and headerRateLimit is not expired
|
// ratelimit() should prefer headerRateLimit when getRateLimit fails and headerRateLimit is not expired
|
||||||
assertThat(gitHub.rateLimit(), sameInstance(rateLimit));
|
assertThat(gitHub.rateLimit(), sameInstance(rateLimit));
|
||||||
|
|
||||||
assertThat(mockGitHub.getRequestCount(), equalTo(6));
|
assertThat(mockGitHub.getRequestCount(), equalTo(6));
|
||||||
|
|
||||||
// Wait for the header
|
// Verify the requesting a search url updates the search rate limit
|
||||||
Thread.sleep(1500);
|
// Core rate limit record should not change while search is updated.
|
||||||
|
assertThat(gitHub.lastRateLimit().getSearch(), instanceOf(GHRateLimit.UnknownLimitRecord.class));
|
||||||
|
assertThat(gitHub.lastRateLimit().getSearch().isExpired(), equalTo(true));
|
||||||
|
|
||||||
|
HashMap<String, Object> searchResult = (HashMap<String, Object>) gitHub.createRequest()
|
||||||
|
.rateLimit(RateLimitTarget.SEARCH)
|
||||||
|
.setRawUrlPath(mockGitHub.apiServer().baseUrl()
|
||||||
|
+ "/search/repositories?q=tetris+language%3Aassembly&sort=stars&order=desc")
|
||||||
|
.fetch(Object.class);
|
||||||
|
|
||||||
|
assertThat(searchResult.get("total_count"), equalTo(1918));
|
||||||
|
|
||||||
|
assertThat(mockGitHub.getRequestCount(), equalTo(7));
|
||||||
|
|
||||||
|
assertThat(gitHub.lastRateLimit(), not(sameInstance(headerRateLimit)));
|
||||||
|
assertThat(gitHub.lastRateLimit().getCore(), sameInstance(headerRateLimit.getCore()));
|
||||||
|
assertThat(gitHub.lastRateLimit().getSearch(), not(sameInstance(headerRateLimit.getSearch())));
|
||||||
|
assertThat(gitHub.lastRateLimit().getSearch().getRemaining(), equalTo(29));
|
||||||
|
|
||||||
|
PagedSearchIterable<GHRepository> searchResult2 = gitHub.searchRepositories()
|
||||||
|
.q("tetris")
|
||||||
|
.language("assembly")
|
||||||
|
.sort(GHRepositorySearchBuilder.Sort.STARS)
|
||||||
|
.order(GHDirection.DESC)
|
||||||
|
.list();
|
||||||
|
|
||||||
|
assertThat(searchResult2.getTotalCount(), equalTo(1918));
|
||||||
|
|
||||||
|
assertThat(mockGitHub.getRequestCount(), equalTo(8));
|
||||||
|
|
||||||
|
assertThat(gitHub.lastRateLimit(), not(sameInstance(headerRateLimit)));
|
||||||
|
assertThat(gitHub.lastRateLimit().getCore(), sameInstance(headerRateLimit.getCore()));
|
||||||
|
assertThat(gitHub.lastRateLimit().getSearch(), not(sameInstance(headerRateLimit.getSearch())));
|
||||||
|
assertThat(gitHub.lastRateLimit().getSearch().getRemaining(), equalTo(28));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -372,6 +459,7 @@ public class GHRateLimitTest extends AbstractGitHubWireMockTest {
|
|||||||
private void executeExpirationTest() throws Exception {
|
private void executeExpirationTest() throws Exception {
|
||||||
// Customized response that templates the date to keep things working
|
// Customized response that templates the date to keep things working
|
||||||
snapshotNotAllowed();
|
snapshotNotAllowed();
|
||||||
|
GHRateLimit.UnknownLimitRecord.reset();
|
||||||
|
|
||||||
assertThat(mockGitHub.getRequestCount(), equalTo(0));
|
assertThat(mockGitHub.getRequestCount(), equalTo(0));
|
||||||
GHRateLimit rateLimit = null;
|
GHRateLimit rateLimit = null;
|
||||||
@@ -413,15 +501,15 @@ public class GHRateLimitTest extends AbstractGitHubWireMockTest {
|
|||||||
|
|
||||||
assertThat("Header instance has expired", gitHub.lastRateLimit().isExpired(), is(true));
|
assertThat("Header instance has expired", gitHub.lastRateLimit().isExpired(), is(true));
|
||||||
|
|
||||||
assertThat("rateLimit() will ask server when header instance expires and it has not called getRateLimit() yet",
|
assertThat("rateLimit() will ask server when cached instance has expired",
|
||||||
gitHub.rateLimit(),
|
gitHub.rateLimit(),
|
||||||
not(sameInstance(rateLimit)));
|
not(sameInstance(rateLimit)));
|
||||||
|
|
||||||
assertThat("lastRateLimit() (header instance) is populated as part of internal call to getRateLimit()",
|
assertThat("lastRateLimit() is populated as part of internal call to getRateLimit()",
|
||||||
gitHub.lastRateLimit(),
|
gitHub.lastRateLimit(),
|
||||||
not(sameInstance(rateLimit)));
|
not(sameInstance(rateLimit)));
|
||||||
|
|
||||||
assertThat("After request, rateLimit() selects header instance since it has been refreshed",
|
assertThat("After request, rateLimit() selects cached since it has been refreshed",
|
||||||
gitHub.rateLimit(),
|
gitHub.rateLimit(),
|
||||||
sameInstance(gitHub.lastRateLimit()));
|
sameInstance(gitHub.lastRateLimit()));
|
||||||
|
|
||||||
@@ -429,27 +517,27 @@ public class GHRateLimitTest extends AbstractGitHubWireMockTest {
|
|||||||
|
|
||||||
assertThat(mockGitHub.getRequestCount(), equalTo(2));
|
assertThat(mockGitHub.getRequestCount(), equalTo(2));
|
||||||
|
|
||||||
// This time, rateLimit() should find an expired header record, but a valid returned record
|
// During the previous call we returned expired header info but valid returned record
|
||||||
|
// Merging means this has already been merged into a valid cached instance
|
||||||
Thread.sleep(4000);
|
Thread.sleep(4000);
|
||||||
|
|
||||||
rateLimit = gitHub.rateLimit();
|
rateLimit = gitHub.rateLimit();
|
||||||
|
|
||||||
// Using custom data to have a header instance that expires before the queried instance
|
// Using custom data to have a header instance that expires before the queried instance
|
||||||
assertThat(
|
assertThat("if valid ratelimit() uses it without asking server",
|
||||||
"if header instance expires but queried instance is valid, ratelimit() uses it without asking server",
|
|
||||||
gitHub.rateLimit(),
|
gitHub.rateLimit(),
|
||||||
not(sameInstance(gitHub.lastRateLimit())));
|
sameInstance(gitHub.lastRateLimit()));
|
||||||
|
|
||||||
assertThat("ratelimit() should almost never return a return a GHRateLimit that is already expired",
|
assertThat("ratelimit() should almost never return a return a GHRateLimit that is already expired",
|
||||||
gitHub.rateLimit().isExpired(),
|
gitHub.rateLimit().isExpired(),
|
||||||
is(false));
|
is(false));
|
||||||
|
|
||||||
assertThat("Header instance hasn't been reloaded", gitHub.lastRateLimit(), sameInstance(headerRateLimit));
|
assertThat("Cached instance hasn't been reloaded", gitHub.lastRateLimit(), sameInstance(headerRateLimit));
|
||||||
assertThat("Header instance has expired", gitHub.lastRateLimit().isExpired(), is(true));
|
assertThat("Cached instance has not expired", gitHub.lastRateLimit().isExpired(), is(false));
|
||||||
|
|
||||||
assertThat(mockGitHub.getRequestCount(), equalTo(2));
|
assertThat(mockGitHub.getRequestCount(), equalTo(2));
|
||||||
|
|
||||||
// Finally they both expire and rateLimit() should find both expired and get a new record
|
// Finally the cached instance expires and rateLimit() should get a new record
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
|
|
||||||
headerRateLimit = gitHub.rateLimit();
|
headerRateLimit = gitHub.rateLimit();
|
||||||
|
|||||||
32
src/test/java/org/kohsuke/github/GHTeamBuilderTest.java
Normal file
32
src/test/java/org/kohsuke/github/GHTeamBuilderTest.java
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
package org.kohsuke.github;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class GHTeamBuilderTest extends AbstractGitHubWireMockTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCreateChildTeam() throws IOException {
|
||||||
|
String parentTeamSlug = "dummy-team";
|
||||||
|
String childTeamSlug = "dummy-team-child";
|
||||||
|
String description = "description";
|
||||||
|
|
||||||
|
// Get the parent team
|
||||||
|
GHTeam parentTeam = gitHub.getOrganization(GITHUB_API_TEST_ORG).getTeamBySlug(parentTeamSlug);
|
||||||
|
|
||||||
|
// Create a child team, using the parent team identifier
|
||||||
|
GHTeam childTeam = gitHub.getOrganization(GITHUB_API_TEST_ORG)
|
||||||
|
.createTeam(childTeamSlug)
|
||||||
|
.description(description)
|
||||||
|
.privacy(GHTeam.Privacy.CLOSED)
|
||||||
|
.parentTeamId(parentTeam.getId())
|
||||||
|
.create();
|
||||||
|
|
||||||
|
assertEquals(description, childTeam.getDescription());
|
||||||
|
assertEquals(childTeamSlug, childTeam.getName());
|
||||||
|
assertEquals(childTeamSlug, childTeam.getSlug());
|
||||||
|
assertEquals(GHTeam.Privacy.CLOSED, childTeam.getPrivacy());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import org.junit.Test;
|
|||||||
import org.kohsuke.github.GHTeam.Privacy;
|
import org.kohsuke.github.GHTeam.Privacy;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
@@ -56,4 +57,27 @@ public class GHTeamTest extends AbstractGitHubWireMockTest {
|
|||||||
assertEquals(privacy, team.getPrivacy());
|
assertEquals(privacy, team.getPrivacy());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testFetchChildTeams() throws IOException {
|
||||||
|
String teamSlug = "dummy-team";
|
||||||
|
|
||||||
|
GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG);
|
||||||
|
GHTeam team = org.getTeamBySlug(teamSlug);
|
||||||
|
Set<GHTeam> result = team.listChildTeams().toSet();
|
||||||
|
|
||||||
|
assertEquals(1, result.size());
|
||||||
|
assertEquals("child-team-for-dummy", result.toArray(new GHTeam[]{})[0].getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testFetchEmptyChildTeams() throws IOException {
|
||||||
|
String teamSlug = "simple-team";
|
||||||
|
|
||||||
|
GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG);
|
||||||
|
GHTeam team = org.getTeamBySlug(teamSlug);
|
||||||
|
Set<GHTeam> result = team.listChildTeams().toSet();
|
||||||
|
|
||||||
|
assertEquals(0, result.size());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import java.util.Date;
|
|||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
import static org.hamcrest.CoreMatchers.*;
|
||||||
import static org.hamcrest.core.Is.is;
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit test for {@link GitHub} static helpers.
|
* Unit test for {@link GitHub} static helpers.
|
||||||
@@ -65,68 +65,137 @@ public class GitHubStaticTest extends AbstractGitHubWireMockTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testGitHubRateLimitShouldReplaceRateLimit() throws Exception {
|
public void testGitHubRateLimitShouldReplaceRateLimit() throws Exception {
|
||||||
|
|
||||||
GHRateLimit.Record unknown0 = GHRateLimit.Unknown().getCore();
|
GHRateLimit.UnknownLimitRecord.reset();
|
||||||
GHRateLimit.Record unknown1 = GHRateLimit.Unknown().getCore();
|
GHRateLimit.UnknownLimitRecord.unknownLimitResetSeconds = 5;
|
||||||
|
|
||||||
GHRateLimit.Record record0 = new GHRateLimit.Record(10, 10, 10L);
|
GHRateLimit.Record unknown0 = GHRateLimit.UnknownLimitRecord.current();
|
||||||
GHRateLimit.Record record1 = new GHRateLimit.Record(10, 9, 10L);
|
|
||||||
GHRateLimit.Record record2 = new GHRateLimit.Record(10, 2, 10L);
|
|
||||||
GHRateLimit.Record record3 = new GHRateLimit.Record(10, 10, 20L);
|
|
||||||
GHRateLimit.Record record4 = new GHRateLimit.Record(10, 5, 20L);
|
|
||||||
|
|
||||||
Thread.sleep(2000);
|
Thread.sleep(1500);
|
||||||
|
GHRateLimit.UnknownLimitRecord.reset();
|
||||||
|
GHRateLimit.UnknownLimitRecord.unknownLimitResetSeconds = 5;
|
||||||
|
|
||||||
|
// For testing, we create an new unknown.
|
||||||
|
GHRateLimit.Record unknown1 = GHRateLimit.UnknownLimitRecord.current();
|
||||||
|
|
||||||
|
assertThat("Valid unknown should not replace an existing one, regardless of created or reset time",
|
||||||
|
unknown1.currentOrUpdated(unknown0),
|
||||||
|
sameInstance(unknown1));
|
||||||
|
assertThat("Valid unknown should not replace an existing one, regardless of created or reset time",
|
||||||
|
unknown0.currentOrUpdated(unknown1),
|
||||||
|
sameInstance(unknown0));
|
||||||
|
|
||||||
|
// Sleep to make different created time
|
||||||
|
Thread.sleep(1500);
|
||||||
|
|
||||||
|
// To reduce object creation: There is only one valid Unknown record at a time.
|
||||||
|
assertThat("Unknown current should should limit the creation of new unknown records",
|
||||||
|
unknown1,
|
||||||
|
sameInstance(GHRateLimit.UnknownLimitRecord.current()));
|
||||||
|
|
||||||
|
long epochSeconds = Instant.now().getEpochSecond();
|
||||||
|
|
||||||
|
GHRateLimit.Record record0 = new GHRateLimit.Record(10, 10, epochSeconds + 10L);
|
||||||
|
GHRateLimit.Record record1 = new GHRateLimit.Record(10, 9, epochSeconds + 10L);
|
||||||
|
GHRateLimit.Record record2 = new GHRateLimit.Record(10, 2, epochSeconds + 10L);
|
||||||
|
GHRateLimit.Record record3 = new GHRateLimit.Record(10, 10, epochSeconds + 20L);
|
||||||
|
GHRateLimit.Record record4 = new GHRateLimit.Record(10, 5, epochSeconds + 20L);
|
||||||
|
GHRateLimit.Record recordExpired0 = new GHRateLimit.Record(10, 10, epochSeconds - 1L);
|
||||||
|
GHRateLimit.Record recordExpired1 = new GHRateLimit.Record(10, 10, epochSeconds + 2L);
|
||||||
|
|
||||||
|
// Sleep to make expired and different created time
|
||||||
|
Thread.sleep(4000);
|
||||||
|
|
||||||
GHRateLimit.Record recordWorst = new GHRateLimit.Record(Integer.MAX_VALUE, Integer.MAX_VALUE, Long.MIN_VALUE);
|
GHRateLimit.Record recordWorst = new GHRateLimit.Record(Integer.MAX_VALUE, Integer.MAX_VALUE, Long.MIN_VALUE);
|
||||||
GHRateLimit.Record record00 = new GHRateLimit.Record(10, 10, 10L);
|
GHRateLimit.Record record00 = new GHRateLimit.Record(10, 10, epochSeconds + 10L);
|
||||||
GHRateLimit.Record unknown2 = GHRateLimit.Unknown().getCore();
|
|
||||||
|
GHRateLimit.Record unknownExpired0 = unknown0;
|
||||||
|
GHRateLimit.Record unknownExpired1 = unknown1;
|
||||||
|
unknown0 = GHRateLimit.UnknownLimitRecord.current();
|
||||||
|
|
||||||
// Rate-limit records maybe created and returned in different orders.
|
// Rate-limit records maybe created and returned in different orders.
|
||||||
// We should update to the regular records over unknowns.
|
// We should update to the unexpired regular records over unknowns.
|
||||||
// After that, we should update to the candidate if its limit is lower or its reset is later.
|
// After that, we should update to the candidate if its limit is lower or its reset is later.
|
||||||
|
|
||||||
assertThat("Equivalent unknown should not replace", GitHubClient.shouldReplace(unknown0, unknown1), is(false));
|
assertThat("Expired unknowns should not replace another expired one, regardless of created or reset time",
|
||||||
assertThat("Equivalent unknown should not replace", GitHubClient.shouldReplace(unknown1, unknown0), is(false));
|
unknownExpired0.currentOrUpdated(unknownExpired1),
|
||||||
|
sameInstance(unknownExpired0));
|
||||||
|
assertThat("Expired unknowns should not replace another expired one, regardless of created or reset time",
|
||||||
|
unknownExpired1.currentOrUpdated(unknownExpired0),
|
||||||
|
sameInstance(unknownExpired1));
|
||||||
|
|
||||||
assertThat("Later unknown should replace earlier", GitHubClient.shouldReplace(unknown2, unknown0), is(true));
|
assertThat("Expired unknown should not be replaced by expired earlier normal record",
|
||||||
assertThat("Earlier unknown should not replace later",
|
unknownExpired0.currentOrUpdated(recordExpired0),
|
||||||
GitHubClient.shouldReplace(unknown0, unknown2),
|
sameInstance(unknownExpired0));
|
||||||
is(false));
|
assertThat("Expired normal record should not be replaced an expired earlier unknown record",
|
||||||
|
recordExpired0.currentOrUpdated(unknownExpired0),
|
||||||
|
sameInstance(recordExpired0));
|
||||||
|
|
||||||
assertThat("Worst record should replace later unknown",
|
assertThat("Expired unknown should be replaced by expired later normal record",
|
||||||
GitHubClient.shouldReplace(recordWorst, unknown1),
|
unknownExpired0.currentOrUpdated(recordExpired1),
|
||||||
is(true));
|
sameInstance(recordExpired1));
|
||||||
assertThat("Unknown should not replace worst record",
|
assertThat(
|
||||||
GitHubClient.shouldReplace(unknown1, recordWorst),
|
"Expired later normal record should not be replaced an expired unknown record, regardless of created or reset time",
|
||||||
is(false));
|
recordExpired1.currentOrUpdated(unknownExpired0),
|
||||||
|
sameInstance(recordExpired1));
|
||||||
|
|
||||||
assertThat("Earlier record should replace later worst",
|
assertThat("Valid unknown should not be replaced by an expired unknown",
|
||||||
GitHubClient.shouldReplace(record0, recordWorst),
|
unknown0.currentOrUpdated(unknownExpired0),
|
||||||
is(true));
|
sameInstance(unknown0));
|
||||||
|
assertThat("Expired unknown should be replaced by valid unknown",
|
||||||
|
unknownExpired0.currentOrUpdated(unknown0),
|
||||||
|
sameInstance(unknown0));
|
||||||
|
|
||||||
|
assertThat("Valid unknown should replace an expired normal record",
|
||||||
|
recordExpired1.currentOrUpdated(unknown0),
|
||||||
|
sameInstance(unknown0));
|
||||||
|
assertThat("Valid unknown record should not be replaced by expired normal record",
|
||||||
|
unknown0.currentOrUpdated(recordExpired1),
|
||||||
|
sameInstance(unknown0));
|
||||||
|
|
||||||
|
// In normal comparision, expiration doesn't matter
|
||||||
|
assertThat("Expired normal should not be replaced by an earlier expired one",
|
||||||
|
recordExpired1.currentOrUpdated(recordExpired0),
|
||||||
|
sameInstance(recordExpired1));
|
||||||
|
assertThat("Expired normal should be replaced by a later expired one",
|
||||||
|
recordExpired0.currentOrUpdated(recordExpired1),
|
||||||
|
sameInstance(recordExpired1));
|
||||||
|
|
||||||
|
assertThat("Later worst record should be replaced by earlier record",
|
||||||
|
recordWorst.currentOrUpdated(record0),
|
||||||
|
sameInstance(record0));
|
||||||
assertThat("Later worst record should not replace earlier",
|
assertThat("Later worst record should not replace earlier",
|
||||||
GitHubClient.shouldReplace(recordWorst, record0),
|
record0.currentOrUpdated(recordWorst),
|
||||||
is(false));
|
sameInstance(record0));
|
||||||
|
|
||||||
assertThat("Equivalent record should not replace", GitHubClient.shouldReplace(record0, record00), is(false));
|
assertThat("Equivalent record should not replace other",
|
||||||
assertThat("Equivalent record should not replace", GitHubClient.shouldReplace(record00, record0), is(false));
|
record00.currentOrUpdated(record0),
|
||||||
|
sameInstance(record00));
|
||||||
|
assertThat("Equivalent record should not replace other",
|
||||||
|
record0.currentOrUpdated(record00),
|
||||||
|
sameInstance(record0));
|
||||||
|
|
||||||
assertThat("Lower limit record should replace higher", GitHubClient.shouldReplace(record1, record0), is(true));
|
assertThat("Higher limit record should be replaced by lower",
|
||||||
assertThat("Lower limit record should replace higher", GitHubClient.shouldReplace(record2, record1), is(true));
|
record0.currentOrUpdated(record1),
|
||||||
|
sameInstance(record1));
|
||||||
|
assertThat("Higher limit record should be replaced by lower",
|
||||||
|
record1.currentOrUpdated(record2),
|
||||||
|
sameInstance(record2));
|
||||||
|
|
||||||
assertThat("Higher limit record should not replace lower",
|
assertThat("Lower limit record should not be replaced higher",
|
||||||
GitHubClient.shouldReplace(record1, record2),
|
record2.currentOrUpdated(record1),
|
||||||
is(false));
|
sameInstance(record2));
|
||||||
|
|
||||||
assertThat("Higher limit record with later reset should replace lower",
|
assertThat("Lower limit record should be replaced by higher limit record with later reset",
|
||||||
GitHubClient.shouldReplace(record3, record2),
|
record2.currentOrUpdated(record3),
|
||||||
is(true));
|
sameInstance(record3));
|
||||||
|
|
||||||
assertThat("Lower limit record with later reset should replace higher",
|
assertThat("Higher limit record should be replaced by lower limit record with later reset",
|
||||||
GitHubClient.shouldReplace(record4, record1),
|
record1.currentOrUpdated(record4),
|
||||||
is(true));
|
sameInstance(record4));
|
||||||
|
|
||||||
assertThat("Lower limit record with earlier reset should not replace higher",
|
assertThat("Higher limit record should not be replaced by lower limit record with earlier reset",
|
||||||
GitHubClient.shouldReplace(record2, record4),
|
record4.currentOrUpdated(record2),
|
||||||
is(false));
|
sameInstance(record4));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public class RateLimitCheckerTest extends AbstractGitHubWireMockTest {
|
|||||||
public void testGitHubRateLimit() throws Exception {
|
public void testGitHubRateLimit() throws Exception {
|
||||||
// Customized response that templates the date to keep things working
|
// Customized response that templates the date to keep things working
|
||||||
snapshotNotAllowed();
|
snapshotNotAllowed();
|
||||||
|
GHRateLimit.UnknownLimitRecord.reset();
|
||||||
|
|
||||||
assertThat(mockGitHub.getRequestCount(), equalTo(0));
|
assertThat(mockGitHub.getRequestCount(), equalTo(0));
|
||||||
|
|
||||||
@@ -45,7 +46,7 @@ public class RateLimitCheckerTest extends AbstractGitHubWireMockTest {
|
|||||||
.withEndpoint(mockGitHub.apiServer().baseUrl())
|
.withEndpoint(mockGitHub.apiServer().baseUrl())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertThat(gitHub.lastRateLimit(), nullValue());
|
assertThat(gitHub.lastRateLimit(), sameInstance(GHRateLimit.DEFAULT));
|
||||||
|
|
||||||
// Checks the rate limit before getting myself
|
// Checks the rate limit before getting myself
|
||||||
gitHub.getMyself();
|
gitHub.getMyself();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.kohsuke.github.junit;
|
|||||||
|
|
||||||
import com.github.tomakehurst.wiremock.WireMockServer;
|
import com.github.tomakehurst.wiremock.WireMockServer;
|
||||||
import com.github.tomakehurst.wiremock.admin.model.*;
|
import com.github.tomakehurst.wiremock.admin.model.*;
|
||||||
|
import com.github.tomakehurst.wiremock.client.CountMatchingStrategy;
|
||||||
import com.github.tomakehurst.wiremock.client.MappingBuilder;
|
import com.github.tomakehurst.wiremock.client.MappingBuilder;
|
||||||
import com.github.tomakehurst.wiremock.client.VerificationException;
|
import com.github.tomakehurst.wiremock.client.VerificationException;
|
||||||
import com.github.tomakehurst.wiremock.client.WireMock;
|
import com.github.tomakehurst.wiremock.client.WireMock;
|
||||||
@@ -221,6 +222,10 @@ public class WireMockRule implements MethodRule, TestRule, Container, Stubbing,
|
|||||||
wireMockServer.verify(count, requestPatternBuilder);
|
wireMockServer.verify(count, requestPatternBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void verify(CountMatchingStrategy countMatchingStrategy, RequestPatternBuilder requestPatternBuilder) {
|
||||||
|
wireMockServer.verify(countMatchingStrategy, requestPatternBuilder);
|
||||||
|
}
|
||||||
|
|
||||||
public List<LoggedRequest> findAll(RequestPatternBuilder requestPatternBuilder) {
|
public List<LoggedRequest> findAll(RequestPatternBuilder requestPatternBuilder) {
|
||||||
return wireMockServer.findAll(requestPatternBuilder);
|
return wireMockServer.findAll(requestPatternBuilder);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,6 +109,10 @@ public class WireMockRuleConfiguration implements Options {
|
|||||||
return parent.browserProxyingEnabled();
|
return parent.browserProxyingEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BrowserProxySettings browserProxySettings() {
|
||||||
|
return parent.browserProxySettings();
|
||||||
|
}
|
||||||
|
|
||||||
public ProxySettings proxyVia() {
|
public ProxySettings proxyVia() {
|
||||||
return parent.proxyVia();
|
return parent.proxyVia();
|
||||||
}
|
}
|
||||||
@@ -180,4 +184,8 @@ public class WireMockRuleConfiguration implements Options {
|
|||||||
public boolean getStubRequestLoggingDisabled() {
|
public boolean getStubRequestLoggingDisabled() {
|
||||||
return parent.getStubRequestLoggingDisabled();
|
return parent.getStubRequestLoggingDisabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getStubCorsEnabled() {
|
||||||
|
return parent.getStubCorsEnabled();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,305 @@
|
|||||||
|
{
|
||||||
|
"id": 40763577,
|
||||||
|
"node_id": "MDEwOlJlcG9zaXRvcnk0MDc2MzU3Nw==",
|
||||||
|
"name": "GHContentIntegrationTest",
|
||||||
|
"full_name": "hub4j-test-org/GHContentIntegrationTest",
|
||||||
|
"private": false,
|
||||||
|
"owner": {
|
||||||
|
"login": "hub4j-test-org",
|
||||||
|
"id": 7544739,
|
||||||
|
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/hub4j-test-org",
|
||||||
|
"html_url": "https://github.com/hub4j-test-org",
|
||||||
|
"followers_url": "https://api.github.com/users/hub4j-test-org/followers",
|
||||||
|
"following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/hub4j-test-org/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/hub4j-test-org/repos",
|
||||||
|
"events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/hub4j-test-org/received_events",
|
||||||
|
"type": "Organization",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest",
|
||||||
|
"description": "Repository used for integration test of github-api",
|
||||||
|
"fork": true,
|
||||||
|
"url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest",
|
||||||
|
"forks_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/forks",
|
||||||
|
"keys_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/keys{/key_id}",
|
||||||
|
"collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/collaborators{/collaborator}",
|
||||||
|
"teams_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/teams",
|
||||||
|
"hooks_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/hooks",
|
||||||
|
"issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues/events{/number}",
|
||||||
|
"events_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/events",
|
||||||
|
"assignees_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/assignees{/user}",
|
||||||
|
"branches_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/branches{/branch}",
|
||||||
|
"tags_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/tags",
|
||||||
|
"blobs_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs{/sha}",
|
||||||
|
"git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/tags{/sha}",
|
||||||
|
"git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/refs{/sha}",
|
||||||
|
"trees_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/trees{/sha}",
|
||||||
|
"statuses_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/statuses/{sha}",
|
||||||
|
"languages_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/languages",
|
||||||
|
"stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/stargazers",
|
||||||
|
"contributors_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contributors",
|
||||||
|
"subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/subscribers",
|
||||||
|
"subscription_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/subscription",
|
||||||
|
"commits_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/commits{/sha}",
|
||||||
|
"git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/commits{/sha}",
|
||||||
|
"comments_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/comments{/number}",
|
||||||
|
"issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues/comments{/number}",
|
||||||
|
"contents_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/{+path}",
|
||||||
|
"compare_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/compare/{base}...{head}",
|
||||||
|
"merges_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/merges",
|
||||||
|
"archive_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/{archive_format}{/ref}",
|
||||||
|
"downloads_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/downloads",
|
||||||
|
"issues_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues{/number}",
|
||||||
|
"pulls_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/pulls{/number}",
|
||||||
|
"milestones_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/milestones{/number}",
|
||||||
|
"notifications_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/notifications{?since,all,participating}",
|
||||||
|
"labels_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/labels{/name}",
|
||||||
|
"releases_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/releases{/id}",
|
||||||
|
"deployments_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/deployments",
|
||||||
|
"created_at": "2015-08-15T14:14:57Z",
|
||||||
|
"updated_at": "2020-07-02T15:49:49Z",
|
||||||
|
"pushed_at": "2020-07-02T15:49:47Z",
|
||||||
|
"git_url": "git://github.com/hub4j-test-org/GHContentIntegrationTest.git",
|
||||||
|
"ssh_url": "git@github.com:hub4j-test-org/GHContentIntegrationTest.git",
|
||||||
|
"clone_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest.git",
|
||||||
|
"svn_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest",
|
||||||
|
"homepage": null,
|
||||||
|
"size": 54,
|
||||||
|
"stargazers_count": 0,
|
||||||
|
"watchers_count": 0,
|
||||||
|
"language": null,
|
||||||
|
"has_issues": false,
|
||||||
|
"has_projects": true,
|
||||||
|
"has_downloads": true,
|
||||||
|
"has_wiki": true,
|
||||||
|
"has_pages": false,
|
||||||
|
"forks_count": 41,
|
||||||
|
"mirror_url": null,
|
||||||
|
"archived": false,
|
||||||
|
"disabled": false,
|
||||||
|
"open_issues_count": 0,
|
||||||
|
"license": null,
|
||||||
|
"forks": 41,
|
||||||
|
"open_issues": 0,
|
||||||
|
"watchers": 0,
|
||||||
|
"default_branch": "master",
|
||||||
|
"temp_clone_token": null,
|
||||||
|
"organization": {
|
||||||
|
"login": "hub4j-test-org",
|
||||||
|
"id": 7544739,
|
||||||
|
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/hub4j-test-org",
|
||||||
|
"html_url": "https://github.com/hub4j-test-org",
|
||||||
|
"followers_url": "https://api.github.com/users/hub4j-test-org/followers",
|
||||||
|
"following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/hub4j-test-org/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/hub4j-test-org/repos",
|
||||||
|
"events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/hub4j-test-org/received_events",
|
||||||
|
"type": "Organization",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"parent": {
|
||||||
|
"id": 19653852,
|
||||||
|
"node_id": "MDEwOlJlcG9zaXRvcnkxOTY1Mzg1Mg==",
|
||||||
|
"name": "GHContentIntegrationTest",
|
||||||
|
"full_name": "kohsuke2/GHContentIntegrationTest",
|
||||||
|
"private": false,
|
||||||
|
"owner": {
|
||||||
|
"login": "kohsuke2",
|
||||||
|
"id": 1329242,
|
||||||
|
"node_id": "MDQ6VXNlcjEzMjkyNDI=",
|
||||||
|
"avatar_url": "https://avatars2.githubusercontent.com/u/1329242?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/kohsuke2",
|
||||||
|
"html_url": "https://github.com/kohsuke2",
|
||||||
|
"followers_url": "https://api.github.com/users/kohsuke2/followers",
|
||||||
|
"following_url": "https://api.github.com/users/kohsuke2/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/kohsuke2/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/kohsuke2/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/kohsuke2/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/kohsuke2/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/kohsuke2/repos",
|
||||||
|
"events_url": "https://api.github.com/users/kohsuke2/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/kohsuke2/received_events",
|
||||||
|
"type": "User",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"html_url": "https://github.com/kohsuke2/GHContentIntegrationTest",
|
||||||
|
"description": "Repository used for integration test of github-api",
|
||||||
|
"fork": true,
|
||||||
|
"url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest",
|
||||||
|
"forks_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/forks",
|
||||||
|
"keys_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/keys{/key_id}",
|
||||||
|
"collaborators_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/collaborators{/collaborator}",
|
||||||
|
"teams_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/teams",
|
||||||
|
"hooks_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/hooks",
|
||||||
|
"issue_events_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues/events{/number}",
|
||||||
|
"events_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/events",
|
||||||
|
"assignees_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/assignees{/user}",
|
||||||
|
"branches_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/branches{/branch}",
|
||||||
|
"tags_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/tags",
|
||||||
|
"blobs_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/blobs{/sha}",
|
||||||
|
"git_tags_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/tags{/sha}",
|
||||||
|
"git_refs_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/refs{/sha}",
|
||||||
|
"trees_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/trees{/sha}",
|
||||||
|
"statuses_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/statuses/{sha}",
|
||||||
|
"languages_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/languages",
|
||||||
|
"stargazers_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/stargazers",
|
||||||
|
"contributors_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/contributors",
|
||||||
|
"subscribers_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/subscribers",
|
||||||
|
"subscription_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/subscription",
|
||||||
|
"commits_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/commits{/sha}",
|
||||||
|
"git_commits_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/commits{/sha}",
|
||||||
|
"comments_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/comments{/number}",
|
||||||
|
"issue_comment_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues/comments{/number}",
|
||||||
|
"contents_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/contents/{+path}",
|
||||||
|
"compare_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/compare/{base}...{head}",
|
||||||
|
"merges_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/merges",
|
||||||
|
"archive_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/{archive_format}{/ref}",
|
||||||
|
"downloads_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/downloads",
|
||||||
|
"issues_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues{/number}",
|
||||||
|
"pulls_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/pulls{/number}",
|
||||||
|
"milestones_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/milestones{/number}",
|
||||||
|
"notifications_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/notifications{?since,all,participating}",
|
||||||
|
"labels_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/labels{/name}",
|
||||||
|
"releases_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/releases{/id}",
|
||||||
|
"deployments_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/deployments",
|
||||||
|
"created_at": "2014-05-10T22:50:30Z",
|
||||||
|
"updated_at": "2018-11-07T15:36:19Z",
|
||||||
|
"pushed_at": "2018-11-07T15:36:18Z",
|
||||||
|
"git_url": "git://github.com/kohsuke2/GHContentIntegrationTest.git",
|
||||||
|
"ssh_url": "git@github.com:kohsuke2/GHContentIntegrationTest.git",
|
||||||
|
"clone_url": "https://github.com/kohsuke2/GHContentIntegrationTest.git",
|
||||||
|
"svn_url": "https://github.com/kohsuke2/GHContentIntegrationTest",
|
||||||
|
"homepage": null,
|
||||||
|
"size": 111,
|
||||||
|
"stargazers_count": 0,
|
||||||
|
"watchers_count": 0,
|
||||||
|
"language": null,
|
||||||
|
"has_issues": false,
|
||||||
|
"has_projects": true,
|
||||||
|
"has_downloads": true,
|
||||||
|
"has_wiki": true,
|
||||||
|
"has_pages": false,
|
||||||
|
"forks_count": 1,
|
||||||
|
"mirror_url": null,
|
||||||
|
"archived": false,
|
||||||
|
"disabled": false,
|
||||||
|
"open_issues_count": 0,
|
||||||
|
"license": null,
|
||||||
|
"forks": 1,
|
||||||
|
"open_issues": 0,
|
||||||
|
"watchers": 0,
|
||||||
|
"default_branch": "master"
|
||||||
|
},
|
||||||
|
"source": {
|
||||||
|
"id": 14779458,
|
||||||
|
"node_id": "MDEwOlJlcG9zaXRvcnkxNDc3OTQ1OA==",
|
||||||
|
"name": "github-api-test-1",
|
||||||
|
"full_name": "farmdawgnation/github-api-test-1",
|
||||||
|
"private": false,
|
||||||
|
"owner": {
|
||||||
|
"login": "farmdawgnation",
|
||||||
|
"id": 620189,
|
||||||
|
"node_id": "MDQ6VXNlcjYyMDE4OQ==",
|
||||||
|
"avatar_url": "https://avatars2.githubusercontent.com/u/620189?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/farmdawgnation",
|
||||||
|
"html_url": "https://github.com/farmdawgnation",
|
||||||
|
"followers_url": "https://api.github.com/users/farmdawgnation/followers",
|
||||||
|
"following_url": "https://api.github.com/users/farmdawgnation/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/farmdawgnation/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/farmdawgnation/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/farmdawgnation/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/farmdawgnation/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/farmdawgnation/repos",
|
||||||
|
"events_url": "https://api.github.com/users/farmdawgnation/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/farmdawgnation/received_events",
|
||||||
|
"type": "User",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"html_url": "https://github.com/farmdawgnation/github-api-test-1",
|
||||||
|
"description": "Repository used for integration test of github-api",
|
||||||
|
"fork": false,
|
||||||
|
"url": "https://api.github.com/repos/farmdawgnation/github-api-test-1",
|
||||||
|
"forks_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/forks",
|
||||||
|
"keys_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/keys{/key_id}",
|
||||||
|
"collaborators_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/collaborators{/collaborator}",
|
||||||
|
"teams_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/teams",
|
||||||
|
"hooks_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/hooks",
|
||||||
|
"issue_events_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues/events{/number}",
|
||||||
|
"events_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/events",
|
||||||
|
"assignees_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/assignees{/user}",
|
||||||
|
"branches_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/branches{/branch}",
|
||||||
|
"tags_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/tags",
|
||||||
|
"blobs_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/blobs{/sha}",
|
||||||
|
"git_tags_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/tags{/sha}",
|
||||||
|
"git_refs_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/refs{/sha}",
|
||||||
|
"trees_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/trees{/sha}",
|
||||||
|
"statuses_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/statuses/{sha}",
|
||||||
|
"languages_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/languages",
|
||||||
|
"stargazers_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/stargazers",
|
||||||
|
"contributors_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/contributors",
|
||||||
|
"subscribers_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/subscribers",
|
||||||
|
"subscription_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/subscription",
|
||||||
|
"commits_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/commits{/sha}",
|
||||||
|
"git_commits_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/commits{/sha}",
|
||||||
|
"comments_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/comments{/number}",
|
||||||
|
"issue_comment_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues/comments{/number}",
|
||||||
|
"contents_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/contents/{+path}",
|
||||||
|
"compare_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/compare/{base}...{head}",
|
||||||
|
"merges_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/merges",
|
||||||
|
"archive_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/{archive_format}{/ref}",
|
||||||
|
"downloads_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/downloads",
|
||||||
|
"issues_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues{/number}",
|
||||||
|
"pulls_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/pulls{/number}",
|
||||||
|
"milestones_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/milestones{/number}",
|
||||||
|
"notifications_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/notifications{?since,all,participating}",
|
||||||
|
"labels_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/labels{/name}",
|
||||||
|
"releases_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/releases{/id}",
|
||||||
|
"deployments_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/deployments",
|
||||||
|
"created_at": "2013-11-28T14:46:38Z",
|
||||||
|
"updated_at": "2016-02-05T13:33:23Z",
|
||||||
|
"pushed_at": "2013-11-28T14:55:36Z",
|
||||||
|
"git_url": "git://github.com/farmdawgnation/github-api-test-1.git",
|
||||||
|
"ssh_url": "git@github.com:farmdawgnation/github-api-test-1.git",
|
||||||
|
"clone_url": "https://github.com/farmdawgnation/github-api-test-1.git",
|
||||||
|
"svn_url": "https://github.com/farmdawgnation/github-api-test-1",
|
||||||
|
"homepage": null,
|
||||||
|
"size": 89,
|
||||||
|
"stargazers_count": 0,
|
||||||
|
"watchers_count": 0,
|
||||||
|
"language": null,
|
||||||
|
"has_issues": false,
|
||||||
|
"has_projects": true,
|
||||||
|
"has_downloads": true,
|
||||||
|
"has_wiki": true,
|
||||||
|
"has_pages": false,
|
||||||
|
"forks_count": 59,
|
||||||
|
"mirror_url": null,
|
||||||
|
"archived": false,
|
||||||
|
"disabled": false,
|
||||||
|
"open_issues_count": 0,
|
||||||
|
"license": null,
|
||||||
|
"forks": 59,
|
||||||
|
"open_issues": 0,
|
||||||
|
"watchers": 0,
|
||||||
|
"default_branch": "master"
|
||||||
|
},
|
||||||
|
"network_count": 59,
|
||||||
|
"subscribers_count": 0
|
||||||
|
}
|
||||||
@@ -0,0 +1,305 @@
|
|||||||
|
{
|
||||||
|
"id": 40763577,
|
||||||
|
"node_id": "MDEwOlJlcG9zaXRvcnk0MDc2MzU3Nw==",
|
||||||
|
"name": "GHContentIntegrationTest",
|
||||||
|
"full_name": "hub4j-test-org/GHContentIntegrationTest",
|
||||||
|
"private": false,
|
||||||
|
"owner": {
|
||||||
|
"login": "hub4j-test-org",
|
||||||
|
"id": 7544739,
|
||||||
|
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/hub4j-test-org",
|
||||||
|
"html_url": "https://github.com/hub4j-test-org",
|
||||||
|
"followers_url": "https://api.github.com/users/hub4j-test-org/followers",
|
||||||
|
"following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/hub4j-test-org/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/hub4j-test-org/repos",
|
||||||
|
"events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/hub4j-test-org/received_events",
|
||||||
|
"type": "Organization",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest",
|
||||||
|
"description": "Repository used for integration test of github-api",
|
||||||
|
"fork": true,
|
||||||
|
"url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest",
|
||||||
|
"forks_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/forks",
|
||||||
|
"keys_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/keys{/key_id}",
|
||||||
|
"collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/collaborators{/collaborator}",
|
||||||
|
"teams_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/teams",
|
||||||
|
"hooks_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/hooks",
|
||||||
|
"issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues/events{/number}",
|
||||||
|
"events_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/events",
|
||||||
|
"assignees_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/assignees{/user}",
|
||||||
|
"branches_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/branches{/branch}",
|
||||||
|
"tags_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/tags",
|
||||||
|
"blobs_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs{/sha}",
|
||||||
|
"git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/tags{/sha}",
|
||||||
|
"git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/refs{/sha}",
|
||||||
|
"trees_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/trees{/sha}",
|
||||||
|
"statuses_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/statuses/{sha}",
|
||||||
|
"languages_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/languages",
|
||||||
|
"stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/stargazers",
|
||||||
|
"contributors_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contributors",
|
||||||
|
"subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/subscribers",
|
||||||
|
"subscription_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/subscription",
|
||||||
|
"commits_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/commits{/sha}",
|
||||||
|
"git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/commits{/sha}",
|
||||||
|
"comments_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/comments{/number}",
|
||||||
|
"issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues/comments{/number}",
|
||||||
|
"contents_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/{+path}",
|
||||||
|
"compare_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/compare/{base}...{head}",
|
||||||
|
"merges_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/merges",
|
||||||
|
"archive_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/{archive_format}{/ref}",
|
||||||
|
"downloads_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/downloads",
|
||||||
|
"issues_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues{/number}",
|
||||||
|
"pulls_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/pulls{/number}",
|
||||||
|
"milestones_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/milestones{/number}",
|
||||||
|
"notifications_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/notifications{?since,all,participating}",
|
||||||
|
"labels_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/labels{/name}",
|
||||||
|
"releases_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/releases{/id}",
|
||||||
|
"deployments_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/deployments",
|
||||||
|
"created_at": "2015-08-15T14:14:57Z",
|
||||||
|
"updated_at": "2020-07-02T15:49:49Z",
|
||||||
|
"pushed_at": "2020-07-02T15:49:47Z",
|
||||||
|
"git_url": "git://github.com/hub4j-test-org/GHContentIntegrationTest.git",
|
||||||
|
"ssh_url": "git@github.com:hub4j-test-org/GHContentIntegrationTest.git",
|
||||||
|
"clone_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest.git",
|
||||||
|
"svn_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest",
|
||||||
|
"homepage": null,
|
||||||
|
"size": 54,
|
||||||
|
"stargazers_count": 0,
|
||||||
|
"watchers_count": 0,
|
||||||
|
"language": null,
|
||||||
|
"has_issues": false,
|
||||||
|
"has_projects": true,
|
||||||
|
"has_downloads": true,
|
||||||
|
"has_wiki": true,
|
||||||
|
"has_pages": false,
|
||||||
|
"forks_count": 41,
|
||||||
|
"mirror_url": null,
|
||||||
|
"archived": false,
|
||||||
|
"disabled": false,
|
||||||
|
"open_issues_count": 0,
|
||||||
|
"license": null,
|
||||||
|
"forks": 41,
|
||||||
|
"open_issues": 0,
|
||||||
|
"watchers": 0,
|
||||||
|
"default_branch": "master",
|
||||||
|
"temp_clone_token": null,
|
||||||
|
"organization": {
|
||||||
|
"login": "hub4j-test-org",
|
||||||
|
"id": 7544739,
|
||||||
|
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/hub4j-test-org",
|
||||||
|
"html_url": "https://github.com/hub4j-test-org",
|
||||||
|
"followers_url": "https://api.github.com/users/hub4j-test-org/followers",
|
||||||
|
"following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/hub4j-test-org/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/hub4j-test-org/repos",
|
||||||
|
"events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/hub4j-test-org/received_events",
|
||||||
|
"type": "Organization",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"parent": {
|
||||||
|
"id": 19653852,
|
||||||
|
"node_id": "MDEwOlJlcG9zaXRvcnkxOTY1Mzg1Mg==",
|
||||||
|
"name": "GHContentIntegrationTest",
|
||||||
|
"full_name": "kohsuke2/GHContentIntegrationTest",
|
||||||
|
"private": false,
|
||||||
|
"owner": {
|
||||||
|
"login": "kohsuke2",
|
||||||
|
"id": 1329242,
|
||||||
|
"node_id": "MDQ6VXNlcjEzMjkyNDI=",
|
||||||
|
"avatar_url": "https://avatars2.githubusercontent.com/u/1329242?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/kohsuke2",
|
||||||
|
"html_url": "https://github.com/kohsuke2",
|
||||||
|
"followers_url": "https://api.github.com/users/kohsuke2/followers",
|
||||||
|
"following_url": "https://api.github.com/users/kohsuke2/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/kohsuke2/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/kohsuke2/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/kohsuke2/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/kohsuke2/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/kohsuke2/repos",
|
||||||
|
"events_url": "https://api.github.com/users/kohsuke2/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/kohsuke2/received_events",
|
||||||
|
"type": "User",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"html_url": "https://github.com/kohsuke2/GHContentIntegrationTest",
|
||||||
|
"description": "Repository used for integration test of github-api",
|
||||||
|
"fork": true,
|
||||||
|
"url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest",
|
||||||
|
"forks_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/forks",
|
||||||
|
"keys_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/keys{/key_id}",
|
||||||
|
"collaborators_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/collaborators{/collaborator}",
|
||||||
|
"teams_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/teams",
|
||||||
|
"hooks_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/hooks",
|
||||||
|
"issue_events_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues/events{/number}",
|
||||||
|
"events_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/events",
|
||||||
|
"assignees_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/assignees{/user}",
|
||||||
|
"branches_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/branches{/branch}",
|
||||||
|
"tags_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/tags",
|
||||||
|
"blobs_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/blobs{/sha}",
|
||||||
|
"git_tags_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/tags{/sha}",
|
||||||
|
"git_refs_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/refs{/sha}",
|
||||||
|
"trees_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/trees{/sha}",
|
||||||
|
"statuses_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/statuses/{sha}",
|
||||||
|
"languages_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/languages",
|
||||||
|
"stargazers_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/stargazers",
|
||||||
|
"contributors_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/contributors",
|
||||||
|
"subscribers_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/subscribers",
|
||||||
|
"subscription_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/subscription",
|
||||||
|
"commits_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/commits{/sha}",
|
||||||
|
"git_commits_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/commits{/sha}",
|
||||||
|
"comments_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/comments{/number}",
|
||||||
|
"issue_comment_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues/comments{/number}",
|
||||||
|
"contents_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/contents/{+path}",
|
||||||
|
"compare_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/compare/{base}...{head}",
|
||||||
|
"merges_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/merges",
|
||||||
|
"archive_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/{archive_format}{/ref}",
|
||||||
|
"downloads_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/downloads",
|
||||||
|
"issues_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues{/number}",
|
||||||
|
"pulls_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/pulls{/number}",
|
||||||
|
"milestones_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/milestones{/number}",
|
||||||
|
"notifications_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/notifications{?since,all,participating}",
|
||||||
|
"labels_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/labels{/name}",
|
||||||
|
"releases_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/releases{/id}",
|
||||||
|
"deployments_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/deployments",
|
||||||
|
"created_at": "2014-05-10T22:50:30Z",
|
||||||
|
"updated_at": "2018-11-07T15:36:19Z",
|
||||||
|
"pushed_at": "2018-11-07T15:36:18Z",
|
||||||
|
"git_url": "git://github.com/kohsuke2/GHContentIntegrationTest.git",
|
||||||
|
"ssh_url": "git@github.com:kohsuke2/GHContentIntegrationTest.git",
|
||||||
|
"clone_url": "https://github.com/kohsuke2/GHContentIntegrationTest.git",
|
||||||
|
"svn_url": "https://github.com/kohsuke2/GHContentIntegrationTest",
|
||||||
|
"homepage": null,
|
||||||
|
"size": 111,
|
||||||
|
"stargazers_count": 0,
|
||||||
|
"watchers_count": 0,
|
||||||
|
"language": null,
|
||||||
|
"has_issues": false,
|
||||||
|
"has_projects": true,
|
||||||
|
"has_downloads": true,
|
||||||
|
"has_wiki": true,
|
||||||
|
"has_pages": false,
|
||||||
|
"forks_count": 1,
|
||||||
|
"mirror_url": null,
|
||||||
|
"archived": false,
|
||||||
|
"disabled": false,
|
||||||
|
"open_issues_count": 0,
|
||||||
|
"license": null,
|
||||||
|
"forks": 1,
|
||||||
|
"open_issues": 0,
|
||||||
|
"watchers": 0,
|
||||||
|
"default_branch": "master"
|
||||||
|
},
|
||||||
|
"source": {
|
||||||
|
"id": 14779458,
|
||||||
|
"node_id": "MDEwOlJlcG9zaXRvcnkxNDc3OTQ1OA==",
|
||||||
|
"name": "github-api-test-1",
|
||||||
|
"full_name": "farmdawgnation/github-api-test-1",
|
||||||
|
"private": false,
|
||||||
|
"owner": {
|
||||||
|
"login": "farmdawgnation",
|
||||||
|
"id": 620189,
|
||||||
|
"node_id": "MDQ6VXNlcjYyMDE4OQ==",
|
||||||
|
"avatar_url": "https://avatars2.githubusercontent.com/u/620189?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/farmdawgnation",
|
||||||
|
"html_url": "https://github.com/farmdawgnation",
|
||||||
|
"followers_url": "https://api.github.com/users/farmdawgnation/followers",
|
||||||
|
"following_url": "https://api.github.com/users/farmdawgnation/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/farmdawgnation/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/farmdawgnation/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/farmdawgnation/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/farmdawgnation/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/farmdawgnation/repos",
|
||||||
|
"events_url": "https://api.github.com/users/farmdawgnation/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/farmdawgnation/received_events",
|
||||||
|
"type": "User",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"html_url": "https://github.com/farmdawgnation/github-api-test-1",
|
||||||
|
"description": "Repository used for integration test of github-api",
|
||||||
|
"fork": false,
|
||||||
|
"url": "https://api.github.com/repos/farmdawgnation/github-api-test-1",
|
||||||
|
"forks_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/forks",
|
||||||
|
"keys_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/keys{/key_id}",
|
||||||
|
"collaborators_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/collaborators{/collaborator}",
|
||||||
|
"teams_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/teams",
|
||||||
|
"hooks_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/hooks",
|
||||||
|
"issue_events_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues/events{/number}",
|
||||||
|
"events_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/events",
|
||||||
|
"assignees_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/assignees{/user}",
|
||||||
|
"branches_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/branches{/branch}",
|
||||||
|
"tags_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/tags",
|
||||||
|
"blobs_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/blobs{/sha}",
|
||||||
|
"git_tags_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/tags{/sha}",
|
||||||
|
"git_refs_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/refs{/sha}",
|
||||||
|
"trees_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/trees{/sha}",
|
||||||
|
"statuses_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/statuses/{sha}",
|
||||||
|
"languages_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/languages",
|
||||||
|
"stargazers_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/stargazers",
|
||||||
|
"contributors_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/contributors",
|
||||||
|
"subscribers_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/subscribers",
|
||||||
|
"subscription_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/subscription",
|
||||||
|
"commits_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/commits{/sha}",
|
||||||
|
"git_commits_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/commits{/sha}",
|
||||||
|
"comments_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/comments{/number}",
|
||||||
|
"issue_comment_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues/comments{/number}",
|
||||||
|
"contents_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/contents/{+path}",
|
||||||
|
"compare_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/compare/{base}...{head}",
|
||||||
|
"merges_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/merges",
|
||||||
|
"archive_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/{archive_format}{/ref}",
|
||||||
|
"downloads_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/downloads",
|
||||||
|
"issues_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues{/number}",
|
||||||
|
"pulls_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/pulls{/number}",
|
||||||
|
"milestones_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/milestones{/number}",
|
||||||
|
"notifications_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/notifications{?since,all,participating}",
|
||||||
|
"labels_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/labels{/name}",
|
||||||
|
"releases_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/releases{/id}",
|
||||||
|
"deployments_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/deployments",
|
||||||
|
"created_at": "2013-11-28T14:46:38Z",
|
||||||
|
"updated_at": "2016-02-05T13:33:23Z",
|
||||||
|
"pushed_at": "2013-11-28T14:55:36Z",
|
||||||
|
"git_url": "git://github.com/farmdawgnation/github-api-test-1.git",
|
||||||
|
"ssh_url": "git@github.com:farmdawgnation/github-api-test-1.git",
|
||||||
|
"clone_url": "https://github.com/farmdawgnation/github-api-test-1.git",
|
||||||
|
"svn_url": "https://github.com/farmdawgnation/github-api-test-1",
|
||||||
|
"homepage": null,
|
||||||
|
"size": 89,
|
||||||
|
"stargazers_count": 0,
|
||||||
|
"watchers_count": 0,
|
||||||
|
"language": null,
|
||||||
|
"has_issues": false,
|
||||||
|
"has_projects": true,
|
||||||
|
"has_downloads": true,
|
||||||
|
"has_wiki": true,
|
||||||
|
"has_pages": false,
|
||||||
|
"forks_count": 59,
|
||||||
|
"mirror_url": null,
|
||||||
|
"archived": false,
|
||||||
|
"disabled": false,
|
||||||
|
"open_issues_count": 0,
|
||||||
|
"license": null,
|
||||||
|
"forks": 59,
|
||||||
|
"open_issues": 0,
|
||||||
|
"watchers": 0,
|
||||||
|
"default_branch": "master"
|
||||||
|
},
|
||||||
|
"network_count": 59,
|
||||||
|
"subscribers_count": 0
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "a-symlink-to-a-dir",
|
||||||
|
"path": "ghcontent-ro/a-symlink-to-a-dir",
|
||||||
|
"sha": "fba4aa592c12413933e5583d5ac0bdfd3ed4eb73",
|
||||||
|
"size": 20,
|
||||||
|
"url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-symlink-to-a-dir?ref=master",
|
||||||
|
"html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest/blob/master/ghcontent-ro/a-symlink-to-a-dir",
|
||||||
|
"git_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs/fba4aa592c12413933e5583d5ac0bdfd3ed4eb73",
|
||||||
|
"download_url": "https://raw.githubusercontent.com/hub4j-test-org/GHContentIntegrationTest/master/ghcontent-ro/a-symlink-to-a-dir",
|
||||||
|
"type": "symlink",
|
||||||
|
"target": "a-dir-with-3-entries",
|
||||||
|
"_links": {
|
||||||
|
"self": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-symlink-to-a-dir?ref=master",
|
||||||
|
"git": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs/fba4aa592c12413933e5583d5ac0bdfd3ed4eb73",
|
||||||
|
"html": "https://github.com/hub4j-test-org/GHContentIntegrationTest/blob/master/ghcontent-ro/a-symlink-to-a-dir"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"name": "a-symlink-to-a-file",
|
||||||
|
"path": "ghcontent-ro/a-symlink-to-a-file",
|
||||||
|
"sha": "dbb84a81d2b1b5eb4077c9b72b7497eb16ed9bf6",
|
||||||
|
"size": 22,
|
||||||
|
"url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-symlink-to-a-file?ref=master",
|
||||||
|
"html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest/blob/master/ghcontent-ro/a-symlink-to-a-file",
|
||||||
|
"git_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs/dbb84a81d2b1b5eb4077c9b72b7497eb16ed9bf6",
|
||||||
|
"download_url": "https://raw.githubusercontent.com/hub4j-test-org/GHContentIntegrationTest/master/ghcontent-ro/a-symlink-to-a-file",
|
||||||
|
"type": "file",
|
||||||
|
"content": "dGhhbmtzIGZvciByZWFkaW5nIG1lCg==\n",
|
||||||
|
"encoding": "base64",
|
||||||
|
"_links": {
|
||||||
|
"self": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-symlink-to-a-file?ref=master",
|
||||||
|
"git": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs/dbb84a81d2b1b5eb4077c9b72b7497eb16ed9bf6",
|
||||||
|
"html": "https://github.com/hub4j-test-org/GHContentIntegrationTest/blob/master/ghcontent-ro/a-symlink-to-a-file"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
"id": "054974d2-b150-4d00-9027-c3ad6bbaf023",
|
||||||
|
"name": "repos_hub4j-test-org_ghcontentintegrationtest",
|
||||||
|
"request": {
|
||||||
|
"url": "/repos/hub4j-test-org/GHContentIntegrationTest",
|
||||||
|
"method": "GET",
|
||||||
|
"headers": {
|
||||||
|
"Accept": {
|
||||||
|
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"status": 200,
|
||||||
|
"bodyFileName": "repos_hub4j-test-org_ghcontentintegrationtest-054974d2-b150-4d00-9027-c3ad6bbaf023.json",
|
||||||
|
"headers": {
|
||||||
|
"server": "GitHub.com",
|
||||||
|
"date": "Thu, 02 Jul 2020 16:17:31 GMT",
|
||||||
|
"content-type": "application/json; charset=utf-8",
|
||||||
|
"status": "200 OK",
|
||||||
|
"cache-control": "public, max-age=60, s-maxage=60",
|
||||||
|
"vary": "Accept, Accept-Encoding, Accept, X-Requested-With",
|
||||||
|
"etag": "W/\"8c4b9f7c7b3214f5bd336bb7b8053c36\"",
|
||||||
|
"last-modified": "Thu, 02 Jul 2020 15:49:49 GMT",
|
||||||
|
"x-github-media-type": "unknown, github.v3",
|
||||||
|
"strict-transport-security": "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"x-frame-options": "deny",
|
||||||
|
"x-content-type-options": "nosniff",
|
||||||
|
"x-xss-protection": "1; mode=block",
|
||||||
|
"referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"content-security-policy": "default-src 'none'",
|
||||||
|
"X-Ratelimit-Limit": "60",
|
||||||
|
"X-Ratelimit-Remaining": "47",
|
||||||
|
"X-Ratelimit-Reset": "1593708014",
|
||||||
|
"Accept-Ranges": "bytes",
|
||||||
|
"X-GitHub-Request-Id": "EF84:24F2:A8B982:1A6F1B3:5EFE089B"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "054974d2-b150-4d00-9027-c3ad6bbaf023",
|
||||||
|
"persistent": true,
|
||||||
|
"scenarioName": "scenario-1-repos-hub4j-test-org-GHContentIntegrationTest",
|
||||||
|
"requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHContentIntegrationTest-2",
|
||||||
|
"insertionIndex": 2
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"id": "81f3af1c-4fb1-4e3b-baa0-c682510d1137",
|
||||||
|
"name": "repos_hub4j-test-org_ghcontentintegrationtest",
|
||||||
|
"request": {
|
||||||
|
"url": "/repos/hub4j-test-org/GHContentIntegrationTest",
|
||||||
|
"method": "GET",
|
||||||
|
"headers": {
|
||||||
|
"Accept": {
|
||||||
|
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"status": 200,
|
||||||
|
"bodyFileName": "repos_hub4j-test-org_ghcontentintegrationtest-81f3af1c-4fb1-4e3b-baa0-c682510d1137.json",
|
||||||
|
"headers": {
|
||||||
|
"server": "GitHub.com",
|
||||||
|
"date": "Thu, 02 Jul 2020 16:17:31 GMT",
|
||||||
|
"content-type": "application/json; charset=utf-8",
|
||||||
|
"status": "200 OK",
|
||||||
|
"cache-control": "public, max-age=60, s-maxage=60",
|
||||||
|
"vary": "Accept, Accept-Encoding, Accept, X-Requested-With",
|
||||||
|
"etag": "W/\"8c4b9f7c7b3214f5bd336bb7b8053c36\"",
|
||||||
|
"last-modified": "Thu, 02 Jul 2020 15:49:49 GMT",
|
||||||
|
"x-github-media-type": "unknown, github.v3",
|
||||||
|
"strict-transport-security": "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"x-frame-options": "deny",
|
||||||
|
"x-content-type-options": "nosniff",
|
||||||
|
"x-xss-protection": "1; mode=block",
|
||||||
|
"referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"content-security-policy": "default-src 'none'",
|
||||||
|
"X-Ratelimit-Limit": "60",
|
||||||
|
"X-Ratelimit-Remaining": "48",
|
||||||
|
"X-Ratelimit-Reset": "1593708014",
|
||||||
|
"Accept-Ranges": "bytes",
|
||||||
|
"X-GitHub-Request-Id": "EF84:24F2:A8B94F:1A6F198:5EFE089A"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "81f3af1c-4fb1-4e3b-baa0-c682510d1137",
|
||||||
|
"persistent": true,
|
||||||
|
"scenarioName": "scenario-1-repos-hub4j-test-org-GHContentIntegrationTest",
|
||||||
|
"requiredScenarioState": "Started",
|
||||||
|
"newScenarioState": "scenario-1-repos-hub4j-test-org-GHContentIntegrationTest-2",
|
||||||
|
"insertionIndex": 1
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"id": "1baf6207-f25f-4064-af9b-8eb1cb1fe125",
|
||||||
|
"name": "repos_hub4j-test-org_ghcontentintegrationtest_contents_ghcontent-ro_a-symlink-to-a-dir",
|
||||||
|
"request": {
|
||||||
|
"url": "/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-symlink-to-a-dir",
|
||||||
|
"method": "GET",
|
||||||
|
"headers": {
|
||||||
|
"Accept": {
|
||||||
|
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"status": 200,
|
||||||
|
"bodyFileName": "repos_hub4j-test-org_ghcontentintegrationtest_contents_ghcontent-ro_a-symlink-to-a-dir-4.json",
|
||||||
|
"headers": {
|
||||||
|
"server": "GitHub.com",
|
||||||
|
"date": "Thu, 02 Jul 2020 16:17:32 GMT",
|
||||||
|
"content-type": "application/json; charset=utf-8",
|
||||||
|
"status": "200 OK",
|
||||||
|
"cache-control": "public, max-age=60, s-maxage=60",
|
||||||
|
"vary": "Accept, Accept-Encoding, Accept, X-Requested-With",
|
||||||
|
"etag": "W/\"fba4aa592c12413933e5583d5ac0bdfd3ed4eb73\"",
|
||||||
|
"last-modified": "Thu, 02 Jul 2020 15:49:45 GMT",
|
||||||
|
"x-github-media-type": "unknown, github.v3",
|
||||||
|
"strict-transport-security": "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"x-frame-options": "deny",
|
||||||
|
"x-content-type-options": "nosniff",
|
||||||
|
"x-xss-protection": "1; mode=block",
|
||||||
|
"referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"content-security-policy": "default-src 'none'",
|
||||||
|
"X-Ratelimit-Limit": "60",
|
||||||
|
"X-Ratelimit-Remaining": "45",
|
||||||
|
"X-Ratelimit-Reset": "1593708014",
|
||||||
|
"Accept-Ranges": "bytes",
|
||||||
|
"X-GitHub-Request-Id": "EF84:24F2:A8B9A5:1A6F235:5EFE089B"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "1baf6207-f25f-4064-af9b-8eb1cb1fe125",
|
||||||
|
"persistent": true,
|
||||||
|
"insertionIndex": 4
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"id": "ed777707-b13d-4d06-885f-529154318f3b",
|
||||||
|
"name": "repos_hub4j-test-org_ghcontentintegrationtest_contents_ghcontent-ro_a-symlink-to-a-file",
|
||||||
|
"request": {
|
||||||
|
"url": "/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-symlink-to-a-file",
|
||||||
|
"method": "GET",
|
||||||
|
"headers": {
|
||||||
|
"Accept": {
|
||||||
|
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"status": 200,
|
||||||
|
"bodyFileName": "repos_hub4j-test-org_ghcontentintegrationtest_contents_ghcontent-ro_a-symlink-to-a-file-3.json",
|
||||||
|
"headers": {
|
||||||
|
"server": "GitHub.com",
|
||||||
|
"date": "Thu, 02 Jul 2020 16:17:31 GMT",
|
||||||
|
"content-type": "application/json; charset=utf-8",
|
||||||
|
"status": "200 OK",
|
||||||
|
"cache-control": "public, max-age=60, s-maxage=60",
|
||||||
|
"vary": "Accept, Accept-Encoding, Accept, X-Requested-With",
|
||||||
|
"etag": "W/\"dbb84a81d2b1b5eb4077c9b72b7497eb16ed9bf6\"",
|
||||||
|
"last-modified": "Thu, 02 Jul 2020 15:49:45 GMT",
|
||||||
|
"x-github-media-type": "unknown, github.v3",
|
||||||
|
"strict-transport-security": "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"x-frame-options": "deny",
|
||||||
|
"x-content-type-options": "nosniff",
|
||||||
|
"x-xss-protection": "1; mode=block",
|
||||||
|
"referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"content-security-policy": "default-src 'none'",
|
||||||
|
"X-Ratelimit-Limit": "60",
|
||||||
|
"X-Ratelimit-Remaining": "46",
|
||||||
|
"X-Ratelimit-Reset": "1593708014",
|
||||||
|
"Accept-Ranges": "bytes",
|
||||||
|
"X-GitHub-Request-Id": "EF84:24F2:A8B991:1A6F20E:5EFE089B"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "ed777707-b13d-4d06-885f-529154318f3b",
|
||||||
|
"persistent": true,
|
||||||
|
"insertionIndex": 3
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"id" : "7b5cb47c-4ce5-4a04-9ef3-caeb2533d99b",
|
||||||
|
"name" : "search_repositories",
|
||||||
|
"request" : {
|
||||||
|
"url" : "/search/repositories?q=tetris+language%3Aassembly&sort=stars&order=desc",
|
||||||
|
"method" : "GET",
|
||||||
|
"headers" : {
|
||||||
|
"Accept" : {
|
||||||
|
"equalTo" : "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response" : {
|
||||||
|
"status" : 200,
|
||||||
|
"bodyFileName" : "search_repositories-6.json",
|
||||||
|
"headers" : {
|
||||||
|
"Date" : "{{now timezone='GMT' format='EEE, dd MMM yyyy HH:mm:ss z'}}",
|
||||||
|
"Content-Type" : "application/json; charset=utf-8",
|
||||||
|
"Server" : "GitHub.com",
|
||||||
|
"Status" : "200 OK",
|
||||||
|
"X-RateLimit-Limit" : "30",
|
||||||
|
"X-RateLimit-Remaining" : "29",
|
||||||
|
"X-RateLimit-Reset" : "{{testStartDate offset='2 minutes' format='unix'}}",
|
||||||
|
"Cache-Control" : "no-cache",
|
||||||
|
"X-OAuth-Scopes" : "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion",
|
||||||
|
"X-Accepted-OAuth-Scopes" : "",
|
||||||
|
"X-GitHub-Media-Type" : "unknown, github.v3",
|
||||||
|
"Strict-Transport-Security" : "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"X-Frame-Options" : "deny",
|
||||||
|
"X-Content-Type-Options" : "nosniff",
|
||||||
|
"X-XSS-Protection" : "1; mode=block",
|
||||||
|
"Referrer-Policy" : "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"Content-Security-Policy" : "default-src 'none'",
|
||||||
|
"Vary" : [ "Accept-Encoding, Accept, X-Requested-With", "Accept-Encoding" ],
|
||||||
|
"X-GitHub-Request-Id" : "D3E6:7BBB:7F46D5:985A70:5ECDA4F2",
|
||||||
|
"Link" : "<http://localhost:54240/search/repositories?q=tetris+language%3Aassembly&sort=stars&order=desc&page=2>; rel=\"next\", <http://localhost:54240/search/repositories?q=tetris+language%3Aassembly&sort=stars&order=desc&page=34>; rel=\"last\""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid" : "7b5cb47c-4ce5-4a04-9ef3-caeb2533d99b",
|
||||||
|
"persistent" : true,
|
||||||
|
"scenarioName": "scenario-1-search",
|
||||||
|
"requiredScenarioState": "Started",
|
||||||
|
"newScenarioState": "scenario-1-search-2",
|
||||||
|
"insertionIndex" : 6
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"id" : "7b5cb47c-4ce5-4a04-9ef3-caeb2533d99c",
|
||||||
|
"name" : "search_repositories",
|
||||||
|
"request" : {
|
||||||
|
"url" : "/search/repositories?sort=stars&order=desc&q=tetris+language%3Aassembly",
|
||||||
|
"method" : "GET",
|
||||||
|
"headers" : {
|
||||||
|
"Accept" : {
|
||||||
|
"equalTo" : "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response" : {
|
||||||
|
"status" : 200,
|
||||||
|
"bodyFileName" : "search_repositories-6.json",
|
||||||
|
"headers" : {
|
||||||
|
"Date" : "{{now timezone='GMT' format='EEE, dd MMM yyyy HH:mm:ss z'}}",
|
||||||
|
"Content-Type" : "application/json; charset=utf-8",
|
||||||
|
"Server" : "GitHub.com",
|
||||||
|
"Status" : "200 OK",
|
||||||
|
"X-RateLimit-Limit" : "30",
|
||||||
|
"X-RateLimit-Remaining" : "28",
|
||||||
|
"X-RateLimit-Reset" : "{{testStartDate offset='2 minutes' format='unix'}}",
|
||||||
|
"Cache-Control" : "no-cache",
|
||||||
|
"X-OAuth-Scopes" : "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion",
|
||||||
|
"X-Accepted-OAuth-Scopes" : "",
|
||||||
|
"X-GitHub-Media-Type" : "unknown, github.v3",
|
||||||
|
"Strict-Transport-Security" : "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"X-Frame-Options" : "deny",
|
||||||
|
"X-Content-Type-Options" : "nosniff",
|
||||||
|
"X-XSS-Protection" : "1; mode=block",
|
||||||
|
"Referrer-Policy" : "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"Content-Security-Policy" : "default-src 'none'",
|
||||||
|
"Vary" : [ "Accept-Encoding, Accept, X-Requested-With", "Accept-Encoding" ],
|
||||||
|
"X-GitHub-Request-Id" : "D3E6:7BBB:7F46D5:985A70:5ECDA4F2",
|
||||||
|
"Link" : "<http://localhost:54240/search/repositories?q=tetris+language%3Aassembly&sort=stars&order=desc&page=2>; rel=\"next\", <http://localhost:54240/search/repositories?q=tetris+language%3Aassembly&sort=stars&order=desc&page=34>; rel=\"last\""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid" : "7b5cb47c-4ce5-4a04-9ef3-caeb2533d99c",
|
||||||
|
"persistent" : true,
|
||||||
|
"scenarioName": "scenario-1-search",
|
||||||
|
"requiredScenarioState": "scenario-1-search-2",
|
||||||
|
"newScenarioState": "scenario-1-search-3",
|
||||||
|
"insertionIndex" : 7
|
||||||
|
}
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
"search": {
|
"search": {
|
||||||
"limit": 30,
|
"limit": 30,
|
||||||
"remaining": 30,
|
"remaining": 30,
|
||||||
"reset": {{testStartDate offset='1 hours' format='unix'}}
|
"reset": {{testStartDate offset='2 minutes' format='unix'}}
|
||||||
},
|
},
|
||||||
"graphql": {
|
"graphql": {
|
||||||
"limit": 5000,
|
"limit": 5000,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"search": {
|
"search": {
|
||||||
"limit": 30,
|
"limit": 30,
|
||||||
"remaining": 30,
|
"remaining": 30,
|
||||||
"reset": {{testStartDate offset='1 hours' format='unix'}}
|
"reset": {{testStartDate offset='2 minutes' format='unix'}}
|
||||||
},
|
},
|
||||||
"graphql": {
|
"graphql": {
|
||||||
"limit": 5000,
|
"limit": 5000,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"search": {
|
"search": {
|
||||||
"limit": 30,
|
"limit": 30,
|
||||||
"remaining": 30,
|
"remaining": 30,
|
||||||
"reset": {{testStartDate offset='1 hours' format='unix'}}
|
"reset": {{testStartDate offset='2 minutes' format='unix'}}
|
||||||
},
|
},
|
||||||
"graphql": {
|
"graphql": {
|
||||||
"limit": 5000,
|
"limit": 5000,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"id" : "7b5cb47c-4ce5-4a04-9ef3-caeb2533d99b",
|
||||||
|
"name" : "search_repositories",
|
||||||
|
"request" : {
|
||||||
|
"url" : "/search/repositories?q=tetris+language%3Aassembly&sort=stars&order=desc",
|
||||||
|
"method" : "GET",
|
||||||
|
"headers" : {
|
||||||
|
"Accept" : {
|
||||||
|
"equalTo" : "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response" : {
|
||||||
|
"status" : 200,
|
||||||
|
"bodyFileName" : "search_repositories-6.json",
|
||||||
|
"headers" : {
|
||||||
|
"Date" : "{{now timezone='GMT' format='EEE, dd MMM yyyy HH:mm:ss z'}}",
|
||||||
|
"Content-Type" : "application/json; charset=utf-8",
|
||||||
|
"Server" : "GitHub.com",
|
||||||
|
"Status" : "200 OK",
|
||||||
|
"X-RateLimit-Limit" : "30",
|
||||||
|
"X-RateLimit-Remaining" : "29",
|
||||||
|
"X-RateLimit-Reset" : "{{testStartDate offset='2 minutes' format='unix'}}",
|
||||||
|
"Cache-Control" : "no-cache",
|
||||||
|
"X-OAuth-Scopes" : "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion",
|
||||||
|
"X-Accepted-OAuth-Scopes" : "",
|
||||||
|
"X-GitHub-Media-Type" : "unknown, github.v3",
|
||||||
|
"Strict-Transport-Security" : "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"X-Frame-Options" : "deny",
|
||||||
|
"X-Content-Type-Options" : "nosniff",
|
||||||
|
"X-XSS-Protection" : "1; mode=block",
|
||||||
|
"Referrer-Policy" : "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"Content-Security-Policy" : "default-src 'none'",
|
||||||
|
"Vary" : [ "Accept-Encoding, Accept, X-Requested-With", "Accept-Encoding" ],
|
||||||
|
"X-GitHub-Request-Id" : "D3E6:7BBB:7F46D5:985A70:5ECDA4F2",
|
||||||
|
"Link" : "<http://localhost:54240/search/repositories?q=tetris+language%3Aassembly&sort=stars&order=desc&page=2>; rel=\"next\", <http://localhost:54240/search/repositories?q=tetris+language%3Aassembly&sort=stars&order=desc&page=34>; rel=\"last\""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid" : "7b5cb47c-4ce5-4a04-9ef3-caeb2533d99b",
|
||||||
|
"persistent" : true,
|
||||||
|
"scenarioName": "scenario-1-search",
|
||||||
|
"requiredScenarioState": "Started",
|
||||||
|
"newScenarioState": "scenario-1-search-2",
|
||||||
|
"insertionIndex" : 6
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"id" : "7b5cb47c-4ce5-4a04-9ef3-caeb2533d99c",
|
||||||
|
"name" : "search_repositories",
|
||||||
|
"request" : {
|
||||||
|
"url" : "/search/repositories?sort=stars&order=desc&q=tetris+language%3Aassembly",
|
||||||
|
"method" : "GET",
|
||||||
|
"headers" : {
|
||||||
|
"Accept" : {
|
||||||
|
"equalTo" : "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response" : {
|
||||||
|
"status" : 200,
|
||||||
|
"bodyFileName" : "search_repositories-6.json",
|
||||||
|
"headers" : {
|
||||||
|
"Date" : "{{now timezone='GMT' format='EEE, dd MMM yyyy HH:mm:ss z'}}",
|
||||||
|
"Content-Type" : "application/json; charset=utf-8",
|
||||||
|
"Server" : "GitHub.com",
|
||||||
|
"Status" : "200 OK",
|
||||||
|
"X-RateLimit-Limit" : "30",
|
||||||
|
"X-RateLimit-Remaining" : "28",
|
||||||
|
"X-RateLimit-Reset" : "{{testStartDate offset='2 minutes' format='unix'}}",
|
||||||
|
"Cache-Control" : "no-cache",
|
||||||
|
"X-OAuth-Scopes" : "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion",
|
||||||
|
"X-Accepted-OAuth-Scopes" : "",
|
||||||
|
"X-GitHub-Media-Type" : "unknown, github.v3",
|
||||||
|
"Strict-Transport-Security" : "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"X-Frame-Options" : "deny",
|
||||||
|
"X-Content-Type-Options" : "nosniff",
|
||||||
|
"X-XSS-Protection" : "1; mode=block",
|
||||||
|
"Referrer-Policy" : "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"Content-Security-Policy" : "default-src 'none'",
|
||||||
|
"Vary" : [ "Accept-Encoding, Accept, X-Requested-With", "Accept-Encoding" ],
|
||||||
|
"X-GitHub-Request-Id" : "D3E6:7BBB:7F46D5:985A70:5ECDA4F2",
|
||||||
|
"Link" : "<http://localhost:54240/search/repositories?q=tetris+language%3Aassembly&sort=stars&order=desc&page=2>; rel=\"next\", <http://localhost:54240/search/repositories?q=tetris+language%3Aassembly&sort=stars&order=desc&page=34>; rel=\"last\""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid" : "7b5cb47c-4ce5-4a04-9ef3-caeb2533d99c",
|
||||||
|
"persistent" : true,
|
||||||
|
"scenarioName": "scenario-1-search",
|
||||||
|
"requiredScenarioState": "scenario-1-search-2",
|
||||||
|
"newScenarioState": "scenario-1-search-3",
|
||||||
|
"insertionIndex" : 7
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"login": "hub4j-test-org",
|
||||||
|
"id": 7544739,
|
||||||
|
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
|
||||||
|
"url": "https://api.github.com/orgs/hub4j-test-org",
|
||||||
|
"repos_url": "https://api.github.com/orgs/hub4j-test-org/repos",
|
||||||
|
"events_url": "https://api.github.com/orgs/hub4j-test-org/events",
|
||||||
|
"hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks",
|
||||||
|
"issues_url": "https://api.github.com/orgs/hub4j-test-org/issues",
|
||||||
|
"members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}",
|
||||||
|
"public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4",
|
||||||
|
"description": null,
|
||||||
|
"is_verified": false,
|
||||||
|
"has_organization_projects": true,
|
||||||
|
"has_repository_projects": true,
|
||||||
|
"public_repos": 26,
|
||||||
|
"public_gists": 0,
|
||||||
|
"followers": 0,
|
||||||
|
"following": 0,
|
||||||
|
"html_url": "https://github.com/hub4j-test-org",
|
||||||
|
"created_at": "2014-05-10T19:39:11Z",
|
||||||
|
"updated_at": "2015-04-20T00:42:30Z",
|
||||||
|
"type": "Organization",
|
||||||
|
"total_private_repos": 0,
|
||||||
|
"owned_private_repos": 0,
|
||||||
|
"private_gists": 0,
|
||||||
|
"disk_usage": 147,
|
||||||
|
"collaborators": 0,
|
||||||
|
"billing_email": "kk@kohsuke.org",
|
||||||
|
"default_repository_permission": "none",
|
||||||
|
"members_can_create_repositories": false,
|
||||||
|
"two_factor_requirement_enabled": false,
|
||||||
|
"plan": {
|
||||||
|
"name": "free",
|
||||||
|
"space": 976562499,
|
||||||
|
"private_repos": 0,
|
||||||
|
"filled_seats": 13,
|
||||||
|
"seats": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
{
|
||||||
|
"name": "dummy-team-child",
|
||||||
|
"id": 3906416,
|
||||||
|
"node_id": "MDQ6VGVhbTM5MDE2NjQ=",
|
||||||
|
"slug": "dummy-team-child",
|
||||||
|
"description": "description",
|
||||||
|
"privacy": "closed",
|
||||||
|
"url": "https://api.github.com/organizations/7544739/team/3906416",
|
||||||
|
"html_url": "https://github.com/orgs/hub4j-test-org/teams/remove-me-team",
|
||||||
|
"members_url": "https://api.github.com/organizations/7544739/team/3906416/members{/member}",
|
||||||
|
"repositories_url": "https://api.github.com/organizations/7544739/team/3906416/repos",
|
||||||
|
"permission": "admin",
|
||||||
|
"parent": {
|
||||||
|
"name": "dummy-team",
|
||||||
|
"id": 3451996,
|
||||||
|
"node_id": "MDQ6VGVhbTM0NTE5OTY=",
|
||||||
|
"slug": "dummy-team",
|
||||||
|
"description": "Updated by API TestModified",
|
||||||
|
"privacy": "secret",
|
||||||
|
"url": "https://api.github.com/organizations/7544739/team/3451996",
|
||||||
|
"html_url": "https://github.com/orgs/hub4j-test-org/teams/dummy-team",
|
||||||
|
"members_url": "https://api.github.com/organizations/7544739/team/3451996/members{/member}",
|
||||||
|
"repositories_url": "https://api.github.com/organizations/7544739/team/3451996/repos",
|
||||||
|
"permission": "pull"
|
||||||
|
},
|
||||||
|
"created_at": "2020-06-18T08:11:37Z",
|
||||||
|
"updated_at": "2020-06-18T08:11:37Z",
|
||||||
|
"members_count": 1,
|
||||||
|
"repos_count": 0,
|
||||||
|
"organization": {
|
||||||
|
"login": "hub4j-test-org",
|
||||||
|
"id": 7544739,
|
||||||
|
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
|
||||||
|
"url": "https://api.github.com/orgs/hub4j-test-org",
|
||||||
|
"repos_url": "https://api.github.com/orgs/hub4j-test-org/repos",
|
||||||
|
"events_url": "https://api.github.com/orgs/hub4j-test-org/events",
|
||||||
|
"hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks",
|
||||||
|
"issues_url": "https://api.github.com/orgs/hub4j-test-org/issues",
|
||||||
|
"members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}",
|
||||||
|
"public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4",
|
||||||
|
"description": null,
|
||||||
|
"is_verified": false,
|
||||||
|
"has_organization_projects": true,
|
||||||
|
"has_repository_projects": true,
|
||||||
|
"public_repos": 26,
|
||||||
|
"public_gists": 0,
|
||||||
|
"followers": 0,
|
||||||
|
"following": 0,
|
||||||
|
"html_url": "https://github.com/hub4j-test-org",
|
||||||
|
"created_at": "2014-05-10T19:39:11Z",
|
||||||
|
"updated_at": "2015-04-20T00:42:30Z",
|
||||||
|
"type": "Organization"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"name": "dummy-team",
|
||||||
|
"id": 3451996,
|
||||||
|
"node_id": "MDQ6VGVhbTM0NTE5OTY=",
|
||||||
|
"slug": "dummy-team",
|
||||||
|
"description": "Updated by API TestModified",
|
||||||
|
"privacy": "secret",
|
||||||
|
"url": "https://api.github.com/organizations/7544739/team/3451996",
|
||||||
|
"html_url": "https://github.com/orgs/hub4j-test-org/teams/dummy-team",
|
||||||
|
"members_url": "https://api.github.com/organizations/7544739/team/3451996/members{/member}",
|
||||||
|
"repositories_url": "https://api.github.com/organizations/7544739/team/3451996/repos",
|
||||||
|
"permission": "pull",
|
||||||
|
"created_at": "2019-10-03T21:46:12Z",
|
||||||
|
"updated_at": "2020-03-17T09:06:57Z",
|
||||||
|
"members_count": 1,
|
||||||
|
"repos_count": 1,
|
||||||
|
"organization": {
|
||||||
|
"login": "hub4j-test-org",
|
||||||
|
"id": 7544739,
|
||||||
|
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
|
||||||
|
"url": "https://api.github.com/orgs/hub4j-test-org",
|
||||||
|
"repos_url": "https://api.github.com/orgs/hub4j-test-org/repos",
|
||||||
|
"events_url": "https://api.github.com/orgs/hub4j-test-org/events",
|
||||||
|
"hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks",
|
||||||
|
"issues_url": "https://api.github.com/orgs/hub4j-test-org/issues",
|
||||||
|
"members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}",
|
||||||
|
"public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4",
|
||||||
|
"description": null,
|
||||||
|
"is_verified": false,
|
||||||
|
"has_organization_projects": true,
|
||||||
|
"has_repository_projects": true,
|
||||||
|
"public_repos": 26,
|
||||||
|
"public_gists": 0,
|
||||||
|
"followers": 0,
|
||||||
|
"following": 0,
|
||||||
|
"html_url": "https://github.com/hub4j-test-org",
|
||||||
|
"created_at": "2014-05-10T19:39:11Z",
|
||||||
|
"updated_at": "2015-04-20T00:42:30Z",
|
||||||
|
"type": "Organization"
|
||||||
|
},
|
||||||
|
"parent": null
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"id": "3211dfd0-5228-4cdc-aea3-ab67437f3fd4",
|
||||||
|
"name": "orgs_hub4j-test-org",
|
||||||
|
"request": {
|
||||||
|
"url": "/orgs/hub4j-test-org",
|
||||||
|
"method": "GET",
|
||||||
|
"headers": {
|
||||||
|
"Accept": {
|
||||||
|
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"status": 200,
|
||||||
|
"bodyFileName": "orgs_hub4j-test-org-2.json",
|
||||||
|
"headers": {
|
||||||
|
"Date": "Tue, 17 Mar 2020 09:12:21 GMT",
|
||||||
|
"Content-Type": "application/json; charset=utf-8",
|
||||||
|
"Server": "GitHub.com",
|
||||||
|
"Status": "200 OK",
|
||||||
|
"X-RateLimit-Limit": "5000",
|
||||||
|
"X-RateLimit-Remaining": "4445",
|
||||||
|
"X-RateLimit-Reset": "1584436621",
|
||||||
|
"Cache-Control": "private, max-age=60, s-maxage=60",
|
||||||
|
"Vary": [
|
||||||
|
"Accept, Authorization, Cookie, X-GitHub-OTP",
|
||||||
|
"Accept-Encoding, Accept, X-Requested-With"
|
||||||
|
],
|
||||||
|
"ETag": "W/\"9d4203e09aeffc9b5325c2a5355275b5\"",
|
||||||
|
"Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT",
|
||||||
|
"X-OAuth-Scopes": "admin:org, admin:public_key, admin:repo_hook, notifications, repo, user",
|
||||||
|
"X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org",
|
||||||
|
"X-GitHub-Media-Type": "unknown, github.v3",
|
||||||
|
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"X-Frame-Options": "deny",
|
||||||
|
"X-Content-Type-Options": "nosniff",
|
||||||
|
"X-XSS-Protection": "1; mode=block",
|
||||||
|
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"Content-Security-Policy": "default-src 'none'",
|
||||||
|
"X-GitHub-Request-Id": "F8C7:46E1:A3A21:151ED4:5E709474"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "3211dfd0-5228-4cdc-aea3-ab67437f3fd4",
|
||||||
|
"persistent": true,
|
||||||
|
"insertionIndex": 2
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"id": "96dd9244-d773-4393-b9da-27ac4fef9643",
|
||||||
|
"name": "orgs_hub4j-test-org_teams",
|
||||||
|
"request": {
|
||||||
|
"url": "/orgs/hub4j-test-org/teams",
|
||||||
|
"method": "POST",
|
||||||
|
"headers": {
|
||||||
|
"Accept": {
|
||||||
|
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bodyPatterns": [
|
||||||
|
{
|
||||||
|
"equalToJson": "{\n \"parent_team_id\": 3451996,\n \"name\": \"dummy-team-child\",\n \"description\": \"description\",\n \"privacy\": \"closed\"\n}",
|
||||||
|
"ignoreArrayOrder": true,
|
||||||
|
"ignoreExtraElements": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"status": 201,
|
||||||
|
"bodyFileName": "orgs_hub4j-test-org_teams-4.json",
|
||||||
|
"headers": {
|
||||||
|
"Date": "Thu, 18 Jun 2020 07:59:20 GMT",
|
||||||
|
"Content-Type": "application/json; charset=utf-8",
|
||||||
|
"Server": "GitHub.com",
|
||||||
|
"Status": "201 Created",
|
||||||
|
"X-RateLimit-Limit": "5000",
|
||||||
|
"X-RateLimit-Remaining": "4000",
|
||||||
|
"X-RateLimit-Reset": "1592470759",
|
||||||
|
"X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages",
|
||||||
|
"X-Accepted-OAuth-Scopes": "admin:org, repo",
|
||||||
|
"X-GitHub-Media-Type": "unknown, github.v3",
|
||||||
|
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"X-Frame-Options": "deny",
|
||||||
|
"X-Content-Type-Options": "nosniff",
|
||||||
|
"X-XSS-Protection": "1; mode=block",
|
||||||
|
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"Content-Security-Policy": "default-src 'none'",
|
||||||
|
"Vary": "Accept-Encoding, Accept, X-Requested-With",
|
||||||
|
"X-GitHub-Request-Id": "C8BA:37155:255562A:5EFB1ED7:2CCF111"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "96dd9244-d773-4393-b9da-27ac4fef9643",
|
||||||
|
"persistent": true,
|
||||||
|
"insertionIndex": 4
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
"id": "b239719e-8610-449b-91bd-a35f4cc00424",
|
||||||
|
"name": "orgs_hub4j-test-org_teams_dummy-team",
|
||||||
|
"request": {
|
||||||
|
"url": "/orgs/hub4j-test-org/teams/dummy-team",
|
||||||
|
"method": "GET",
|
||||||
|
"headers": {
|
||||||
|
"Accept": {
|
||||||
|
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"status": 200,
|
||||||
|
"bodyFileName": "orgs_hub4j-test-org_teams_dummy-team-3.json",
|
||||||
|
"headers": {
|
||||||
|
"Date": "Tue, 17 Mar 2020 09:12:22 GMT",
|
||||||
|
"Content-Type": "application/json; charset=utf-8",
|
||||||
|
"Server": "GitHub.com",
|
||||||
|
"Status": "200 OK",
|
||||||
|
"X-RateLimit-Limit": "5000",
|
||||||
|
"X-RateLimit-Remaining": "4444",
|
||||||
|
"X-RateLimit-Reset": "1584436622",
|
||||||
|
"Cache-Control": "private, max-age=60, s-maxage=60",
|
||||||
|
"Vary": [
|
||||||
|
"Accept, Authorization, Cookie, X-GitHub-OTP",
|
||||||
|
"Accept-Encoding, Accept, X-Requested-With"
|
||||||
|
],
|
||||||
|
"ETag": "W/\"a3be19ac98441e2833990a01948c5bbd\"",
|
||||||
|
"Last-Modified": "Tue, 17 Mar 2020 09:06:57 GMT",
|
||||||
|
"X-OAuth-Scopes": "admin:org, admin:public_key, admin:repo_hook, notifications, repo, user",
|
||||||
|
"X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org",
|
||||||
|
"X-GitHub-Media-Type": "unknown, github.v3",
|
||||||
|
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"X-Frame-Options": "deny",
|
||||||
|
"X-Content-Type-Options": "nosniff",
|
||||||
|
"X-XSS-Protection": "1; mode=block",
|
||||||
|
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"Content-Security-Policy": "default-src 'none'",
|
||||||
|
"X-GitHub-Request-Id": "F8C7:46E1:A3A28:151EF6:5E709475"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "b239719e-8610-449b-91bd-a35f4cc00424",
|
||||||
|
"persistent": true,
|
||||||
|
"scenarioName": "scenario-1-orgs-hub4j-test-org-teams-dummy-team",
|
||||||
|
"requiredScenarioState": "Started",
|
||||||
|
"newScenarioState": "scenario-1-orgs-hub4j-test-org-teams-dummy-team-2",
|
||||||
|
"insertionIndex": 3
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"login": "hub4j-test-org",
|
||||||
|
"id": 7544739,
|
||||||
|
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
|
||||||
|
"url": "https://api.github.com/orgs/hub4j-test-org",
|
||||||
|
"repos_url": "https://api.github.com/orgs/hub4j-test-org/repos",
|
||||||
|
"events_url": "https://api.github.com/orgs/hub4j-test-org/events",
|
||||||
|
"hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks",
|
||||||
|
"issues_url": "https://api.github.com/orgs/hub4j-test-org/issues",
|
||||||
|
"members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}",
|
||||||
|
"public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4",
|
||||||
|
"description": "Hub4j Test Org Description (this could be null or blank too)",
|
||||||
|
"name": "Hub4j Test Org Name (this could be null or blank too)",
|
||||||
|
"company": null,
|
||||||
|
"blog": "https://hub4j.url.io/could/be/null",
|
||||||
|
"location": "Hub4j Test Org Location (this could be null or blank too)",
|
||||||
|
"email": "hub4jtestorgemail@could.be.null.com",
|
||||||
|
"twitter_username": null,
|
||||||
|
"is_verified": false,
|
||||||
|
"has_organization_projects": true,
|
||||||
|
"has_repository_projects": true,
|
||||||
|
"public_repos": 12,
|
||||||
|
"public_gists": 0,
|
||||||
|
"followers": 0,
|
||||||
|
"following": 0,
|
||||||
|
"html_url": "https://github.com/hub4j-test-org",
|
||||||
|
"created_at": "2014-05-10T19:39:11Z",
|
||||||
|
"updated_at": "2020-06-04T05:56:10Z",
|
||||||
|
"type": "Organization",
|
||||||
|
"total_private_repos": 0,
|
||||||
|
"owned_private_repos": 0,
|
||||||
|
"private_gists": null,
|
||||||
|
"disk_usage": null,
|
||||||
|
"collaborators": null,
|
||||||
|
"billing_email": null,
|
||||||
|
"default_repository_permission": null,
|
||||||
|
"members_can_create_repositories": false,
|
||||||
|
"two_factor_requirement_enabled": null,
|
||||||
|
"plan": {
|
||||||
|
"name": "free",
|
||||||
|
"space": 976562499,
|
||||||
|
"private_repos": 10000,
|
||||||
|
"filled_seats": 19,
|
||||||
|
"seats": 3
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
"name": "dummy-team",
|
||||||
|
"id": 3451996,
|
||||||
|
"node_id": "MDQ6VGVhbTM0NTE5OTY=",
|
||||||
|
"slug": "dummy-team",
|
||||||
|
"description": "Updated by API TestModified",
|
||||||
|
"privacy": "closed",
|
||||||
|
"url": "https://api.github.com/organizations/7544739/team/3451996",
|
||||||
|
"html_url": "https://github.com/orgs/hub4j-test-org/teams/dummy-team",
|
||||||
|
"members_url": "https://api.github.com/organizations/7544739/team/3451996/members{/member}",
|
||||||
|
"repositories_url": "https://api.github.com/organizations/7544739/team/3451996/repos",
|
||||||
|
"permission": "pull",
|
||||||
|
"created_at": "2019-10-03T21:46:12Z",
|
||||||
|
"updated_at": "2020-06-02T19:31:50Z",
|
||||||
|
"members_count": 2,
|
||||||
|
"repos_count": 1,
|
||||||
|
"organization": {
|
||||||
|
"login": "hub4j-test-org",
|
||||||
|
"id": 7544739,
|
||||||
|
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
|
||||||
|
"url": "https://api.github.com/orgs/hub4j-test-org",
|
||||||
|
"repos_url": "https://api.github.com/orgs/hub4j-test-org/repos",
|
||||||
|
"events_url": "https://api.github.com/orgs/hub4j-test-org/events",
|
||||||
|
"hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks",
|
||||||
|
"issues_url": "https://api.github.com/orgs/hub4j-test-org/issues",
|
||||||
|
"members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}",
|
||||||
|
"public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4",
|
||||||
|
"description": "Hub4j Test Org Description (this could be null or blank too)",
|
||||||
|
"name": "Hub4j Test Org Name (this could be null or blank too)",
|
||||||
|
"company": null,
|
||||||
|
"blog": "https://hub4j.url.io/could/be/null",
|
||||||
|
"location": "Hub4j Test Org Location (this could be null or blank too)",
|
||||||
|
"email": "hub4jtestorgemail@could.be.null.com",
|
||||||
|
"twitter_username": null,
|
||||||
|
"is_verified": false,
|
||||||
|
"has_organization_projects": true,
|
||||||
|
"has_repository_projects": true,
|
||||||
|
"public_repos": 12,
|
||||||
|
"public_gists": 0,
|
||||||
|
"followers": 0,
|
||||||
|
"following": 0,
|
||||||
|
"html_url": "https://github.com/hub4j-test-org",
|
||||||
|
"created_at": "2014-05-10T19:39:11Z",
|
||||||
|
"updated_at": "2020-06-04T05:56:10Z",
|
||||||
|
"type": "Organization"
|
||||||
|
},
|
||||||
|
"parent": null
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "child-team-for-dummy",
|
||||||
|
"id": 3903497,
|
||||||
|
"node_id": "MDQ6VGVhbTM5MDM0OTc=",
|
||||||
|
"slug": "child-team-for-dummy",
|
||||||
|
"description": "to test the fetching of child teams",
|
||||||
|
"privacy": "closed",
|
||||||
|
"url": "https://api.github.com/organizations/7544739/team/3903497",
|
||||||
|
"html_url": "https://github.com/orgs/hub4j-test-org/teams/child-team-for-dummy",
|
||||||
|
"members_url": "https://api.github.com/organizations/7544739/team/3903497/members{/member}",
|
||||||
|
"repositories_url": "https://api.github.com/organizations/7544739/team/3903497/repos",
|
||||||
|
"permission": "pull",
|
||||||
|
"parent": {
|
||||||
|
"name": "dummy-team",
|
||||||
|
"id": 3451996,
|
||||||
|
"node_id": "MDQ6VGVhbTM0NTE5OTY=",
|
||||||
|
"slug": "dummy-team",
|
||||||
|
"description": "Updated by API TestModified",
|
||||||
|
"privacy": "closed",
|
||||||
|
"url": "https://api.github.com/organizations/7544739/team/3451996",
|
||||||
|
"html_url": "https://github.com/orgs/hub4j-test-org/teams/dummy-team",
|
||||||
|
"members_url": "https://api.github.com/organizations/7544739/team/3451996/members{/member}",
|
||||||
|
"repositories_url": "https://api.github.com/organizations/7544739/team/3451996/repos",
|
||||||
|
"permission": "pull"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"login": "alexanderkjall",
|
||||||
|
"id": 647710,
|
||||||
|
"node_id": "MDQ6VXNlcjY0NzcxMA==",
|
||||||
|
"avatar_url": "https://avatars2.githubusercontent.com/u/647710?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/alexanderkjall",
|
||||||
|
"html_url": "https://github.com/alexanderkjall",
|
||||||
|
"followers_url": "https://api.github.com/users/alexanderkjall/followers",
|
||||||
|
"following_url": "https://api.github.com/users/alexanderkjall/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/alexanderkjall/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/alexanderkjall/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/alexanderkjall/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/alexanderkjall/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/alexanderkjall/repos",
|
||||||
|
"events_url": "https://api.github.com/users/alexanderkjall/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/alexanderkjall/received_events",
|
||||||
|
"type": "User",
|
||||||
|
"site_admin": false,
|
||||||
|
"name": "Alexander Kjäll",
|
||||||
|
"company": "DI",
|
||||||
|
"blog": "",
|
||||||
|
"location": "Oslo",
|
||||||
|
"email": "alexander.kjall@gmail.com",
|
||||||
|
"hireable": null,
|
||||||
|
"bio": null,
|
||||||
|
"twitter_username": null,
|
||||||
|
"public_repos": 56,
|
||||||
|
"public_gists": 6,
|
||||||
|
"followers": 10,
|
||||||
|
"following": 7,
|
||||||
|
"created_at": "2011-03-02T20:31:15Z",
|
||||||
|
"updated_at": "2020-06-19T06:10:45Z",
|
||||||
|
"private_gists": 1,
|
||||||
|
"total_private_repos": 1,
|
||||||
|
"owned_private_repos": 1,
|
||||||
|
"disk_usage": 46941,
|
||||||
|
"collaborators": 0,
|
||||||
|
"two_factor_authentication": true,
|
||||||
|
"plan": {
|
||||||
|
"name": "free",
|
||||||
|
"space": 976562499,
|
||||||
|
"collaborators": 0,
|
||||||
|
"private_repos": 10000
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"id": "4d3be7ef-fe05-4739-9138-d2050a55a479",
|
||||||
|
"name": "orgs_hub4j-test-org",
|
||||||
|
"request": {
|
||||||
|
"url": "/orgs/hub4j-test-org",
|
||||||
|
"method": "GET",
|
||||||
|
"headers": {
|
||||||
|
"Accept": {
|
||||||
|
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"status": 200,
|
||||||
|
"bodyFileName": "orgs_hub4j-test-org-2.json",
|
||||||
|
"headers": {
|
||||||
|
"Date": "Fri, 19 Jun 2020 06:25:15 GMT",
|
||||||
|
"Content-Type": "application/json; charset=utf-8",
|
||||||
|
"Server": "GitHub.com",
|
||||||
|
"Status": "200 OK",
|
||||||
|
"X-RateLimit-Limit": "5000",
|
||||||
|
"X-RateLimit-Remaining": "4983",
|
||||||
|
"X-RateLimit-Reset": "1592551194",
|
||||||
|
"Cache-Control": "private, max-age=60, s-maxage=60",
|
||||||
|
"Vary": [
|
||||||
|
"Accept, Authorization, Cookie, X-GitHub-OTP",
|
||||||
|
"Accept-Encoding, Accept, X-Requested-With",
|
||||||
|
"Accept-Encoding"
|
||||||
|
],
|
||||||
|
"ETag": "W/\"1cf57cb32512ca7f96e2d9133ecbb8e4\"",
|
||||||
|
"Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT",
|
||||||
|
"X-OAuth-Scopes": "read:discussion, read:enterprise, read:gpg_key, read:org, read:packages, read:public_key, read:repo_hook, read:user",
|
||||||
|
"X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org",
|
||||||
|
"X-GitHub-Media-Type": "unknown, github.v3",
|
||||||
|
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"X-Frame-Options": "deny",
|
||||||
|
"X-Content-Type-Options": "nosniff",
|
||||||
|
"X-XSS-Protection": "1; mode=block",
|
||||||
|
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"Content-Security-Policy": "default-src 'none'",
|
||||||
|
"X-GitHub-Request-Id": "3A75:36154:6E3961D:844DC9F:5EEC5A4A"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "4d3be7ef-fe05-4739-9138-d2050a55a479",
|
||||||
|
"persistent": true,
|
||||||
|
"insertionIndex": 2
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"id": "7f56b474-35c0-4a6b-82d6-2ebbd5a88725",
|
||||||
|
"name": "orgs_hub4j-test-org_teams_dummy-team",
|
||||||
|
"request": {
|
||||||
|
"url": "/orgs/hub4j-test-org/teams/dummy-team",
|
||||||
|
"method": "GET",
|
||||||
|
"headers": {
|
||||||
|
"Accept": {
|
||||||
|
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"status": 200,
|
||||||
|
"bodyFileName": "orgs_hub4j-test-org_teams_dummy-team-3.json",
|
||||||
|
"headers": {
|
||||||
|
"Date": "Fri, 19 Jun 2020 06:25:15 GMT",
|
||||||
|
"Content-Type": "application/json; charset=utf-8",
|
||||||
|
"Server": "GitHub.com",
|
||||||
|
"Status": "200 OK",
|
||||||
|
"X-RateLimit-Limit": "5000",
|
||||||
|
"X-RateLimit-Remaining": "4982",
|
||||||
|
"X-RateLimit-Reset": "1592551193",
|
||||||
|
"Cache-Control": "private, max-age=60, s-maxage=60",
|
||||||
|
"Vary": [
|
||||||
|
"Accept, Authorization, Cookie, X-GitHub-OTP",
|
||||||
|
"Accept-Encoding, Accept, X-Requested-With",
|
||||||
|
"Accept-Encoding"
|
||||||
|
],
|
||||||
|
"ETag": "W/\"df4f58bfeba1d4c5945b3dcd4e9579f9\"",
|
||||||
|
"Last-Modified": "Tue, 02 Jun 2020 19:31:50 GMT",
|
||||||
|
"X-OAuth-Scopes": "read:discussion, read:enterprise, read:gpg_key, read:org, read:packages, read:public_key, read:repo_hook, read:user",
|
||||||
|
"X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org",
|
||||||
|
"X-GitHub-Media-Type": "unknown, github.v3",
|
||||||
|
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"X-Frame-Options": "deny",
|
||||||
|
"X-Content-Type-Options": "nosniff",
|
||||||
|
"X-XSS-Protection": "1; mode=block",
|
||||||
|
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"Content-Security-Policy": "default-src 'none'",
|
||||||
|
"X-GitHub-Request-Id": "3A75:36154:6E3968D:844DE58:5EEC5A4B"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "7f56b474-35c0-4a6b-82d6-2ebbd5a88725",
|
||||||
|
"persistent": true,
|
||||||
|
"insertionIndex": 3
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
"id": "c29c8c17-2529-4266-933e-2fba6569b235",
|
||||||
|
"name": "teams_3451996_teams",
|
||||||
|
"request": {
|
||||||
|
"url": "/teams/3451996/teams",
|
||||||
|
"method": "GET",
|
||||||
|
"headers": {
|
||||||
|
"Accept": {
|
||||||
|
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"status": 200,
|
||||||
|
"bodyFileName": "teams_3451996_teams-4.json",
|
||||||
|
"headers": {
|
||||||
|
"Date": "Fri, 19 Jun 2020 06:25:16 GMT",
|
||||||
|
"Content-Type": "application/json; charset=utf-8",
|
||||||
|
"Server": "GitHub.com",
|
||||||
|
"Status": "200 OK",
|
||||||
|
"X-RateLimit-Limit": "5000",
|
||||||
|
"X-RateLimit-Remaining": "4981",
|
||||||
|
"X-RateLimit-Reset": "1592551194",
|
||||||
|
"Cache-Control": "private, max-age=60, s-maxage=60",
|
||||||
|
"Vary": [
|
||||||
|
"Accept, Authorization, Cookie, X-GitHub-OTP",
|
||||||
|
"Accept-Encoding, Accept, X-Requested-With",
|
||||||
|
"Accept-Encoding"
|
||||||
|
],
|
||||||
|
"ETag": "W/\"0c83b6a8518d93d48b0d72413e32e65b\"",
|
||||||
|
"X-OAuth-Scopes": "read:discussion, read:enterprise, read:gpg_key, read:org, read:packages, read:public_key, read:repo_hook, read:user",
|
||||||
|
"X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org",
|
||||||
|
"X-GitHub-Media-Type": "unknown, github.v3",
|
||||||
|
"Deprecation": "Sat, 01 Feb 2020 00:00:00 GMT",
|
||||||
|
"Sunset": "Mon, 01 Feb 2021 00:00:00 GMT",
|
||||||
|
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"X-Frame-Options": "deny",
|
||||||
|
"X-Content-Type-Options": "nosniff",
|
||||||
|
"X-XSS-Protection": "1; mode=block",
|
||||||
|
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"Content-Security-Policy": "default-src 'none'",
|
||||||
|
"X-GitHub-Request-Id": "3A75:36154:6E396FD:844DEDD:5EEC5A4B",
|
||||||
|
"Link": "<https://developer.github.com/changes/2020-01-21-moving-the-team-api-endpoints/>; rel=\"deprecation\"; type=\"text/html\", <https://api.github.com/organizations/7544739/team/3451996/teams>; rel=\"alternate\""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "c29c8c17-2529-4266-933e-2fba6569b235",
|
||||||
|
"persistent": true,
|
||||||
|
"insertionIndex": 4
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"id": "f995e14b-7512-443c-8eca-d623b67e63f9",
|
||||||
|
"name": "user",
|
||||||
|
"request": {
|
||||||
|
"url": "/user",
|
||||||
|
"method": "GET",
|
||||||
|
"headers": {
|
||||||
|
"Accept": {
|
||||||
|
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"status": 200,
|
||||||
|
"bodyFileName": "user-1.json",
|
||||||
|
"headers": {
|
||||||
|
"Date": "Fri, 19 Jun 2020 06:25:14 GMT",
|
||||||
|
"Content-Type": "application/json; charset=utf-8",
|
||||||
|
"Server": "GitHub.com",
|
||||||
|
"Status": "200 OK",
|
||||||
|
"X-RateLimit-Limit": "5000",
|
||||||
|
"X-RateLimit-Remaining": "4985",
|
||||||
|
"X-RateLimit-Reset": "1592551193",
|
||||||
|
"Cache-Control": "private, max-age=60, s-maxage=60",
|
||||||
|
"Vary": [
|
||||||
|
"Accept, Authorization, Cookie, X-GitHub-OTP",
|
||||||
|
"Accept-Encoding, Accept, X-Requested-With",
|
||||||
|
"Accept-Encoding"
|
||||||
|
],
|
||||||
|
"ETag": "W/\"89ff4a8b6ccfac0c1ba328a1c063ea1f\"",
|
||||||
|
"Last-Modified": "Fri, 19 Jun 2020 06:10:45 GMT",
|
||||||
|
"X-OAuth-Scopes": "read:discussion, read:enterprise, read:gpg_key, read:org, read:packages, read:public_key, read:repo_hook, read:user",
|
||||||
|
"X-Accepted-OAuth-Scopes": "",
|
||||||
|
"X-GitHub-Media-Type": "unknown, github.v3",
|
||||||
|
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"X-Frame-Options": "deny",
|
||||||
|
"X-Content-Type-Options": "nosniff",
|
||||||
|
"X-XSS-Protection": "1; mode=block",
|
||||||
|
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"Content-Security-Policy": "default-src 'none'",
|
||||||
|
"X-GitHub-Request-Id": "3A75:36154:6E394AB:844DC3B:5EEC5A4A"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "f995e14b-7512-443c-8eca-d623b67e63f9",
|
||||||
|
"persistent": true,
|
||||||
|
"insertionIndex": 1
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"login": "hub4j-test-org",
|
||||||
|
"id": 7544739,
|
||||||
|
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
|
||||||
|
"url": "https://api.github.com/orgs/hub4j-test-org",
|
||||||
|
"repos_url": "https://api.github.com/orgs/hub4j-test-org/repos",
|
||||||
|
"events_url": "https://api.github.com/orgs/hub4j-test-org/events",
|
||||||
|
"hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks",
|
||||||
|
"issues_url": "https://api.github.com/orgs/hub4j-test-org/issues",
|
||||||
|
"members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}",
|
||||||
|
"public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4",
|
||||||
|
"description": "Hub4j Test Org Description (this could be null or blank too)",
|
||||||
|
"name": "Hub4j Test Org Name (this could be null or blank too)",
|
||||||
|
"company": null,
|
||||||
|
"blog": "https://hub4j.url.io/could/be/null",
|
||||||
|
"location": "Hub4j Test Org Location (this could be null or blank too)",
|
||||||
|
"email": "hub4jtestorgemail@could.be.null.com",
|
||||||
|
"twitter_username": null,
|
||||||
|
"is_verified": false,
|
||||||
|
"has_organization_projects": true,
|
||||||
|
"has_repository_projects": true,
|
||||||
|
"public_repos": 12,
|
||||||
|
"public_gists": 0,
|
||||||
|
"followers": 0,
|
||||||
|
"following": 0,
|
||||||
|
"html_url": "https://github.com/hub4j-test-org",
|
||||||
|
"created_at": "2014-05-10T19:39:11Z",
|
||||||
|
"updated_at": "2020-06-04T05:56:10Z",
|
||||||
|
"type": "Organization",
|
||||||
|
"total_private_repos": 0,
|
||||||
|
"owned_private_repos": 0,
|
||||||
|
"private_gists": 0,
|
||||||
|
"disk_usage": 148,
|
||||||
|
"collaborators": 0,
|
||||||
|
"billing_email": "kk@kohsuke.org",
|
||||||
|
"default_repository_permission": "none",
|
||||||
|
"members_can_create_repositories": false,
|
||||||
|
"two_factor_requirement_enabled": false,
|
||||||
|
"plan": {
|
||||||
|
"name": "free",
|
||||||
|
"space": 976562499,
|
||||||
|
"private_repos": 10000,
|
||||||
|
"filled_seats": 18,
|
||||||
|
"seats": 3
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
"name": "simple-team",
|
||||||
|
"id": 3947450,
|
||||||
|
"node_id": "MDQ6VGVhbTM5NDc0NTA=",
|
||||||
|
"slug": "simple-team",
|
||||||
|
"description": "A simple team with no children",
|
||||||
|
"privacy": "closed",
|
||||||
|
"url": "https://api.github.com/organizations/7544739/team/3947450",
|
||||||
|
"html_url": "https://github.com/orgs/hub4j-test-org/teams/simple-team",
|
||||||
|
"members_url": "https://api.github.com/organizations/7544739/team/3947450/members{/member}",
|
||||||
|
"repositories_url": "https://api.github.com/organizations/7544739/team/3947450/repos",
|
||||||
|
"permission": "pull",
|
||||||
|
"created_at": "2020-07-15T20:36:47Z",
|
||||||
|
"updated_at": "2020-07-15T20:36:47Z",
|
||||||
|
"members_count": 1,
|
||||||
|
"repos_count": 0,
|
||||||
|
"organization": {
|
||||||
|
"login": "hub4j-test-org",
|
||||||
|
"id": 7544739,
|
||||||
|
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
|
||||||
|
"url": "https://api.github.com/orgs/hub4j-test-org",
|
||||||
|
"repos_url": "https://api.github.com/orgs/hub4j-test-org/repos",
|
||||||
|
"events_url": "https://api.github.com/orgs/hub4j-test-org/events",
|
||||||
|
"hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks",
|
||||||
|
"issues_url": "https://api.github.com/orgs/hub4j-test-org/issues",
|
||||||
|
"members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}",
|
||||||
|
"public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4",
|
||||||
|
"description": "Hub4j Test Org Description (this could be null or blank too)",
|
||||||
|
"name": "Hub4j Test Org Name (this could be null or blank too)",
|
||||||
|
"company": null,
|
||||||
|
"blog": "https://hub4j.url.io/could/be/null",
|
||||||
|
"location": "Hub4j Test Org Location (this could be null or blank too)",
|
||||||
|
"email": "hub4jtestorgemail@could.be.null.com",
|
||||||
|
"twitter_username": null,
|
||||||
|
"is_verified": false,
|
||||||
|
"has_organization_projects": true,
|
||||||
|
"has_repository_projects": true,
|
||||||
|
"public_repos": 12,
|
||||||
|
"public_gists": 0,
|
||||||
|
"followers": 0,
|
||||||
|
"following": 0,
|
||||||
|
"html_url": "https://github.com/hub4j-test-org",
|
||||||
|
"created_at": "2014-05-10T19:39:11Z",
|
||||||
|
"updated_at": "2020-06-04T05:56:10Z",
|
||||||
|
"type": "Organization"
|
||||||
|
},
|
||||||
|
"parent": null
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"login": "bitwiseman",
|
||||||
|
"id": 1958953,
|
||||||
|
"node_id": "MDQ6VXNlcjE5NTg5NTM=",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/bitwiseman",
|
||||||
|
"html_url": "https://github.com/bitwiseman",
|
||||||
|
"followers_url": "https://api.github.com/users/bitwiseman/followers",
|
||||||
|
"following_url": "https://api.github.com/users/bitwiseman/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/bitwiseman/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/bitwiseman/repos",
|
||||||
|
"events_url": "https://api.github.com/users/bitwiseman/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/bitwiseman/received_events",
|
||||||
|
"type": "User",
|
||||||
|
"site_admin": false,
|
||||||
|
"name": "Liam Newman",
|
||||||
|
"company": "Cloudbees, Inc.",
|
||||||
|
"blog": "",
|
||||||
|
"location": "Seattle, WA, USA",
|
||||||
|
"email": "bitwiseman@gmail.com",
|
||||||
|
"hireable": null,
|
||||||
|
"bio": null,
|
||||||
|
"twitter_username": "bitwiseman",
|
||||||
|
"public_repos": 196,
|
||||||
|
"public_gists": 7,
|
||||||
|
"followers": 165,
|
||||||
|
"following": 9,
|
||||||
|
"created_at": "2012-07-11T20:38:33Z",
|
||||||
|
"updated_at": "2020-07-14T20:54:47Z",
|
||||||
|
"private_gists": 19,
|
||||||
|
"total_private_repos": 14,
|
||||||
|
"owned_private_repos": 0,
|
||||||
|
"disk_usage": 33700,
|
||||||
|
"collaborators": 0,
|
||||||
|
"two_factor_authentication": true,
|
||||||
|
"plan": {
|
||||||
|
"name": "free",
|
||||||
|
"space": 976562499,
|
||||||
|
"collaborators": 0,
|
||||||
|
"private_repos": 10000
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"id": "db9b96a5-fe2c-487d-8fbe-777c821a637a",
|
||||||
|
"name": "orgs_hub4j-test-org",
|
||||||
|
"request": {
|
||||||
|
"url": "/orgs/hub4j-test-org",
|
||||||
|
"method": "GET",
|
||||||
|
"headers": {
|
||||||
|
"Accept": {
|
||||||
|
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"status": 200,
|
||||||
|
"bodyFileName": "orgs_hub4j-test-org-2.json",
|
||||||
|
"headers": {
|
||||||
|
"Server": "GitHub.com",
|
||||||
|
"Date": "Wed, 15 Jul 2020 20:38:33 GMT",
|
||||||
|
"Content-Type": "application/json; charset=utf-8",
|
||||||
|
"Status": "200 OK",
|
||||||
|
"X-RateLimit-Limit": "5000",
|
||||||
|
"X-RateLimit-Remaining": "4988",
|
||||||
|
"X-RateLimit-Reset": "1594848477",
|
||||||
|
"Cache-Control": "private, max-age=60, s-maxage=60",
|
||||||
|
"Vary": [
|
||||||
|
"Accept, Authorization, Cookie, X-GitHub-OTP",
|
||||||
|
"Accept-Encoding, Accept, X-Requested-With"
|
||||||
|
],
|
||||||
|
"ETag": "W/\"6bd323dd4ab2a01dae2464621246c3cd\"",
|
||||||
|
"Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT",
|
||||||
|
"X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion",
|
||||||
|
"X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org",
|
||||||
|
"X-GitHub-Media-Type": "unknown, github.v3",
|
||||||
|
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"X-Frame-Options": "deny",
|
||||||
|
"X-Content-Type-Options": "nosniff",
|
||||||
|
"X-XSS-Protection": "1; mode=block",
|
||||||
|
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"Content-Security-Policy": "default-src 'none'",
|
||||||
|
"X-GitHub-Request-Id": "CB6B:7F44:5E37B7:DCCBC7:5F0F6948"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "db9b96a5-fe2c-487d-8fbe-777c821a637a",
|
||||||
|
"persistent": true,
|
||||||
|
"insertionIndex": 2
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"id": "015dd9a8-6fb4-4ab0-9053-15905e3a80be",
|
||||||
|
"name": "orgs_hub4j-test-org_teams_simple-team",
|
||||||
|
"request": {
|
||||||
|
"url": "/orgs/hub4j-test-org/teams/simple-team",
|
||||||
|
"method": "GET",
|
||||||
|
"headers": {
|
||||||
|
"Accept": {
|
||||||
|
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"status": 200,
|
||||||
|
"bodyFileName": "orgs_hub4j-test-org_teams_simple-team-3.json",
|
||||||
|
"headers": {
|
||||||
|
"Server": "GitHub.com",
|
||||||
|
"Date": "Wed, 15 Jul 2020 20:38:33 GMT",
|
||||||
|
"Content-Type": "application/json; charset=utf-8",
|
||||||
|
"Status": "200 OK",
|
||||||
|
"X-RateLimit-Limit": "5000",
|
||||||
|
"X-RateLimit-Remaining": "4987",
|
||||||
|
"X-RateLimit-Reset": "1594848477",
|
||||||
|
"Cache-Control": "private, max-age=60, s-maxage=60",
|
||||||
|
"Vary": [
|
||||||
|
"Accept, Authorization, Cookie, X-GitHub-OTP",
|
||||||
|
"Accept-Encoding, Accept, X-Requested-With"
|
||||||
|
],
|
||||||
|
"ETag": "W/\"a5eb4fddb71a5d9f0af1fdcf97a20361\"",
|
||||||
|
"Last-Modified": "Wed, 15 Jul 2020 20:36:47 GMT",
|
||||||
|
"X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion",
|
||||||
|
"X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org",
|
||||||
|
"X-GitHub-Media-Type": "unknown, github.v3",
|
||||||
|
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"X-Frame-Options": "deny",
|
||||||
|
"X-Content-Type-Options": "nosniff",
|
||||||
|
"X-XSS-Protection": "1; mode=block",
|
||||||
|
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"Content-Security-Policy": "default-src 'none'",
|
||||||
|
"X-GitHub-Request-Id": "CB6B:7F44:5E37BE:DCCC34:5F0F6949"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "015dd9a8-6fb4-4ab0-9053-15905e3a80be",
|
||||||
|
"persistent": true,
|
||||||
|
"insertionIndex": 3
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"id": "7a45d54e-c5da-4fd9-bb6a-121d5bc2381c",
|
||||||
|
"name": "teams_3947450_teams",
|
||||||
|
"request": {
|
||||||
|
"url": "/teams/3947450/teams",
|
||||||
|
"method": "GET",
|
||||||
|
"headers": {
|
||||||
|
"Accept": {
|
||||||
|
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"status": 200,
|
||||||
|
"body": "[]",
|
||||||
|
"headers": {
|
||||||
|
"Server": "GitHub.com",
|
||||||
|
"Date": "Wed, 15 Jul 2020 20:38:33 GMT",
|
||||||
|
"Content-Type": "application/json; charset=utf-8",
|
||||||
|
"Status": "200 OK",
|
||||||
|
"X-RateLimit-Limit": "5000",
|
||||||
|
"X-RateLimit-Remaining": "4986",
|
||||||
|
"X-RateLimit-Reset": "1594848477",
|
||||||
|
"Cache-Control": "private, max-age=60, s-maxage=60",
|
||||||
|
"Vary": [
|
||||||
|
"Accept, Authorization, Cookie, X-GitHub-OTP",
|
||||||
|
"Accept-Encoding, Accept, X-Requested-With"
|
||||||
|
],
|
||||||
|
"ETag": "\"c2ec59aeeea67fff8edf681155a22565\"",
|
||||||
|
"X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion",
|
||||||
|
"X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org",
|
||||||
|
"X-GitHub-Media-Type": "unknown, github.v3",
|
||||||
|
"Deprecation": "Sat, 01 Feb 2020 00:00:00 GMT",
|
||||||
|
"Sunset": "Mon, 01 Feb 2021 00:00:00 GMT",
|
||||||
|
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"X-Frame-Options": "deny",
|
||||||
|
"X-Content-Type-Options": "nosniff",
|
||||||
|
"X-XSS-Protection": "1; mode=block",
|
||||||
|
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"Content-Security-Policy": "default-src 'none'",
|
||||||
|
"X-GitHub-Request-Id": "CB6B:7F44:5E37C8:DCCC46:5F0F6949",
|
||||||
|
"Link": "<https://developer.github.com/changes/2020-01-21-moving-the-team-api-endpoints/>; rel=\"deprecation\"; type=\"text/html\", <https://api.github.com/organizations/7544739/team/3947450/teams>; rel=\"alternate\""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "7a45d54e-c5da-4fd9-bb6a-121d5bc2381c",
|
||||||
|
"persistent": true,
|
||||||
|
"insertionIndex": 4
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"id": "d3cc8cd3-77b2-49be-bfed-02cf7a5cce56",
|
||||||
|
"name": "user",
|
||||||
|
"request": {
|
||||||
|
"url": "/user",
|
||||||
|
"method": "GET",
|
||||||
|
"headers": {
|
||||||
|
"Accept": {
|
||||||
|
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"status": 200,
|
||||||
|
"bodyFileName": "user-1.json",
|
||||||
|
"headers": {
|
||||||
|
"Server": "GitHub.com",
|
||||||
|
"Date": "Wed, 15 Jul 2020 20:38:32 GMT",
|
||||||
|
"Content-Type": "application/json; charset=utf-8",
|
||||||
|
"Status": "200 OK",
|
||||||
|
"X-RateLimit-Limit": "5000",
|
||||||
|
"X-RateLimit-Remaining": "4990",
|
||||||
|
"X-RateLimit-Reset": "1594848477",
|
||||||
|
"Cache-Control": "private, max-age=60, s-maxage=60",
|
||||||
|
"Vary": [
|
||||||
|
"Accept, Authorization, Cookie, X-GitHub-OTP",
|
||||||
|
"Accept-Encoding, Accept, X-Requested-With"
|
||||||
|
],
|
||||||
|
"ETag": "W/\"a4dab08bcf40f1302ada7a08825695c8\"",
|
||||||
|
"Last-Modified": "Tue, 14 Jul 2020 20:54:47 GMT",
|
||||||
|
"X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion",
|
||||||
|
"X-Accepted-OAuth-Scopes": "",
|
||||||
|
"X-GitHub-Media-Type": "unknown, github.v3",
|
||||||
|
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
|
||||||
|
"X-Frame-Options": "deny",
|
||||||
|
"X-Content-Type-Options": "nosniff",
|
||||||
|
"X-XSS-Protection": "1; mode=block",
|
||||||
|
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
|
||||||
|
"Content-Security-Policy": "default-src 'none'",
|
||||||
|
"X-GitHub-Request-Id": "CB6B:7F44:5E378A:DCCBB5:5F0F6948"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "d3cc8cd3-77b2-49be-bfed-02cf7a5cce56",
|
||||||
|
"persistent": true,
|
||||||
|
"insertionIndex": 1
|
||||||
|
}
|
||||||
6
src/test/resources/slow-or-flaky-tests.txt
Normal file
6
src/test/resources/slow-or-flaky-tests.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
**/extras/**
|
||||||
|
**/AbuseLimitHandlerTest
|
||||||
|
**/GHRateLimitTest
|
||||||
|
**/RequesterRetryTest
|
||||||
|
**/RateLimitCheckerTest
|
||||||
|
**/RateLimitHandlerTest
|
||||||
Reference in New Issue
Block a user