Skip to content

Navigation Menu

Sign in
Appearance settings

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

Provide feedback

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

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ce7cfc0

Browse filesBrowse files
authored
Merge branch 'master' into complete-checks-api
2 parents f54bfd3 + 8b6cf55 commit ce7cfc0
Copy full SHA for ce7cfc0
Expand file treeCollapse file tree

20 files changed

+187
-136
lines changed

‎pom.xml

Copy file name to clipboardExpand all lines: pom.xml
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<formatter-maven-plugin.goal>format</formatter-maven-plugin.goal>
4343
<impsort-maven-plugin.goal>sort</impsort-maven-plugin.goal>
4444
<!-- Using this as the minimum bar for code coverage. Adding methods without covering them will fail this. -->
45-
<jacoco.coverage.target.bundle.method>0.556</jacoco.coverage.target.bundle.method>
45+
<jacoco.coverage.target.bundle.method>0.60</jacoco.coverage.target.bundle.method>
4646
<jacoco.coverage.target.class.method>0.25</jacoco.coverage.target.class.method>
4747
<!-- For non-ci builds we'd like the build to still complete if jacoco metrics aren't met. -->
4848
<jacoco.haltOnFailure>false</jacoco.haltOnFailure>
@@ -146,22 +146,19 @@
146146
<exclude>org.kohsuke.github.example.*</exclude>
147147

148148
<!-- No methods -->
149-
<exclude>org.kohsuke.github.DeleteToken</exclude>
150149
<exclude>org.kohsuke.github.Previews</exclude>
151150

152151
<!-- Deprecated -->
153152
<exclude>org.kohsuke.github.extras.OkHttp3Connector</exclude>
154153
<exclude>org.kohsuke.github.EnforcementLevel</exclude>
155154
<exclude>org.kohsuke.github.GHPerson.1</exclude>
156-
<exclude>org.kohsuke.github.GHPerson.1.1</exclude>
157155

158156
<!-- These fail coverage on windows because tests are disabled -->
159157
<exclude>org.kohsuke.github.GHAsset</exclude>
160158
<exclude>org.kohsuke.github.GHReleaseBuilder</exclude>
161159
<exclude>org.kohsuke.github.GHRelease</exclude>
162160

163161
<!-- TODO: These still need test coverage -->
164-
<exclude>org.kohsuke.github.GitHubClient.GHApiInfo</exclude>
165162
<exclude>org.kohsuke.github.GHBranchProtection.RequiredSignatures</exclude>
166163
<exclude>org.kohsuke.github.GHBranchProtectionBuilder.Restrictions</exclude>
167164
<exclude>org.kohsuke.github.GHBranchProtection.Restrictions</exclude>
@@ -202,7 +199,6 @@
202199
<exclude>org.kohsuke.github.GHTeam.Role</exclude>
203200
<exclude>org.kohsuke.github.GHUserSearchBuilder.Sort</exclude>
204201
<exclude>org.kohsuke.github.GHVerifiedKey</exclude>
205-
<exclude>org.kohsuke.github.GitHubBuilder.1</exclude>
206202
</excludes>
207203
</rule>
208204
</rules>

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/DeleteToken.java
-34Lines changed: 0 additions & 34 deletions
This file was deleted.

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHDeploymentStatusBuilder.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class GHDeploymentStatusBuilder {
2323
* the state
2424
* @deprecated Use {@link GHDeployment#createStatus(GHDeploymentState)}
2525
*/
26+
@Deprecated
2627
public GHDeploymentStatusBuilder(GHRepository repo, int deploymentId, GHDeploymentState state) {
2728
this(repo, (long) deploymentId, state);
2829
}

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHIssue.java
+2-11Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,14 @@ public class GHIssue extends GHObject implements Reactable {
6363
protected int comments;
6464
@SkipFromToString
6565
protected String body;
66-
// for backward compatibility with < 1.63, this collection needs to hold instances of Label, not GHLabel
67-
protected List<Label> labels;
66+
protected List<GHLabel> labels;
6867
protected GHUser user;
6968
protected String title, html_url;
7069
protected GHIssue.PullRequest pull_request;
7170
protected GHMilestone milestone;
7271
protected GHUser closed_by;
7372
protected boolean locked;
7473

75-
/**
76-
* The type Label.
77-
*
78-
* @deprecated use {@link GHLabel}
79-
*/
80-
public static class Label extends GHLabel {
81-
}
82-
8374
GHIssue wrap(GHRepository owner) {
8475
this.owner = owner;
8576
if (milestone != null)
@@ -172,7 +163,7 @@ public Collection<GHLabel> getLabels() throws IOException {
172163
if (labels == null) {
173164
return Collections.emptyList();
174165
}
175-
return Collections.<GHLabel>unmodifiableList(labels);
166+
return Collections.unmodifiableList(labels);
176167
}
177168

178169
/**

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHMyself.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ public PagedIterable<GHRepository> listRepositories(final int pageSize, final Re
189189
* @return the paged iterable
190190
* @deprecated Use {@link #listRepositories()}
191191
*/
192+
@Deprecated
192193
public PagedIterable<GHRepository> listAllRepositories() {
193194
return listRepositories();
194195
}

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHOrganization.java
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ GHOrganization wrapUp(GitHub root) {
3838
* the io exception
3939
* @deprecated Use {@link #createRepository(String)} that uses a builder pattern to let you control every aspect.
4040
*/
41+
@Deprecated
4142
public GHRepository createRepository(String name,
4243
String description,
4344
String homepage,
@@ -67,6 +68,7 @@ public GHRepository createRepository(String name,
6768
* the io exception
6869
* @deprecated Use {@link #createRepository(String)} that uses a builder pattern to let you control every aspect.
6970
*/
71+
@Deprecated
7072
public GHRepository createRepository(String name,
7173
String description,
7274
String homepage,

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHPerson.java
+24-33Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import java.io.IOException;
55
import java.net.MalformedURLException;
66
import java.net.URL;
7-
import java.util.Arrays;
87
import java.util.Collections;
98
import java.util.Date;
109
import java.util.Iterator;
@@ -20,7 +19,7 @@ public abstract class GHPerson extends GHObject {
2019
/* package almost final */ GitHub root;
2120

2221
// core data fields that exist even for "small" user data (such as the user info in pull request)
23-
protected String login, avatar_url, gravatar_id;
22+
protected String login, avatar_url;
2423

2524
// other fields (that only show up in full data)
2625
protected String location, blog, email, name, company, type;
@@ -115,31 +114,27 @@ public PagedIterable<GHRepository> listRepositories(final int pageSize) {
115114
*/
116115
@Deprecated
117116
public synchronized Iterable<List<GHRepository>> iterateRepositories(final int pageSize) {
118-
return new Iterable<List<GHRepository>>() {
119-
public Iterator<List<GHRepository>> iterator() {
120-
final Iterator<GHRepository[]> pager;
121-
try {
122-
pager = GitHubPageIterator.create(root.getClient(),
123-
GHRepository[].class,
124-
root.createRequest().withUrlPath("users", login, "repos").build(),
125-
pageSize);
126-
} catch (MalformedURLException e) {
127-
throw new GHException("Unable to build GitHub API URL", e);
117+
return () -> {
118+
final PagedIterator<GHRepository> pager;
119+
try {
120+
GitHubPageIterator<GHRepository[]> iterator = GitHubPageIterator.create(root.getClient(),
121+
GHRepository[].class,
122+
root.createRequest().withUrlPath("users", login, "repos").build(),
123+
pageSize);
124+
pager = new PagedIterator<>(iterator, item -> item.wrap(root));
125+
} catch (MalformedURLException e) {
126+
throw new GHException("Unable to build GitHub API URL", e);
127+
}
128+
129+
return new Iterator<List<GHRepository>>() {
130+
public boolean hasNext() {
131+
return pager.hasNext();
128132
}
129133

130-
return new Iterator<List<GHRepository>>() {
131-
public boolean hasNext() {
132-
return pager.hasNext();
133-
}
134-
135-
public List<GHRepository> next() {
136-
GHRepository[] batch = pager.next();
137-
for (GHRepository r : batch)
138-
r.root = root;
139-
return Arrays.asList(batch);
140-
}
141-
};
142-
}
134+
public List<GHRepository> next() {
135+
return pager.nextPage();
136+
}
137+
};
143138
};
144139
}
145140

@@ -178,22 +173,18 @@ public GHRepository getRepository(String name) throws IOException {
178173
* @return the gravatar id
179174
* @deprecated No longer available in the v3 API.
180175
*/
176+
@Deprecated
181177
public String getGravatarId() {
182-
return gravatar_id;
178+
return "";
183179
}
184180

185181
/**
186-
* Returns a string like 'https://secure.gravatar.com/avatar/0cb9832a01c22c083390f3c5dcb64105' that indicates the
187-
* avatar image URL.
182+
* Returns a string of the avatar image URL.
188183
*
189184
* @return the avatar url
190185
*/
191186
public String getAvatarUrl() {
192-
if (avatar_url != null)
193-
return avatar_url;
194-
if (gravatar_id != null)
195-
return "https://secure.gravatar.com/avatar/" + gravatar_id;
196-
return null;
187+
return avatar_url;
197188
}
198189

199190
/**

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHPullRequest.java
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ public PagedIterable<GHPullRequestCommitDetail> listCommits() {
452452
* the io exception
453453
* @deprecated Use {@link #createReview()}
454454
*/
455+
@Deprecated
455456
public GHPullRequestReview createReview(String body,
456457
@CheckForNull GHPullRequestReviewState event,
457458
GHPullRequestReviewComment... comments) throws IOException {
@@ -472,6 +473,7 @@ public GHPullRequestReview createReview(String body,
472473
* the io exception
473474
* @deprecated Use {@link #createReview()}
474475
*/
476+
@Deprecated
475477
public GHPullRequestReview createReview(String body,
476478
@CheckForNull GHPullRequestReviewState event,
477479
List<GHPullRequestReviewComment> comments) throws IOException {

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHPullRequestReview.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ public Date getCreatedAt() throws IOException {
145145
* @deprecated Former preview method that changed when it got public. Left here for backward compatibility. Use
146146
* {@link #submit(String, GHPullRequestReviewEvent)}
147147
*/
148+
@Deprecated
148149
public void submit(String body, GHPullRequestReviewState state) throws IOException {
149150
submit(body, state.toEvent());
150151
}

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHPullRequestReviewComment.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public class GHPullRequestReviewComment extends GHObject implements Reactable {
5959
* @return the gh pull request review comment
6060
* @deprecated You should be using {@link GHPullRequestReviewBuilder#comment(String, String, int)}
6161
*/
62+
@Deprecated
6263
public static GHPullRequestReviewComment draft(String body, String path, int position) {
6364
GHPullRequestReviewComment result = new GHPullRequestReviewComment();
6465
result.body = body;

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHRelease.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public boolean isDraft() {
7171
* the io exception
7272
* @deprecated Use {@link #update()}
7373
*/
74+
@Deprecated
7475
public GHRelease setDraft(boolean draft) throws IOException {
7576
return update().draft(draft).update();
7677
}

0 commit comments

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