Merge pull request #706 from bitwiseman/task/guard

Add basic rate limit checker
This commit is contained in:
Liam Newman
2020-02-21 13:06:51 -08:00
committed by GitHub
22 changed files with 2041 additions and 16 deletions

View File

@@ -219,6 +219,28 @@ public class GHRateLimit {
return Objects.hash(getCore(), getSearch(), getGraphQL(), getIntegrationManifest());
}
/**
* Gets the appropriate {@link Record} for a particular url path.
*
* @param urlPath
* the url path of the request
* @return the {@link Record} for a url path.
*/
@Nonnull
Record getRecordForUrlPath(@Nonnull String urlPath) {
if (urlPath.equals("/rate_limit")) {
return new UnknownLimitRecord();
} else if (urlPath.startsWith("/search")) {
return getSearch();
} else if (urlPath.startsWith("/graphql")) {
return getGraphQL();
} else if (urlPath.startsWith("/app-manifests")) {
return getIntegrationManifest();
} else {
return getCore();
}
}
/**
* A limit record used as a placeholder when the the actual limit is not known.
* <p>
@@ -257,6 +279,8 @@ public class GHRateLimit {
/**
* 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;
@@ -266,8 +290,12 @@ public class GHRateLimit {
private final long createdAtEpochSeconds = System.currentTimeMillis() / 1000;
/**
* The calculated time at which the rate limit will reset. Recalculated if {@link #recalculateResetDate} is
* called.
* The time at which the rate limit will reset. This value is calculated based on
* {@link #getResetEpochSeconds()} by calling {@link #recalculateResetDate}. If the clock on the local machine
* not synchronized with the server clock, this time value will be adjusted to match the local machine's clock.
* <p>
* Recalculated by calling {@link #recalculateResetDate}.
* </p>
*/
@Nonnull
private Date resetDate;
@@ -310,8 +338,27 @@ public class GHRateLimit {
}
/**
* Recalculates the reset date using the server response date to calculate a time duration and then add that to
* the local created time for this record.
* Recalculates the {@link #resetDate} relative to the local machine clock.
* <p>
* {@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
* accurate to the local machine.
* </p>
* <p>
* When we say that the clock on two machines is "synchronized", we mean that the UTC time returned from
* {@link System#currentTimeMillis()} on each machine is basically the same. For the purposes of rate limits an
* differences of up to a second can be ignored.
* </p>
* <p>
* When the clock on the local machine is synchronized to the same time as the clock on the GitHub server (via a
* time service for example), the {@link #resetDate} generated directly from {@link #resetEpochSeconds} will be
* accurate for the local machine as well.
* </p>
* <p>
* When the clock on the local machine is not synchronized with the server, the {@link #resetDate} must be
* recalculated relative to the local machine clock. This is done by taking the number of seconds between the
* response "Date" header and {@link #resetEpochSeconds} and then adding that to this record's
* {@link #createdAtEpochSeconds}.
*
* @param updatedAt
* a string date in RFC 1123
@@ -358,7 +405,12 @@ public class GHRateLimit {
/**
* Gets the time in epoch seconds when the rate limit will reset.
*
* @return a long
* This is the raw value returned by the server. This value is not adjusted if local machine time is not
* synchronized with server time. If attempting to check when the rate limit will reset, use
* {@link #getResetDate()} or implement a {@link RateLimitChecker} instead.
*
* @return a long representing the time in epoch seconds when the rate limit will reset
* @see #getResetDate() #getResetDate()
*/
public long getResetEpochSeconds() {
return resetEpochSeconds;
@@ -374,7 +426,10 @@ public class GHRateLimit {
}
/**
* Returns the date at which the rate limit will reset.
* Returns the date at which the rate limit will reset, adjusted to local machine time if the local machine's
* clock not 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.
*
* @return the calculated date at which the rate limit has or will reset.
*/

View File

@@ -108,7 +108,8 @@ public class GitHub {
String password,
HttpConnector connector,
RateLimitHandler rateLimitHandler,
AbuseLimitHandler abuseLimitHandler) throws IOException {
AbuseLimitHandler abuseLimitHandler,
GitHubRateLimitChecker rateLimitChecker) throws IOException {
this.client = new GitHubHttpUrlConnectionClient(apiUrl,
login,
oauthAccessToken,
@@ -117,6 +118,7 @@ public class GitHub {
connector,
rateLimitHandler,
abuseLimitHandler,
rateLimitChecker,
(myself) -> setMyself(myself));
users = new ConcurrentHashMap<>();
orgs = new ConcurrentHashMap<>();

View File

@@ -14,6 +14,8 @@ import java.util.Locale;
import java.util.Map.Entry;
import java.util.Properties;
import javax.annotation.Nonnull;
/**
* Configures connection details and produces {@link GitHub}.
*
@@ -32,6 +34,7 @@ public class GitHubBuilder implements Cloneable {
private RateLimitHandler rateLimitHandler = RateLimitHandler.WAIT;
private AbuseLimitHandler abuseLimitHandler = AbuseLimitHandler.WAIT;
private GitHubRateLimitChecker rateLimitChecker = new GitHubRateLimitChecker();
/**
* Instantiates a new Git hub builder.
@@ -311,11 +314,26 @@ public class GitHubBuilder implements Cloneable {
}
/**
* With rate limit handler git hub builder.
* Adds a {@link RateLimitHandler} to this {@link GitHubBuilder}.
* <p>
* GitHub allots a certain number of requests to each user or application per period of time (usually per hour). The
* number of requests remaining is returned in the response header and can also be requested using
* {@link GitHub#getRateLimit()}. This requests per interval is referred to as the "rate limit".
* </p>
* <p>
* When the remaining number of requests reaches zero, the next request will return an error. If this happens,
* {@link RateLimitHandler#onError(IOException, HttpURLConnection)} will be called.
* </p>
* <p>
* NOTE: GitHub treats clients that exceed their rate limit very harshly. If possible, clients should avoid
* exceeding their rate limit. Consider adding a {@link RateLimitChecker} to automatically check the rate limit for
* each request and wait if needed.
* </p>
*
* @param handler
* the handler
* @return the git hub builder
* @see #withRateLimitChecker(RateLimitChecker)
*/
public GitHubBuilder withRateLimitHandler(RateLimitHandler handler) {
this.rateLimitHandler = handler;
@@ -323,7 +341,12 @@ public class GitHubBuilder implements Cloneable {
}
/**
* With abuse limit handler git hub builder.
* Adds a {@link AbuseLimitHandler} to this {@link GitHubBuilder}.
* <p>
* When a client sends too many requests in a short time span, GitHub may return an error and set a header telling
* the client to not make any more request for some period of time. If this happens,
* {@link AbuseLimitHandler#onError(IOException, HttpURLConnection)} will be called.
* </p>
*
* @param handler
* the handler
@@ -334,6 +357,36 @@ public class GitHubBuilder implements Cloneable {
return this;
}
/**
* Adds a {@link RateLimitChecker} to this {@link GitHubBuilder}.
* <p>
* GitHub allots a certain number of requests to each user or application per period of time (usually per hour). The
* number of requests remaining is returned in the response header and can also be requested using
* {@link GitHub#getRateLimit()}. This requests per interval is referred to as the "rate limit".
* </p>
* <p>
* 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 met.
* </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 seen rate limit rather than making a new
* request.
* </p>
*
* @param coreRateLimitChecker
* the {@link RateLimitChecker} for core GitHub API requests
* @return the git hub builder
*/
public GitHubBuilder withRateLimitChecker(@Nonnull RateLimitChecker coreRateLimitChecker) {
this.rateLimitChecker = new GitHubRateLimitChecker(coreRateLimitChecker,
RateLimitChecker.NONE,
RateLimitChecker.NONE,
RateLimitChecker.NONE);
return this;
}
/**
* Configures {@linkplain #withConnector(HttpConnector) connector} that uses HTTP library in JRE but use a specific
* proxy, instead of the system default one.
@@ -351,7 +404,7 @@ public class GitHubBuilder implements Cloneable {
}
/**
* Build git hub.
* Builds a {@link GitHub} instance.
*
* @return the git hub
* @throws IOException
@@ -365,7 +418,8 @@ public class GitHubBuilder implements Cloneable {
password,
connector,
rateLimitHandler,
abuseLimitHandler);
abuseLimitHandler,
rateLimitChecker);
}
@Override

View File

@@ -6,7 +6,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.introspect.VisibilityChecker;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -64,6 +63,7 @@ abstract class GitHubClient {
protected final RateLimitHandler rateLimitHandler;
protected final AbuseLimitHandler abuseLimitHandler;
private final GitHubRateLimitChecker rateLimitChecker;
private HttpConnector connector;
@@ -95,6 +95,7 @@ abstract class GitHubClient {
HttpConnector connector,
RateLimitHandler rateLimitHandler,
AbuseLimitHandler abuseLimitHandler,
GitHubRateLimitChecker rateLimitChecker,
Consumer<GHMyself> myselfConsumer) throws IOException {
if (apiUrl.endsWith("/")) {
@@ -124,6 +125,7 @@ abstract class GitHubClient {
this.rateLimitHandler = rateLimitHandler;
this.abuseLimitHandler = abuseLimitHandler;
this.rateLimitChecker = rateLimitChecker;
if (login == null && encodedAuthorization != null && jwtToken == null) {
GHMyself myself = fetch(GHMyself.class, "/user");
@@ -336,6 +338,8 @@ abstract class GitHubClient {
+ " " + request.url().toString());
}
rateLimitChecker.checkRateLimit(this, request);
responseInfo = getResponseInfo(request);
noteRateLimit(responseInfo);
detectOTPRequired(responseInfo);
@@ -366,7 +370,7 @@ abstract class GitHubClient {
throw new GHIOException("Ran out of retries for URL: " + request.url().toString());
}
@NotNull
@Nonnull
protected abstract GitHubResponse.ResponseInfo getResponseInfo(GitHubRequest request) throws IOException;
protected abstract void handleLimitingErrors(@Nonnull GitHubResponse.ResponseInfo responseInfo) throws IOException;
@@ -442,7 +446,7 @@ abstract class GitHubClient {
/**
* Sets the response headers on objects that need it. Ideally this would be handled by the objects themselves, but
* currently they do not have access to {@link GitHubResponse.ResponseInfo} after the
*
*
* @param responseInfo
* the response info
* @param readValue

View File

@@ -1,7 +1,6 @@
package org.kohsuke.github;
import org.apache.commons.io.IOUtils;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.io.InputStream;
@@ -41,6 +40,7 @@ class GitHubHttpUrlConnectionClient extends GitHubClient {
HttpConnector connector,
RateLimitHandler rateLimitHandler,
AbuseLimitHandler abuseLimitHandler,
GitHubRateLimitChecker rateLimitChecker,
Consumer<GHMyself> myselfConsumer) throws IOException {
super(apiUrl,
login,
@@ -50,10 +50,11 @@ class GitHubHttpUrlConnectionClient extends GitHubClient {
connector,
rateLimitHandler,
abuseLimitHandler,
rateLimitChecker,
myselfConsumer);
}
@NotNull
@Nonnull
protected GitHubResponse.ResponseInfo getResponseInfo(GitHubRequest request) throws IOException {
HttpURLConnection connection;
try {

View File

@@ -0,0 +1,145 @@
package org.kohsuke.github;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.util.Objects;
import javax.annotation.Nonnull;
/**
* A GitHub API Rate Limit Checker called before each request. This class provides the basic infrastructure for calling
* 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>
* GitHub allots a certain number of requests to each user or application per period of time (usually per hour). The
* number of requests remaining is returned in the response header and can also be requested using
* {@link GitHub#getRateLimit()}. This requests per interval is referred to as the "rate limit".
* </p>
* <p>
* 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
* met.
* </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>
*/
class GitHubRateLimitChecker {
@Nonnull
private final RateLimitChecker core;
@Nonnull
private final RateLimitChecker search;
@Nonnull
private final RateLimitChecker graphql;
@Nonnull
private final RateLimitChecker integrationManifest;
GitHubRateLimitChecker() {
this(RateLimitChecker.NONE, RateLimitChecker.NONE, RateLimitChecker.NONE, RateLimitChecker.NONE);
}
GitHubRateLimitChecker(@Nonnull RateLimitChecker core,
@Nonnull RateLimitChecker search,
@Nonnull RateLimitChecker graphql,
@Nonnull RateLimitChecker integrationManifest) {
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.graphql = Objects.requireNonNull(graphql);
this.integrationManifest = Objects.requireNonNull(integrationManifest);
}
/**
* Checks whether there is sufficient requests remaining within this client's rate limit quota to make the current
* request.
* <p>
* This method does not do the actual check. Instead it select the appropriate {@link RateLimitChecker} and
* {@link GHRateLimit.Record} for the current request's urlPath. If the {@link RateLimitChecker} for this the
* current request's urlPath is {@link RateLimitChecker#NONE} the rate limit is not checked. If not, it calls
* {@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>
* It is up to the {@link RateLimitChecker#checkRateLimit(GHRateLimit.Record, long)} 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
* not, that method will return {@code false}.
* </p>
* <p>
* As long as {@link RateLimitChecker#checkRateLimit(GHRateLimit.Record, long)} returns {@code true}, this method
* 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)} to apply any number of strategies to
* controlling the speed at which requests are made. When it returns {@code false} this method will return and the
* request will be sent.
* </p>
*
* @param client
* the {@link GitHubClient} to check
* @param request
* the {@link GitHubRequest} to check against
* @throws IOException
* if there is an I/O error
*/
void checkRateLimit(GitHubClient client, GitHubRequest request) throws IOException {
RateLimitChecker guard = selectChecker(request.urlPath());
if (guard == RateLimitChecker.NONE) {
return;
}
// For the first rate limit, accept the current limit if a valid one is already present.
GHRateLimit rateLimit = client.rateLimit();
GHRateLimit.Record rateLimitRecord = rateLimit.getRecordForUrlPath(request.urlPath());
long waitCount = 0;
try {
while (guard.checkRateLimit(rateLimitRecord, waitCount)) {
waitCount++;
// When rate limit is exceeded, sleep for one additional second beyond when the
// called {@link RateLimitChecker} sleeps.
// Reset time is only accurate to the second, so adding a one second buffer for safety is a good idea.
// This also keeps polling clients from querying too often.
Thread.sleep(1000);
// After the first wait, always request a new rate limit from the server.
rateLimit = client.getRateLimit();
rateLimitRecord = rateLimit.getRecordForUrlPath(request.urlPath());
}
} catch (InterruptedException e) {
throw (IOException) new InterruptedIOException(e.getMessage()).initCause(e);
}
}
/**
* Gets the appropriate {@link RateLimitChecker} for a particular url path. Similar to
* {@link GHRateLimit#getRecordForUrlPath(String)}.
*
* @param urlPath
* the url path of the request
* @return the {@link RateLimitChecker} for a url path.
*/
@Nonnull
private RateLimitChecker selectChecker(@Nonnull String urlPath) {
if (urlPath.equals("/rate_limit")) {
return RateLimitChecker.NONE;
} else if (urlPath.startsWith("/search")) {
return search;
} else if (urlPath.startsWith("/graphql")) {
return graphql;
} else if (urlPath.startsWith("/app-manifests")) {
return integrationManifest;
} else {
return core;
}
}
}

View File

@@ -0,0 +1,112 @@
package org.kohsuke.github;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* A GitHub API Rate Limit Checker called before each request
* <p>
* GitHub allots a certain number of requests to each user or application per period of time (usually per hour). The
* number of requests remaining is returned in the response header and can also be requested using
* {@link GitHub#getRateLimit()}. This requests per interval is referred to as the "rate limit".
* </p>
* <p>
* 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
* met.
* </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 {
private static final Logger LOGGER = Logger.getLogger(RateLimitChecker.class.getName());
public static final RateLimitChecker NONE = new RateLimitChecker() {
};
/**
* Decides whether the current request exceeds the allowed "rate limit" budget. If this determines the rate limit
* will be exceeded, this method should sleep for some amount of time and must return {@code true}. Implementers are
* free to choose whatever strategy they prefer for what is considered to exceed the budget and how long to sleep.
*
* <p>
* The caller of this method figures out which {@link GHRateLimit.Record} applies for the current request add
* provides it to this method.
* </p>
* <p>
* It is important to remember that rate limit reset times are only accurate to the second. Trying to sleep to
* exactly the reset time would be likely to produce worse behavior rather than better. For this reason
* {@link GitHubRateLimitChecker} may choose to add more sleep times when a checker indicates the rate limit was
* exceeded.
* </p>
* <p>
* As long as this method returns {@code true} it is guaranteed that {@link GitHubRateLimitChecker} will get updated
* rate limit information and call this method again with {@code count} incremented by one. After this method
* returns {@code true} at least once, the calling {@link GitHubRateLimitChecker} may choose to wait some additional
* period of time between calls to this checker.
* </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
* the current {@link GHRateLimit.Record} to check against.
* @param count
* the number of times in a row this method has been called for the current request
* @return {@code false} if the current request does not exceed the allowed budget, {@code true} if the current
* request exceeded the budget.
* @throws InterruptedException
* if the thread is interrupted while sleeping
*/
protected boolean checkRateLimit(GHRateLimit.Record rateLimitRecord, long count) throws InterruptedException {
return false;
}
protected final boolean sleepUntilReset(GHRateLimit.Record record) throws InterruptedException {
// Sleep until reset
long sleepMilliseconds = record.getResetDate().getTime() - System.currentTimeMillis();
if (sleepMilliseconds > 0) {
String message = String.format(
"GitHub API - Current quota has %d remaining of %d. Waiting for quota to reset at %tT.",
record.getRemaining(),
record.getLimit(),
record.getResetDate());
LOGGER.log(Level.INFO, message);
Thread.sleep(sleepMilliseconds);
return true;
}
return false;
}
/**
* A {@link RateLimitChecker} with a simple number as the limit.
*/
public static class LiteralValue extends RateLimitChecker {
private final int sleepAtOrBelow;
public LiteralValue(int sleepAtOrBelow) {
if (sleepAtOrBelow < 0) {
throw new IllegalArgumentException("sleepAtOrBelow must >= 0");
}
this.sleepAtOrBelow = sleepAtOrBelow;
}
@Override
protected boolean checkRateLimit(GHRateLimit.Record record, long count) throws InterruptedException {
if (record.getRemaining() <= sleepAtOrBelow) {
return sleepUntilReset(record);
}
return false;
}
}
}

View File

@@ -0,0 +1,115 @@
package org.kohsuke.github;
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
import com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;
import com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.HandlebarsCurrentDateHelper;
import org.junit.Test;
import wiremock.com.github.jknack.handlebars.Helper;
import wiremock.com.github.jknack.handlebars.Options;
import java.io.IOException;
import java.util.Date;
import static org.hamcrest.CoreMatchers.*;
/**
* Test showing the behavior of the {@link GitHubRateLimitChecker} and {@link RateLimitChecker.LiteralValue}.
*
* This is a very simple test but covers the key features: Checks occur automatically and are retried until they
* indicate it is safe to proceed.
*/
public class RateLimitCheckerTest extends AbstractGitHubWireMockTest {
GHRateLimit rateLimit = null;
GHRateLimit previousLimit = null;
Date testStartDate = new Date();
public RateLimitCheckerTest() {
useDefaultGitHub = false;
}
@Override
protected WireMockConfiguration getWireMockOptions() {
return super.getWireMockOptions().extensions(ResponseTemplateTransformer.builder()
.global(true)
.maxCacheEntries(0L)
.helper("testStartDate", new Helper<Object>() {
private HandlebarsCurrentDateHelper helper = new HandlebarsCurrentDateHelper();
@Override
public Object apply(final Object context, final Options options) throws IOException {
return this.helper.apply(RateLimitCheckerTest.this.testStartDate, options);
}
})
.build());
}
@Test
public void testGitHubRateLimit() throws Exception {
// Customized response that templates the date to keep things working
snapshotNotAllowed();
assertThat(mockGitHub.getRequestCount(), equalTo(0));
// // 4897 is just the what the limit was when the snapshot was taken
// previousLimit = GHRateLimit
// .fromHeaderRecord(new GHRateLimit.Record(5000, 4897, System.currentTimeMillis() / 1000L));
// Give this a moment
Thread.sleep(1000);
testStartDate = new Date();
// -------------------------------------------------------------
// /user gets response with rate limit information
gitHub = getGitHubBuilder().withRateLimitChecker(new RateLimitChecker.LiteralValue(4500))
.withEndpoint(mockGitHub.apiServer().baseUrl())
.build();
assertThat(gitHub.lastRateLimit(), nullValue());
// Checks the rate limit before getting myself
gitHub.getMyself();
updateTestRateLimit();
assertThat(mockGitHub.getRequestCount(), equalTo(2));
assertThat(rateLimit.getCore().getRemaining(), equalTo(4501));
// Should succeed without querying rate limit
// Also due to earlier reset date, new value is ignored.
GHOrganization org = gitHub.getOrganization("github-api-test-org");
updateTestRateLimit();
assertThat(mockGitHub.getRequestCount(), equalTo(3));
assertThat(rateLimit.getCore().getRemaining(), equalTo(4501));
assertThat(rateLimit, sameInstance(previousLimit));
// uses the existing header rate limit
// This request's header sets the limit at quota
org.getRepository("github-api");
updateTestRateLimit();
assertThat(mockGitHub.getRequestCount(), equalTo(4));
assertThat(rateLimit.getCore().getRemaining(), equalTo(4500));
// Due to previous request header, this request has to wait for reset
// results in an additional request
org.getRepository("github-api");
updateTestRateLimit();
assertThat(mockGitHub.getRequestCount(), equalTo(6));
assertThat(rateLimit.getCore().getRemaining(), equalTo(4400));
// Due to previous request header, this request has to wait for reset
// results in two additional requests because even after first reset we're still outside quota
org.getRepository("github-api");
updateTestRateLimit();
assertThat(mockGitHub.getRequestCount(), equalTo(9));
assertThat(rateLimit.getCore().getRemaining(), equalTo(4601));
}
protected void updateTestRateLimit() {
previousLimit = rateLimit;
rateLimit = gitHub.lastRateLimit();
}
private static GHRepository getRepository(GitHub gitHub) throws IOException {
return gitHub.getOrganization("github-api-test-org").getRepository("github-api");
}
}

View File

@@ -0,0 +1,41 @@
{
"login": "github-api-test-org",
"id": 7544739,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
"url": "https://api.github.com/orgs/github-api-test-org",
"repos_url": "https://api.github.com/orgs/github-api-test-org/repos",
"events_url": "https://api.github.com/orgs/github-api-test-org/events",
"hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks",
"issues_url": "https://api.github.com/orgs/github-api-test-org/issues",
"members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}",
"public_members_url": "https://api.github.com/orgs/github-api-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": 11,
"public_gists": 0,
"followers": 0,
"following": 0,
"html_url": "https://github.com/github-api-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": 12,
"seats": 0
}
}

View File

@@ -0,0 +1,332 @@
{
"id": 206888201,
"node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=",
"name": "github-api",
"full_name": "github-api-test-org/github-api",
"private": false,
"owner": {
"login": "github-api-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/github-api-test-org",
"html_url": "https://github.com/github-api-test-org",
"followers_url": "https://api.github.com/users/github-api-test-org/followers",
"following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}",
"gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions",
"organizations_url": "https://api.github.com/users/github-api-test-org/orgs",
"repos_url": "https://api.github.com/users/github-api-test-org/repos",
"events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-api-test-org/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/github-api-test-org/github-api",
"description": "Tricky",
"fork": true,
"url": "https://api.github.com/repos/github-api-test-org/github-api",
"forks_url": "https://api.github.com/repos/github-api-test-org/github-api/forks",
"keys_url": "https://api.github.com/repos/github-api-test-org/github-api/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/github-api-test-org/github-api/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/github-api-test-org/github-api/teams",
"hooks_url": "https://api.github.com/repos/github-api-test-org/github-api/hooks",
"issue_events_url": "https://api.github.com/repos/github-api-test-org/github-api/issues/events{/number}",
"events_url": "https://api.github.com/repos/github-api-test-org/github-api/events",
"assignees_url": "https://api.github.com/repos/github-api-test-org/github-api/assignees{/user}",
"branches_url": "https://api.github.com/repos/github-api-test-org/github-api/branches{/branch}",
"tags_url": "https://api.github.com/repos/github-api-test-org/github-api/tags",
"blobs_url": "https://api.github.com/repos/github-api-test-org/github-api/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/github-api-test-org/github-api/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/github-api-test-org/github-api/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/github-api-test-org/github-api/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/github-api-test-org/github-api/statuses/{sha}",
"languages_url": "https://api.github.com/repos/github-api-test-org/github-api/languages",
"stargazers_url": "https://api.github.com/repos/github-api-test-org/github-api/stargazers",
"contributors_url": "https://api.github.com/repos/github-api-test-org/github-api/contributors",
"subscribers_url": "https://api.github.com/repos/github-api-test-org/github-api/subscribers",
"subscription_url": "https://api.github.com/repos/github-api-test-org/github-api/subscription",
"commits_url": "https://api.github.com/repos/github-api-test-org/github-api/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/github-api-test-org/github-api/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/github-api-test-org/github-api/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/github-api-test-org/github-api/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/github-api-test-org/github-api/contents/{+path}",
"compare_url": "https://api.github.com/repos/github-api-test-org/github-api/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/github-api-test-org/github-api/merges",
"archive_url": "https://api.github.com/repos/github-api-test-org/github-api/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/github-api-test-org/github-api/downloads",
"issues_url": "https://api.github.com/repos/github-api-test-org/github-api/issues{/number}",
"pulls_url": "https://api.github.com/repos/github-api-test-org/github-api/pulls{/number}",
"milestones_url": "https://api.github.com/repos/github-api-test-org/github-api/milestones{/number}",
"notifications_url": "https://api.github.com/repos/github-api-test-org/github-api/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/github-api-test-org/github-api/labels{/name}",
"releases_url": "https://api.github.com/repos/github-api-test-org/github-api/releases{/id}",
"deployments_url": "https://api.github.com/repos/github-api-test-org/github-api/deployments",
"created_at": "2019-09-06T23:26:04Z",
"updated_at": "2020-01-16T21:22:56Z",
"pushed_at": "2020-01-18T00:47:43Z",
"git_url": "git://github.com/github-api-test-org/github-api.git",
"ssh_url": "git@github.com:github-api-test-org/github-api.git",
"clone_url": "https://github.com/github-api-test-org/github-api.git",
"svn_url": "https://github.com/github-api-test-org/github-api",
"homepage": "http://github-api.kohsuke.org/",
"size": 11414,
"stargazers_count": 0,
"watchers_count": 0,
"language": "Java",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 3,
"license": {
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"forks": 0,
"open_issues": 3,
"watchers": 0,
"default_branch": "master",
"permissions": {
"admin": true,
"push": true,
"pull": true
},
"temp_clone_token": "",
"allow_squash_merge": true,
"allow_merge_commit": true,
"allow_rebase_merge": true,
"delete_branch_on_merge": false,
"organization": {
"login": "github-api-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/github-api-test-org",
"html_url": "https://github.com/github-api-test-org",
"followers_url": "https://api.github.com/users/github-api-test-org/followers",
"following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}",
"gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions",
"organizations_url": "https://api.github.com/users/github-api-test-org/orgs",
"repos_url": "https://api.github.com/users/github-api-test-org/repos",
"events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-api-test-org/received_events",
"type": "Organization",
"site_admin": false
},
"parent": {
"id": 617210,
"node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=",
"name": "github-api",
"full_name": "github-api/github-api",
"private": false,
"owner": {
"login": "github-api",
"id": 54909825,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1",
"avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/github-api",
"html_url": "https://github.com/github-api",
"followers_url": "https://api.github.com/users/github-api/followers",
"following_url": "https://api.github.com/users/github-api/following{/other_user}",
"gists_url": "https://api.github.com/users/github-api/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-api/subscriptions",
"organizations_url": "https://api.github.com/users/github-api/orgs",
"repos_url": "https://api.github.com/users/github-api/repos",
"events_url": "https://api.github.com/users/github-api/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-api/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/github-api/github-api",
"description": "Java API for GitHub",
"fork": false,
"url": "https://api.github.com/repos/github-api/github-api",
"forks_url": "https://api.github.com/repos/github-api/github-api/forks",
"keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/github-api/github-api/teams",
"hooks_url": "https://api.github.com/repos/github-api/github-api/hooks",
"issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}",
"events_url": "https://api.github.com/repos/github-api/github-api/events",
"assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}",
"branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}",
"tags_url": "https://api.github.com/repos/github-api/github-api/tags",
"blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}",
"languages_url": "https://api.github.com/repos/github-api/github-api/languages",
"stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers",
"contributors_url": "https://api.github.com/repos/github-api/github-api/contributors",
"subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers",
"subscription_url": "https://api.github.com/repos/github-api/github-api/subscription",
"commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}",
"compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/github-api/github-api/merges",
"archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/github-api/github-api/downloads",
"issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}",
"pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}",
"milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}",
"notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}",
"releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}",
"deployments_url": "https://api.github.com/repos/github-api/github-api/deployments",
"created_at": "2010-04-19T04:13:03Z",
"updated_at": "2020-02-20T00:01:44Z",
"pushed_at": "2020-02-20T00:01:51Z",
"git_url": "git://github.com/github-api/github-api.git",
"ssh_url": "git@github.com:github-api/github-api.git",
"clone_url": "https://github.com/github-api/github-api.git",
"svn_url": "https://github.com/github-api/github-api",
"homepage": "https://github-api.kohsuke.org/",
"size": 19361,
"stargazers_count": 613,
"watchers_count": 613,
"language": "Java",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": true,
"forks_count": 454,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 56,
"license": {
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"forks": 454,
"open_issues": 56,
"watchers": 613,
"default_branch": "master"
},
"source": {
"id": 617210,
"node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=",
"name": "github-api",
"full_name": "github-api/github-api",
"private": false,
"owner": {
"login": "github-api",
"id": 54909825,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1",
"avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/github-api",
"html_url": "https://github.com/github-api",
"followers_url": "https://api.github.com/users/github-api/followers",
"following_url": "https://api.github.com/users/github-api/following{/other_user}",
"gists_url": "https://api.github.com/users/github-api/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-api/subscriptions",
"organizations_url": "https://api.github.com/users/github-api/orgs",
"repos_url": "https://api.github.com/users/github-api/repos",
"events_url": "https://api.github.com/users/github-api/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-api/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/github-api/github-api",
"description": "Java API for GitHub",
"fork": false,
"url": "https://api.github.com/repos/github-api/github-api",
"forks_url": "https://api.github.com/repos/github-api/github-api/forks",
"keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/github-api/github-api/teams",
"hooks_url": "https://api.github.com/repos/github-api/github-api/hooks",
"issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}",
"events_url": "https://api.github.com/repos/github-api/github-api/events",
"assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}",
"branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}",
"tags_url": "https://api.github.com/repos/github-api/github-api/tags",
"blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}",
"languages_url": "https://api.github.com/repos/github-api/github-api/languages",
"stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers",
"contributors_url": "https://api.github.com/repos/github-api/github-api/contributors",
"subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers",
"subscription_url": "https://api.github.com/repos/github-api/github-api/subscription",
"commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}",
"compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/github-api/github-api/merges",
"archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/github-api/github-api/downloads",
"issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}",
"pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}",
"milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}",
"notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}",
"releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}",
"deployments_url": "https://api.github.com/repos/github-api/github-api/deployments",
"created_at": "2010-04-19T04:13:03Z",
"updated_at": "2020-02-20T00:01:44Z",
"pushed_at": "2020-02-20T00:01:51Z",
"git_url": "git://github.com/github-api/github-api.git",
"ssh_url": "git@github.com:github-api/github-api.git",
"clone_url": "https://github.com/github-api/github-api.git",
"svn_url": "https://github.com/github-api/github-api",
"homepage": "https://github-api.kohsuke.org/",
"size": 19361,
"stargazers_count": 613,
"watchers_count": 613,
"language": "Java",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": true,
"forks_count": 454,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 56,
"license": {
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"forks": 454,
"open_issues": 56,
"watchers": 613,
"default_branch": "master"
},
"network_count": 454,
"subscribers_count": 0
}

View File

@@ -0,0 +1,332 @@
{
"id": 206888201,
"node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=",
"name": "github-api",
"full_name": "github-api-test-org/github-api",
"private": false,
"owner": {
"login": "github-api-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/github-api-test-org",
"html_url": "https://github.com/github-api-test-org",
"followers_url": "https://api.github.com/users/github-api-test-org/followers",
"following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}",
"gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions",
"organizations_url": "https://api.github.com/users/github-api-test-org/orgs",
"repos_url": "https://api.github.com/users/github-api-test-org/repos",
"events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-api-test-org/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/github-api-test-org/github-api",
"description": "Tricky",
"fork": true,
"url": "https://api.github.com/repos/github-api-test-org/github-api",
"forks_url": "https://api.github.com/repos/github-api-test-org/github-api/forks",
"keys_url": "https://api.github.com/repos/github-api-test-org/github-api/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/github-api-test-org/github-api/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/github-api-test-org/github-api/teams",
"hooks_url": "https://api.github.com/repos/github-api-test-org/github-api/hooks",
"issue_events_url": "https://api.github.com/repos/github-api-test-org/github-api/issues/events{/number}",
"events_url": "https://api.github.com/repos/github-api-test-org/github-api/events",
"assignees_url": "https://api.github.com/repos/github-api-test-org/github-api/assignees{/user}",
"branches_url": "https://api.github.com/repos/github-api-test-org/github-api/branches{/branch}",
"tags_url": "https://api.github.com/repos/github-api-test-org/github-api/tags",
"blobs_url": "https://api.github.com/repos/github-api-test-org/github-api/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/github-api-test-org/github-api/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/github-api-test-org/github-api/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/github-api-test-org/github-api/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/github-api-test-org/github-api/statuses/{sha}",
"languages_url": "https://api.github.com/repos/github-api-test-org/github-api/languages",
"stargazers_url": "https://api.github.com/repos/github-api-test-org/github-api/stargazers",
"contributors_url": "https://api.github.com/repos/github-api-test-org/github-api/contributors",
"subscribers_url": "https://api.github.com/repos/github-api-test-org/github-api/subscribers",
"subscription_url": "https://api.github.com/repos/github-api-test-org/github-api/subscription",
"commits_url": "https://api.github.com/repos/github-api-test-org/github-api/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/github-api-test-org/github-api/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/github-api-test-org/github-api/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/github-api-test-org/github-api/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/github-api-test-org/github-api/contents/{+path}",
"compare_url": "https://api.github.com/repos/github-api-test-org/github-api/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/github-api-test-org/github-api/merges",
"archive_url": "https://api.github.com/repos/github-api-test-org/github-api/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/github-api-test-org/github-api/downloads",
"issues_url": "https://api.github.com/repos/github-api-test-org/github-api/issues{/number}",
"pulls_url": "https://api.github.com/repos/github-api-test-org/github-api/pulls{/number}",
"milestones_url": "https://api.github.com/repos/github-api-test-org/github-api/milestones{/number}",
"notifications_url": "https://api.github.com/repos/github-api-test-org/github-api/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/github-api-test-org/github-api/labels{/name}",
"releases_url": "https://api.github.com/repos/github-api-test-org/github-api/releases{/id}",
"deployments_url": "https://api.github.com/repos/github-api-test-org/github-api/deployments",
"created_at": "2019-09-06T23:26:04Z",
"updated_at": "2020-01-16T21:22:56Z",
"pushed_at": "2020-01-18T00:47:43Z",
"git_url": "git://github.com/github-api-test-org/github-api.git",
"ssh_url": "git@github.com:github-api-test-org/github-api.git",
"clone_url": "https://github.com/github-api-test-org/github-api.git",
"svn_url": "https://github.com/github-api-test-org/github-api",
"homepage": "http://github-api.kohsuke.org/",
"size": 11414,
"stargazers_count": 0,
"watchers_count": 0,
"language": "Java",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 3,
"license": {
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"forks": 0,
"open_issues": 3,
"watchers": 0,
"default_branch": "master",
"permissions": {
"admin": true,
"push": true,
"pull": true
},
"temp_clone_token": "",
"allow_squash_merge": true,
"allow_merge_commit": true,
"allow_rebase_merge": true,
"delete_branch_on_merge": false,
"organization": {
"login": "github-api-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/github-api-test-org",
"html_url": "https://github.com/github-api-test-org",
"followers_url": "https://api.github.com/users/github-api-test-org/followers",
"following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}",
"gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions",
"organizations_url": "https://api.github.com/users/github-api-test-org/orgs",
"repos_url": "https://api.github.com/users/github-api-test-org/repos",
"events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-api-test-org/received_events",
"type": "Organization",
"site_admin": false
},
"parent": {
"id": 617210,
"node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=",
"name": "github-api",
"full_name": "github-api/github-api",
"private": false,
"owner": {
"login": "github-api",
"id": 54909825,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1",
"avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/github-api",
"html_url": "https://github.com/github-api",
"followers_url": "https://api.github.com/users/github-api/followers",
"following_url": "https://api.github.com/users/github-api/following{/other_user}",
"gists_url": "https://api.github.com/users/github-api/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-api/subscriptions",
"organizations_url": "https://api.github.com/users/github-api/orgs",
"repos_url": "https://api.github.com/users/github-api/repos",
"events_url": "https://api.github.com/users/github-api/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-api/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/github-api/github-api",
"description": "Java API for GitHub",
"fork": false,
"url": "https://api.github.com/repos/github-api/github-api",
"forks_url": "https://api.github.com/repos/github-api/github-api/forks",
"keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/github-api/github-api/teams",
"hooks_url": "https://api.github.com/repos/github-api/github-api/hooks",
"issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}",
"events_url": "https://api.github.com/repos/github-api/github-api/events",
"assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}",
"branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}",
"tags_url": "https://api.github.com/repos/github-api/github-api/tags",
"blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}",
"languages_url": "https://api.github.com/repos/github-api/github-api/languages",
"stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers",
"contributors_url": "https://api.github.com/repos/github-api/github-api/contributors",
"subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers",
"subscription_url": "https://api.github.com/repos/github-api/github-api/subscription",
"commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}",
"compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/github-api/github-api/merges",
"archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/github-api/github-api/downloads",
"issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}",
"pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}",
"milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}",
"notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}",
"releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}",
"deployments_url": "https://api.github.com/repos/github-api/github-api/deployments",
"created_at": "2010-04-19T04:13:03Z",
"updated_at": "2020-02-20T00:01:44Z",
"pushed_at": "2020-02-20T00:01:51Z",
"git_url": "git://github.com/github-api/github-api.git",
"ssh_url": "git@github.com:github-api/github-api.git",
"clone_url": "https://github.com/github-api/github-api.git",
"svn_url": "https://github.com/github-api/github-api",
"homepage": "https://github-api.kohsuke.org/",
"size": 19361,
"stargazers_count": 613,
"watchers_count": 613,
"language": "Java",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": true,
"forks_count": 454,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 56,
"license": {
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"forks": 454,
"open_issues": 56,
"watchers": 613,
"default_branch": "master"
},
"source": {
"id": 617210,
"node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=",
"name": "github-api",
"full_name": "github-api/github-api",
"private": false,
"owner": {
"login": "github-api",
"id": 54909825,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1",
"avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/github-api",
"html_url": "https://github.com/github-api",
"followers_url": "https://api.github.com/users/github-api/followers",
"following_url": "https://api.github.com/users/github-api/following{/other_user}",
"gists_url": "https://api.github.com/users/github-api/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-api/subscriptions",
"organizations_url": "https://api.github.com/users/github-api/orgs",
"repos_url": "https://api.github.com/users/github-api/repos",
"events_url": "https://api.github.com/users/github-api/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-api/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/github-api/github-api",
"description": "Java API for GitHub",
"fork": false,
"url": "https://api.github.com/repos/github-api/github-api",
"forks_url": "https://api.github.com/repos/github-api/github-api/forks",
"keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/github-api/github-api/teams",
"hooks_url": "https://api.github.com/repos/github-api/github-api/hooks",
"issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}",
"events_url": "https://api.github.com/repos/github-api/github-api/events",
"assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}",
"branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}",
"tags_url": "https://api.github.com/repos/github-api/github-api/tags",
"blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}",
"languages_url": "https://api.github.com/repos/github-api/github-api/languages",
"stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers",
"contributors_url": "https://api.github.com/repos/github-api/github-api/contributors",
"subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers",
"subscription_url": "https://api.github.com/repos/github-api/github-api/subscription",
"commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}",
"compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/github-api/github-api/merges",
"archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/github-api/github-api/downloads",
"issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}",
"pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}",
"milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}",
"notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}",
"releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}",
"deployments_url": "https://api.github.com/repos/github-api/github-api/deployments",
"created_at": "2010-04-19T04:13:03Z",
"updated_at": "2020-02-20T00:01:44Z",
"pushed_at": "2020-02-20T00:01:51Z",
"git_url": "git://github.com/github-api/github-api.git",
"ssh_url": "git@github.com:github-api/github-api.git",
"clone_url": "https://github.com/github-api/github-api.git",
"svn_url": "https://github.com/github-api/github-api",
"homepage": "https://github-api.kohsuke.org/",
"size": 19361,
"stargazers_count": 613,
"watchers_count": 613,
"language": "Java",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": true,
"forks_count": 454,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 56,
"license": {
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"forks": 454,
"open_issues": 56,
"watchers": 613,
"default_branch": "master"
},
"network_count": 454,
"subscribers_count": 0
}

View File

@@ -0,0 +1,332 @@
{
"id": 206888201,
"node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=",
"name": "github-api",
"full_name": "github-api-test-org/github-api",
"private": false,
"owner": {
"login": "github-api-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/github-api-test-org",
"html_url": "https://github.com/github-api-test-org",
"followers_url": "https://api.github.com/users/github-api-test-org/followers",
"following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}",
"gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions",
"organizations_url": "https://api.github.com/users/github-api-test-org/orgs",
"repos_url": "https://api.github.com/users/github-api-test-org/repos",
"events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-api-test-org/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/github-api-test-org/github-api",
"description": "Tricky",
"fork": true,
"url": "https://api.github.com/repos/github-api-test-org/github-api",
"forks_url": "https://api.github.com/repos/github-api-test-org/github-api/forks",
"keys_url": "https://api.github.com/repos/github-api-test-org/github-api/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/github-api-test-org/github-api/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/github-api-test-org/github-api/teams",
"hooks_url": "https://api.github.com/repos/github-api-test-org/github-api/hooks",
"issue_events_url": "https://api.github.com/repos/github-api-test-org/github-api/issues/events{/number}",
"events_url": "https://api.github.com/repos/github-api-test-org/github-api/events",
"assignees_url": "https://api.github.com/repos/github-api-test-org/github-api/assignees{/user}",
"branches_url": "https://api.github.com/repos/github-api-test-org/github-api/branches{/branch}",
"tags_url": "https://api.github.com/repos/github-api-test-org/github-api/tags",
"blobs_url": "https://api.github.com/repos/github-api-test-org/github-api/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/github-api-test-org/github-api/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/github-api-test-org/github-api/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/github-api-test-org/github-api/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/github-api-test-org/github-api/statuses/{sha}",
"languages_url": "https://api.github.com/repos/github-api-test-org/github-api/languages",
"stargazers_url": "https://api.github.com/repos/github-api-test-org/github-api/stargazers",
"contributors_url": "https://api.github.com/repos/github-api-test-org/github-api/contributors",
"subscribers_url": "https://api.github.com/repos/github-api-test-org/github-api/subscribers",
"subscription_url": "https://api.github.com/repos/github-api-test-org/github-api/subscription",
"commits_url": "https://api.github.com/repos/github-api-test-org/github-api/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/github-api-test-org/github-api/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/github-api-test-org/github-api/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/github-api-test-org/github-api/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/github-api-test-org/github-api/contents/{+path}",
"compare_url": "https://api.github.com/repos/github-api-test-org/github-api/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/github-api-test-org/github-api/merges",
"archive_url": "https://api.github.com/repos/github-api-test-org/github-api/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/github-api-test-org/github-api/downloads",
"issues_url": "https://api.github.com/repos/github-api-test-org/github-api/issues{/number}",
"pulls_url": "https://api.github.com/repos/github-api-test-org/github-api/pulls{/number}",
"milestones_url": "https://api.github.com/repos/github-api-test-org/github-api/milestones{/number}",
"notifications_url": "https://api.github.com/repos/github-api-test-org/github-api/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/github-api-test-org/github-api/labels{/name}",
"releases_url": "https://api.github.com/repos/github-api-test-org/github-api/releases{/id}",
"deployments_url": "https://api.github.com/repos/github-api-test-org/github-api/deployments",
"created_at": "2019-09-06T23:26:04Z",
"updated_at": "2020-01-16T21:22:56Z",
"pushed_at": "2020-01-18T00:47:43Z",
"git_url": "git://github.com/github-api-test-org/github-api.git",
"ssh_url": "git@github.com:github-api-test-org/github-api.git",
"clone_url": "https://github.com/github-api-test-org/github-api.git",
"svn_url": "https://github.com/github-api-test-org/github-api",
"homepage": "http://github-api.kohsuke.org/",
"size": 11414,
"stargazers_count": 0,
"watchers_count": 0,
"language": "Java",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 3,
"license": {
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"forks": 0,
"open_issues": 3,
"watchers": 0,
"default_branch": "master",
"permissions": {
"admin": true,
"push": true,
"pull": true
},
"temp_clone_token": "",
"allow_squash_merge": true,
"allow_merge_commit": true,
"allow_rebase_merge": true,
"delete_branch_on_merge": false,
"organization": {
"login": "github-api-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/github-api-test-org",
"html_url": "https://github.com/github-api-test-org",
"followers_url": "https://api.github.com/users/github-api-test-org/followers",
"following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}",
"gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions",
"organizations_url": "https://api.github.com/users/github-api-test-org/orgs",
"repos_url": "https://api.github.com/users/github-api-test-org/repos",
"events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-api-test-org/received_events",
"type": "Organization",
"site_admin": false
},
"parent": {
"id": 617210,
"node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=",
"name": "github-api",
"full_name": "github-api/github-api",
"private": false,
"owner": {
"login": "github-api",
"id": 54909825,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1",
"avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/github-api",
"html_url": "https://github.com/github-api",
"followers_url": "https://api.github.com/users/github-api/followers",
"following_url": "https://api.github.com/users/github-api/following{/other_user}",
"gists_url": "https://api.github.com/users/github-api/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-api/subscriptions",
"organizations_url": "https://api.github.com/users/github-api/orgs",
"repos_url": "https://api.github.com/users/github-api/repos",
"events_url": "https://api.github.com/users/github-api/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-api/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/github-api/github-api",
"description": "Java API for GitHub",
"fork": false,
"url": "https://api.github.com/repos/github-api/github-api",
"forks_url": "https://api.github.com/repos/github-api/github-api/forks",
"keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/github-api/github-api/teams",
"hooks_url": "https://api.github.com/repos/github-api/github-api/hooks",
"issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}",
"events_url": "https://api.github.com/repos/github-api/github-api/events",
"assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}",
"branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}",
"tags_url": "https://api.github.com/repos/github-api/github-api/tags",
"blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}",
"languages_url": "https://api.github.com/repos/github-api/github-api/languages",
"stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers",
"contributors_url": "https://api.github.com/repos/github-api/github-api/contributors",
"subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers",
"subscription_url": "https://api.github.com/repos/github-api/github-api/subscription",
"commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}",
"compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/github-api/github-api/merges",
"archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/github-api/github-api/downloads",
"issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}",
"pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}",
"milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}",
"notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}",
"releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}",
"deployments_url": "https://api.github.com/repos/github-api/github-api/deployments",
"created_at": "2010-04-19T04:13:03Z",
"updated_at": "2020-02-20T00:01:44Z",
"pushed_at": "2020-02-20T00:01:51Z",
"git_url": "git://github.com/github-api/github-api.git",
"ssh_url": "git@github.com:github-api/github-api.git",
"clone_url": "https://github.com/github-api/github-api.git",
"svn_url": "https://github.com/github-api/github-api",
"homepage": "https://github-api.kohsuke.org/",
"size": 19361,
"stargazers_count": 613,
"watchers_count": 613,
"language": "Java",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": true,
"forks_count": 454,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 56,
"license": {
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"forks": 454,
"open_issues": 56,
"watchers": 613,
"default_branch": "master"
},
"source": {
"id": 617210,
"node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=",
"name": "github-api",
"full_name": "github-api/github-api",
"private": false,
"owner": {
"login": "github-api",
"id": 54909825,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1",
"avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/github-api",
"html_url": "https://github.com/github-api",
"followers_url": "https://api.github.com/users/github-api/followers",
"following_url": "https://api.github.com/users/github-api/following{/other_user}",
"gists_url": "https://api.github.com/users/github-api/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-api/subscriptions",
"organizations_url": "https://api.github.com/users/github-api/orgs",
"repos_url": "https://api.github.com/users/github-api/repos",
"events_url": "https://api.github.com/users/github-api/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-api/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/github-api/github-api",
"description": "Java API for GitHub",
"fork": false,
"url": "https://api.github.com/repos/github-api/github-api",
"forks_url": "https://api.github.com/repos/github-api/github-api/forks",
"keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/github-api/github-api/teams",
"hooks_url": "https://api.github.com/repos/github-api/github-api/hooks",
"issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}",
"events_url": "https://api.github.com/repos/github-api/github-api/events",
"assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}",
"branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}",
"tags_url": "https://api.github.com/repos/github-api/github-api/tags",
"blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}",
"languages_url": "https://api.github.com/repos/github-api/github-api/languages",
"stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers",
"contributors_url": "https://api.github.com/repos/github-api/github-api/contributors",
"subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers",
"subscription_url": "https://api.github.com/repos/github-api/github-api/subscription",
"commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}",
"compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/github-api/github-api/merges",
"archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/github-api/github-api/downloads",
"issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}",
"pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}",
"milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}",
"notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}",
"releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}",
"deployments_url": "https://api.github.com/repos/github-api/github-api/deployments",
"created_at": "2010-04-19T04:13:03Z",
"updated_at": "2020-02-20T00:01:44Z",
"pushed_at": "2020-02-20T00:01:51Z",
"git_url": "git://github.com/github-api/github-api.git",
"ssh_url": "git@github.com:github-api/github-api.git",
"clone_url": "https://github.com/github-api/github-api.git",
"svn_url": "https://github.com/github-api/github-api",
"homepage": "https://github-api.kohsuke.org/",
"size": 19361,
"stargazers_count": 613,
"watchers_count": 613,
"language": "Java",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": true,
"forks_count": 454,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 56,
"license": {
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"forks": 454,
"open_issues": 56,
"watchers": 613,
"default_branch": "master"
},
"network_count": 454,
"subscribers_count": 0
}

View File

@@ -0,0 +1,45 @@
{
"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": "https://twitter.com/bitwiseman",
"public_repos": 181,
"public_gists": 7,
"followers": 147,
"following": 9,
"created_at": "2012-07-11T20:38:33Z",
"updated_at": "2020-02-06T17:29:39Z",
"private_gists": 8,
"total_private_repos": 10,
"owned_private_repos": 0,
"disk_usage": 33697,
"collaborators": 0,
"two_factor_authentication": true,
"plan": {
"name": "free",
"space": 976562499,
"collaborators": 0,
"private_repos": 10000
}
}

View File

@@ -0,0 +1,51 @@
{
"metadata": {
"comment": "This header rate limit will be ignored because the reset is sooner than existing"
},
"id": "4c3594ea-179b-418f-b590-72e9a9a48494",
"name": "orgs_github-api-test-org",
"request": {
"url": "/orgs/github-api-test-org",
"method": "GET",
"headers": {
"Accept": {
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
}
}
},
"response": {
"status": 200,
"bodyFileName": "orgs_github-api-test-org-4c3594ea-179b-418f-b590-72e9a9a48494.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": "5000",
"X-RateLimit-Remaining": "4400",
"X-RateLimit-Reset": "{{testStartDate offset='4 seconds' format='unix'}}",
"Cache-Control": "private, max-age=60, s-maxage=60",
"Vary": [
"Accept, Authorization, Cookie, X-GitHub-OTP",
"Accept-Encoding, Accept, X-Requested-With"
],
"ETag": "W/\"75d6d979ad0098ece26e54f88ea58d8c\"",
"Last-Modified": "Mon, 20 Apr 2015 00:42:30 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",
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type",
"Access-Control-Allow-Origin": "*",
"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": "F8AD:9836:A3F7D9:C516A2:5E4DF170"
}
},
"uuid": "4c3594ea-179b-418f-b590-72e9a9a48494",
"persistent": true,
"insertionIndex": 3
}

View File

@@ -0,0 +1,49 @@
{
"metadata": {
"comment": "4502"
},
"id": "1d53365c-bbfd-409e-a07a-3dbf9ac73cb0",
"name": "rate_limit",
"request": {
"url": "/rate_limit",
"method": "GET",
"headers": {
"Accept": {
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
}
}
},
"response": {
"status": 200,
"body": "{\"resources\": {\"core\": {\"limit\": 5000,\"remaining\": 4502,\"reset\": {{testStartDate offset='5 seconds' format='unix'}} },\"search\": {\"limit\": 30,\"remaining\": 30,\"reset\": {{testStartDate offset='1 hours' format='unix'}} },\"graphql\": {\"limit\": 5000,\"remaining\": 5000,\"reset\": {{testStartDate offset='1 hours' format='unix'}} },\"integration_manifest\": {\"limit\": 5000,\"remaining\": 5000,\"reset\": {{testStartDate offset='1 hours' format='unix'}} } },\"rate\": {\"limit\": 5000,\"remaining\": 0,\"reset\": 1570478899}}",
"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": "5000",
"X-RateLimit-Remaining": "4502",
"X-RateLimit-Reset": "{{testStartDate offset='5 seconds' 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",
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type",
"Access-Control-Allow-Origin": "*",
"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": "F8AD:9836:A3F7BC:C51684:5E4DF16F"
}
},
"uuid": "1d53365c-bbfd-409e-a07a-3dbf9ac73cb0",
"persistent": true,
"scenarioName": "scenario-1-rate_limit",
"requiredScenarioState": "Started",
"newScenarioState": "scenario-1-rate_limit-2",
"insertionIndex": 1
}

View File

@@ -0,0 +1,49 @@
{
"metadata": {
"comment": ""
},
"id": "9ad3064d-ae78-4fc6-a6bc-20386f446f5e",
"name": "rate_limit",
"request": {
"url": "/rate_limit",
"method": "GET",
"headers": {
"Accept": {
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
}
}
},
"response": {
"status": 200,
"body": "{\"resources\": {\"core\": {\"limit\": 5000,\"remaining\": 4600,\"reset\": {{testStartDate offset='10 seconds' format='unix'}} },\"search\": {\"limit\": 30,\"remaining\": 30,\"reset\": {{testStartDate offset='1 hours' format='unix'}} },\"graphql\": {\"limit\": 5000,\"remaining\": 5000,\"reset\": {{testStartDate offset='1 hours' format='unix'}} },\"integration_manifest\": {\"limit\": 5000,\"remaining\": 5000,\"reset\": {{testStartDate offset='1 hours' format='unix'}} } },\"rate\": {\"limit\": 5000,\"remaining\": 0,\"reset\": 1570478899}}",
"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": "5000",
"X-RateLimit-Remaining": "4600",
"X-RateLimit-Reset": "{{testStartDate offset='10 seconds' 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",
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type",
"Access-Control-Allow-Origin": "*",
"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": "F8AD:9836:A3F7EB:C516B7:5E4DF170"
}
},
"uuid": "9ad3064d-ae78-4fc6-a6bc-20386f446f5e",
"persistent": true,
"scenarioName": "scenario-1-rate_limit",
"requiredScenarioState": "scenario-1-rate_limit-2",
"newScenarioState": "scenario-1-rate_limit-3",
"insertionIndex": 5
}

View File

@@ -0,0 +1,49 @@
{
"metadata": {
"comment": "The checker should loop again. reset date passed but we're still below limit."
},
"id": "594da3ac-e1d8-4276-8fbd-844c1ec9087d",
"name": "rate_limit",
"request": {
"url": "/rate_limit",
"method": "GET",
"headers": {
"Accept": {
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
}
}
},
"response": {
"status": 200,
"body": "{\"resources\": {\"core\": {\"limit\": 5000,\"remaining\": 4450,\"reset\": {{testStartDate offset='12 seconds' format='unix'}} },\"search\": {\"limit\": 30,\"remaining\": 30,\"reset\": {{testStartDate offset='1 hours' format='unix'}} },\"graphql\": {\"limit\": 5000,\"remaining\": 5000,\"reset\": {{testStartDate offset='1 hours' format='unix'}} },\"integration_manifest\": {\"limit\": 5000,\"remaining\": 5000,\"reset\": {{testStartDate offset='1 hours' format='unix'}} } },\"rate\": {\"limit\": 5000,\"remaining\": 0,\"reset\": 1570478899}}",
"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": "5000",
"X-RateLimit-Remaining": "4450",
"X-RateLimit-Reset": "{{testStartDate offset='12 seconds' 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",
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type",
"Access-Control-Allow-Origin": "*",
"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": "F8AD:9836:A3F800:C516CE:5E4DF171"
}
},
"uuid": "594da3ac-e1d8-4276-8fbd-844c1ec9087d",
"persistent": true,
"scenarioName": "scenario-1-rate_limit",
"requiredScenarioState": "scenario-1-rate_limit-3",
"newScenarioState": "scenario-1-rate_limit-4",
"insertionIndex": 7
}

View File

@@ -0,0 +1,48 @@
{
"metadata": {
"comment": ""
},
"id": "e5ec63c2-6a61-4259-bb08-524f3b4050e5",
"name": "rate_limit",
"request": {
"url": "/rate_limit",
"method": "GET",
"headers": {
"Accept": {
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
}
}
},
"response": {
"status": 200,
"body": "{\"resources\": {\"core\": {\"limit\": 5000,\"remaining\": 4550,\"reset\": {{testStartDate offset='16 seconds' format='unix'}} },\"search\": {\"limit\": 30,\"remaining\": 30,\"reset\": {{testStartDate offset='1 hours' format='unix'}} },\"graphql\": {\"limit\": 5000,\"remaining\": 5000,\"reset\": {{testStartDate offset='1 hours' format='unix'}} },\"integration_manifest\": {\"limit\": 5000,\"remaining\": 5000,\"reset\": {{testStartDate offset='1 hours' format='unix'}} } },\"rate\": {\"limit\": 5000,\"remaining\": 0,\"reset\": 1570478899}}",
"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": "5000",
"X-RateLimit-Remaining": "4550",
"X-RateLimit-Reset": "{{testStartDate offset='16 seconds' 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",
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type",
"Access-Control-Allow-Origin": "*",
"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": "F8AD:9836:A3F81A:C516E6:5E4DF171"
}
},
"uuid": "e5ec63c2-6a61-4259-bb08-524f3b4050e5",
"persistent": true,
"scenarioName": "scenario-1-rate_limit",
"requiredScenarioState": "scenario-1-rate_limit-4",
"insertionIndex": 9
}

View File

@@ -0,0 +1,54 @@
{
"metadata": {
"comment": ""
},
"id": "1b4d33fb-f043-4d57-ac9a-0e2aa6d72c49",
"name": "repos_github-api-test-org_github-api",
"request": {
"url": "/repos/github-api-test-org/github-api",
"method": "GET",
"headers": {
"Accept": {
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
}
}
},
"response": {
"status": 200,
"bodyFileName": "repos_github-api-test-org_github-api-1b4d33fb-f043-4d57-ac9a-0e2aa6d72c49.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": "5000",
"X-RateLimit-Remaining": "4500",
"X-RateLimit-Reset": "{{testStartDate offset='5 seconds' format='unix'}}",
"Cache-Control": "private, max-age=60, s-maxage=60",
"Vary": [
"Accept, Authorization, Cookie, X-GitHub-OTP",
"Accept-Encoding, Accept, X-Requested-With"
],
"ETag": "W/\"eefece3fddefad3b444f380f2ddca84a\"",
"Last-Modified": "Thu, 16 Jan 2020 21:22:56 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": "repo",
"X-GitHub-Media-Type": "unknown, github.v3",
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type",
"Access-Control-Allow-Origin": "*",
"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": "F8AD:9836:A3F7DF:C516AA:5E4DF170"
}
},
"uuid": "1b4d33fb-f043-4d57-ac9a-0e2aa6d72c49",
"persistent": true,
"scenarioName": "scenario-2-repos-github-api-test-org-github-api",
"requiredScenarioState": "Started",
"newScenarioState": "scenario-2-repos-github-api-test-org-github-api-2",
"insertionIndex": 4
}

View File

@@ -0,0 +1,54 @@
{
"metadata": {
"comment": "This header rate limit will be used because the limit is lower than previous"
},
"id": "7c83f0f2-98d8-4cea-b681-56f37210c2dc",
"name": "repos_github-api-test-org_github-api",
"request": {
"url": "/repos/github-api-test-org/github-api",
"method": "GET",
"headers": {
"Accept": {
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
}
}
},
"response": {
"status": 200,
"bodyFileName": "repos_github-api-test-org_github-api-7c83f0f2-98d8-4cea-b681-56f37210c2dc.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": "5000",
"X-RateLimit-Remaining": "4400",
"X-RateLimit-Reset": "{{testStartDate offset='10 seconds' format='unix'}}",
"Cache-Control": "private, max-age=60, s-maxage=60",
"Vary": [
"Accept, Authorization, Cookie, X-GitHub-OTP",
"Accept-Encoding, Accept, X-Requested-With"
],
"ETag": "W/\"eefece3fddefad3b444f380f2ddca84a\"",
"Last-Modified": "Thu, 16 Jan 2020 21:22:56 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": "repo",
"X-GitHub-Media-Type": "unknown, github.v3",
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type",
"Access-Control-Allow-Origin": "*",
"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": "F8AD:9836:A3F7F4:C516C3:5E4DF170"
}
},
"uuid": "7c83f0f2-98d8-4cea-b681-56f37210c2dc",
"persistent": true,
"scenarioName": "scenario-2-repos-github-api-test-org-github-api",
"requiredScenarioState": "scenario-2-repos-github-api-test-org-github-api-2",
"newScenarioState": "scenario-2-repos-github-api-test-org-github-api-3",
"insertionIndex": 6
}

View File

@@ -0,0 +1,53 @@
{
"metadata": {
"comment": "This header limit will override the existing record because this is later"
},
"id": "12f5b993-ee6d-470b-bd7a-016bbdbe42e8",
"name": "repos_github-api-test-org_github-api",
"request": {
"url": "/repos/github-api-test-org/github-api",
"method": "GET",
"headers": {
"Accept": {
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
}
}
},
"response": {
"status": 200,
"bodyFileName": "repos_github-api-test-org_github-api-12f5b993-ee6d-470b-bd7a-016bbdbe42e8.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": "5000",
"X-RateLimit-Remaining": "4601",
"X-RateLimit-Reset": "{{testStartDate offset='20 seconds' format='unix'}}",
"Cache-Control": "private, max-age=60, s-maxage=60",
"Vary": [
"Accept, Authorization, Cookie, X-GitHub-OTP",
"Accept-Encoding, Accept, X-Requested-With"
],
"ETag": "W/\"eefece3fddefad3b444f380f2ddca84a\"",
"Last-Modified": "Thu, 16 Jan 2020 21:22:56 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": "repo",
"X-GitHub-Media-Type": "unknown, github.v3",
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type",
"Access-Control-Allow-Origin": "*",
"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": "F8AD:9836:A3F807:C516D6:5E4DF171"
}
},
"uuid": "12f5b993-ee6d-470b-bd7a-016bbdbe42e8",
"persistent": true,
"scenarioName": "scenario-2-repos-github-api-test-org-github-api",
"requiredScenarioState": "scenario-2-repos-github-api-test-org-github-api-3",
"insertionIndex": 8
}

View File

@@ -0,0 +1,48 @@
{
"id": "9a879079-539d-4629-b873-8d92967da94c",
"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-9a879079-539d-4629-b873-8d92967da94c.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": "5000",
"X-RateLimit-Remaining": "4501",
"X-RateLimit-Reset": "{{testStartDate offset='5 seconds' format='unix'}}",
"Cache-Control": "private, max-age=60, s-maxage=60",
"Vary": [
"Accept, Authorization, Cookie, X-GitHub-OTP",
"Accept-Encoding, Accept, X-Requested-With"
],
"ETag": "W/\"e87e4a976abe11bf6f62d5a01a679780\"",
"Last-Modified": "Thu, 06 Feb 2020 17:29:39 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",
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type",
"Access-Control-Allow-Origin": "*",
"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": "F8AD:9836:A3F7D1:C5168A:5E4DF16F"
}
},
"uuid": "9a879079-539d-4629-b873-8d92967da94c",
"persistent": true,
"insertionIndex": 2
},