diff --git a/CHANGELOG.md b/CHANGELOG.md index 82265ac52..a9200950a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,7 @@ are in-flight (dependency on Jenkins Core v2.167) ## Version 2.5.3 Release date: 2019-05-23 -- [JENKINS-57583](https://issues.jenkins-ci.org/browse/JENKINS-57583): Fixed compatibility with the "Ignore target brach" setting +- [JENKINS-57583](https://issues.jenkins-ci.org/browse/JENKINS-57583): Fixed compatibility with the "Ignore target branch" setting - [JENKINS-57371](https://issues.jenkins-ci.org/browse/JENKINS-57371): Added graceful fallback to cloning for PRs when needed diff --git a/src/main/java/org/jenkinsci/plugins/github_branch_source/Endpoint.java b/src/main/java/org/jenkinsci/plugins/github_branch_source/Endpoint.java index f5ba146d6..de6cef566 100644 --- a/src/main/java/org/jenkinsci/plugins/github_branch_source/Endpoint.java +++ b/src/main/java/org/jenkinsci/plugins/github_branch_source/Endpoint.java @@ -129,9 +129,9 @@ public int hashCode() { } @Extension - public static class DesciptorImpl extends Descriptor { + public static class DescriptorImpl extends Descriptor { - private static final Logger LOGGER = Logger.getLogger(DesciptorImpl.class.getName()); + private static final Logger LOGGER = Logger.getLogger(DescriptorImpl.class.getName()); @Override public String getDisplayName() { diff --git a/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java b/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java index 711eb39c2..fe8c151ea 100644 --- a/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java +++ b/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java @@ -1016,7 +1016,7 @@ public SCMSourceCriteria.Probe create(@NonNull BranchSCMHead head, // Branches and tags are contained only the current repo, PRs go across forks // FileNotFoundException can occur in a number of situations // When this happens, it is not ideal behavior but it is better to let the PR be orphaned - // and the the orphan stratgy control the result than for this error to stop scanning + // and the orphan strategy control the result than for this error to stop scanning // (For Org scanning this is particularly important.) // If some more general IO exception is thrown, we will still fail. @@ -2343,7 +2343,7 @@ protected Iterable create() { if (pullRequest.getState() != GHIssueState.OPEN) { return Collections.emptyList(); } - return new CacheUdatingIterable(Collections.singletonList(pullRequest)); + return new CacheUpdatingIterable(Collections.singletonList(pullRequest)); } Set branchNames = request.getRequestedOriginBranchNames(); if (branchNames != null && branchNames.size() == 1) { // TODO flag to check PRs are all origin PRs @@ -2354,14 +2354,14 @@ protected Iterable create() { request.listener().getLogger().format( "%n Getting remote pull requests from branch %s...%n", branchName ); - return new CacheUdatingIterable(repo.queryPullRequests() + return new CacheUpdatingIterable(repo.queryPullRequests() .state(GHIssueState.OPEN) .head(repo.getOwnerName() + ":" + branchName) .list()); } request.listener().getLogger().format("%n Getting remote pull requests...%n"); fullScanRequested = true; - return new CacheUdatingIterable(LazyPullRequests.this.repo.queryPullRequests() + return new CacheUpdatingIterable(LazyPullRequests.this.repo.queryPullRequests() .state(GHIssueState.OPEN) .list()); } catch (IOException | InterruptedException e) { @@ -2385,12 +2385,12 @@ public void close() throws IOException { } } - private class CacheUdatingIterable extends SinglePassIterable { + private class CacheUpdatingIterable extends SinglePassIterable { /** * A map of all fully populated {@link GHUser} entries we have fetched, keyed by {@link GHUser#getLogin()}. */ private Map users = new HashMap<>(); - CacheUdatingIterable(Iterable delegate) { + CacheUpdatingIterable(Iterable delegate) { super(delegate); } diff --git a/src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMRevision.java b/src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMRevision.java index 5efb99056..2ad6c0230 100644 --- a/src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMRevision.java +++ b/src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMRevision.java @@ -114,7 +114,7 @@ public boolean equivalent(ChangeRequestSCMRevision o) { } PullRequestSCMRevision other = (PullRequestSCMRevision) o; - // JENKINS-57583 - Equivalent is used to make decisiions about when to build. + // JENKINS-57583 - Equivalent is used to make decisions about when to build. // mergeHash is an implementation detail of github, generated from base and target // If only mergeHash changes we do not consider it a different revision return getHead().equals(other.getHead()) && pullHash.equals(other.pullHash); diff --git a/src/main/java/org/jenkinsci/plugins/github_branch_source/PushGHEventSubscriber.java b/src/main/java/org/jenkinsci/plugins/github_branch_source/PushGHEventSubscriber.java index d88144700..582bedfdc 100644 --- a/src/main/java/org/jenkinsci/plugins/github_branch_source/PushGHEventSubscriber.java +++ b/src/main/java/org/jenkinsci/plugins/github_branch_source/PushGHEventSubscriber.java @@ -331,7 +331,7 @@ && isApiMatch(((GitHubSCMSource) source).getApiUri()) // // Event consumers are supposed to *not* trust the details reported by an event, it's just a hint. // All we really want is that we report enough of a head to provide the head.getName() - // then the event consumer is supposed to turn arround and do a fetch(..., event, ...) + // then the event consumer is supposed to turn around and do a fetch(..., event, ...) // and as GitHubSCMSourceRequest strips out the timestamp in calculating the requested // tag names, we have a winner. // diff --git a/src/main/java/org/jenkinsci/plugins/github_branch_source/RepositoryUriResolver.java b/src/main/java/org/jenkinsci/plugins/github_branch_source/RepositoryUriResolver.java index 2a75e048d..b91cf15d3 100644 --- a/src/main/java/org/jenkinsci/plugins/github_branch_source/RepositoryUriResolver.java +++ b/src/main/java/org/jenkinsci/plugins/github_branch_source/RepositoryUriResolver.java @@ -30,7 +30,7 @@ import java.net.URL; /** - * Resolves the URI of a GitHub repositort from the API URI, owner and repository name. + * Resolves the URI of a GitHub repository from the API URI, owner and repository name. */ public abstract class RepositoryUriResolver { diff --git a/src/main/webapp/github-scm-source.js b/src/main/webapp/github-scm-source.js index 1025f39a0..6774e541e 100644 --- a/src/main/webapp/github-scm-source.js +++ b/src/main/webapp/github-scm-source.js @@ -37,7 +37,7 @@ Behaviour.specify("input[name$=_configuredByUrlRadio]", 'GitHubSCMSourceRadioCon if (document.createEvent) { var oEvent = document.createEvent("HTMLEvents"); oEvent.initEvent("change"); - // Gets the first Jelly entry afte the hidden value + // Gets the first Jelly entry after the hidden value var repoOwner = getNthParent(e, 3).nextElementSibling.nextElementSibling.childNodes[2].firstElementChild; // if the first entry is a select for API URI, gets the following one (each Jelly entry has 3 elements) if (repoOwner == null || repoOwner.tagName == "SELECT") { diff --git a/src/test/java/org/jenkinsci/plugins/github_branch_source/ApiRateLimitCheckerTest.java b/src/test/java/org/jenkinsci/plugins/github_branch_source/ApiRateLimitCheckerTest.java index 545df4914..dacbbbfc4 100644 --- a/src/test/java/org/jenkinsci/plugins/github_branch_source/ApiRateLimitCheckerTest.java +++ b/src/test/java/org/jenkinsci/plugins/github_branch_source/ApiRateLimitCheckerTest.java @@ -404,7 +404,7 @@ public void OnOverThrottleTimingRateLimitCheck() throws Exception { ApiRateLimitChecker.ThrottleOnOver.checkApiRateLimit(listener, github); } - //should be no ouput + //should be no output assertEquals(0, countOfOutputLinesContaining("Sleeping")); // check rate limit to hit the next 5 scenarios @@ -525,9 +525,9 @@ public void NormalizeExpectedIdealOverTime() throws Exception { // Expect a triggered throttle for normalize assertEquals(12, countOfOutputLinesContaining("Current quota")); - //Making sure the budgets are correct + // Making sure the budgets are correct assertEquals(12, countOfOutputLinesContaining("0 under budget")); - // no occurences of sleeping + // no occurrences of sleeping assertEquals(0, countOfOutputLines(m -> m.matches("[sS]leeping"))); } diff --git a/src/test/java/org/jenkinsci/plugins/github_branch_source/BranchDiscoveryTraitTest.java b/src/test/java/org/jenkinsci/plugins/github_branch_source/BranchDiscoveryTraitTest.java index 0343fbe18..890a83953 100644 --- a/src/test/java/org/jenkinsci/plugins/github_branch_source/BranchDiscoveryTraitTest.java +++ b/src/test/java/org/jenkinsci/plugins/github_branch_source/BranchDiscoveryTraitTest.java @@ -23,7 +23,7 @@ public class BranchDiscoveryTraitTest { public static JenkinsRule j = new JenkinsRule(); @Test - public void given__disoverAll__when__appliedToContext__then__noFilter() throws Exception { + public void given__discoverAll__when__appliedToContext__then__noFilter() throws Exception { GitHubSCMSourceContext ctx = new GitHubSCMSourceContext(null, SCMHeadObserver.none()); assumeThat(ctx.wantBranches(), is(false)); assumeThat(ctx.wantPRs(), is(false)); diff --git a/src/test/java/org/jenkinsci/plugins/github_branch_source/ForkPullRequestDiscoveryTraitTest.java b/src/test/java/org/jenkinsci/plugins/github_branch_source/ForkPullRequestDiscoveryTraitTest.java index 8579947eb..853db3ee3 100644 --- a/src/test/java/org/jenkinsci/plugins/github_branch_source/ForkPullRequestDiscoveryTraitTest.java +++ b/src/test/java/org/jenkinsci/plugins/github_branch_source/ForkPullRequestDiscoveryTraitTest.java @@ -26,7 +26,7 @@ public void xstream() throws Exception { } @Test - public void given__disoverHeadMerge__when__appliedToContext__then__strategiesCorrect() throws Exception { + public void given__discoverHeadMerge__when__appliedToContext__then__strategiesCorrect() throws Exception { GitHubSCMSourceContext ctx = new GitHubSCMSourceContext(null, SCMHeadObserver.none()); assumeThat(ctx.wantBranches(), is(false)); assumeThat(ctx.wantPRs(), is(false)); @@ -51,7 +51,7 @@ public void given__disoverHeadMerge__when__appliedToContext__then__strategiesCor } @Test - public void given__disoverHeadOnly__when__appliedToContext__then__strategiesCorrect() throws Exception { + public void given__discoverHeadOnly__when__appliedToContext__then__strategiesCorrect() throws Exception { GitHubSCMSourceContext ctx = new GitHubSCMSourceContext(null, SCMHeadObserver.none()); assumeThat(ctx.wantBranches(), is(false)); assumeThat(ctx.wantPRs(), is(false)); @@ -76,7 +76,7 @@ public void given__disoverHeadOnly__when__appliedToContext__then__strategiesCorr } @Test - public void given__disoverMergeOnly__when__appliedToContext__then__strategiesCorrect() throws Exception { + public void given__discoverMergeOnly__when__appliedToContext__then__strategiesCorrect() throws Exception { GitHubSCMSourceContext ctx = new GitHubSCMSourceContext(null, SCMHeadObserver.none()); assumeThat(ctx.wantBranches(), is(false)); assumeThat(ctx.wantPRs(), is(false)); diff --git a/src/test/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMFileSystemTest.java b/src/test/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMFileSystemTest.java index ff40011a6..93f3c5ee7 100644 --- a/src/test/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMFileSystemTest.java +++ b/src/test/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMFileSystemTest.java @@ -232,7 +232,7 @@ public void readFileFromDir() throws Exception { // the checkout may have "fixed" line endings that we needed to handle. // The problem with the raw url data is that it can get out of sync when from the actual content. // The GitHub API info stays sync'd and correct, so now GHContent.read() pulls from mime encoded data - // in the GHContent record itself. Keeping this for refence in case it changes again. + // in the GHContent record itself. Keeping this for reference in case it changes again. // try (InputStream inputStream = getClass().getResourceAsStream("/raw/__files/body-fu-bar.txt-b4k4I.txt")) { // if (inputStream != null) { // expected = IOUtils.toString(inputStream, StandardCharsets.US_ASCII); diff --git a/src/test/java/org/jenkinsci/plugins/github_branch_source/GithubSCMSourceTagsTest.java b/src/test/java/org/jenkinsci/plugins/github_branch_source/GithubSCMSourceTagsTest.java index 3217072e6..d08bba084 100644 --- a/src/test/java/org/jenkinsci/plugins/github_branch_source/GithubSCMSourceTagsTest.java +++ b/src/test/java/org/jenkinsci/plugins/github_branch_source/GithubSCMSourceTagsTest.java @@ -149,7 +149,7 @@ public void testExistingMultipleTags() throws IOException { } @Test - public void testExistingMultipleTagsGHFileNotFoundExceptionIteratable() throws IOException { + public void testExistingMultipleTagsGHFileNotFoundExceptionIterable() throws IOException { // Scenario: Requesting multiple tags but a FileNotFound is thrown // on the first returning the iterator and then an IO error is thrown on the iterator creation SCMHeadObserver mockSCMHeadObserver = Mockito.mock(SCMHeadObserver.class); diff --git a/src/test/java/org/jenkinsci/plugins/github_branch_source/OriginPullRequestDiscoveryTraitTest.java b/src/test/java/org/jenkinsci/plugins/github_branch_source/OriginPullRequestDiscoveryTraitTest.java index 9b3f9fe5b..e4fb560cd 100644 --- a/src/test/java/org/jenkinsci/plugins/github_branch_source/OriginPullRequestDiscoveryTraitTest.java +++ b/src/test/java/org/jenkinsci/plugins/github_branch_source/OriginPullRequestDiscoveryTraitTest.java @@ -20,7 +20,7 @@ public class OriginPullRequestDiscoveryTraitTest { @Test - public void given__disoverHeadMerge__when__appliedToContext__then__strategiesCorrect() throws Exception { + public void given__discoverHeadMerge__when__appliedToContext__then__strategiesCorrect() throws Exception { GitHubSCMSourceContext ctx = new GitHubSCMSourceContext(null, SCMHeadObserver.none()); assumeThat(ctx.wantBranches(), is(false)); assumeThat(ctx.wantPRs(), is(false)); @@ -44,7 +44,7 @@ public void given__disoverHeadMerge__when__appliedToContext__then__strategiesCor } @Test - public void given__disoverHeadOnly__when__appliedToContext__then__strategiesCorrect() throws Exception { + public void given__discoverHeadOnly__when__appliedToContext__then__strategiesCorrect() throws Exception { GitHubSCMSourceContext ctx = new GitHubSCMSourceContext(null, SCMHeadObserver.none()); assumeThat(ctx.wantBranches(), is(false)); assumeThat(ctx.wantPRs(), is(false)); @@ -68,7 +68,7 @@ public void given__disoverHeadOnly__when__appliedToContext__then__strategiesCorr } @Test - public void given__disoverMergeOnly__when__appliedToContext__then__strategiesCorrect() throws Exception { + public void given__discoverMergeOnly__when__appliedToContext__then__strategiesCorrect() throws Exception { GitHubSCMSourceContext ctx = new GitHubSCMSourceContext(null, SCMHeadObserver.none()); assumeThat(ctx.wantBranches(), is(false)); assumeThat(ctx.wantPRs(), is(false));