From df963cb71cd0495a255ad1dda74358c3cfb5b7e5 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Fri, 5 Aug 2016 21:32:15 -0700 Subject: [PATCH 1/4] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3a637f2227..e24d8f1748 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ github-api - 1.77 + 1.78-SNAPSHOT GitHub API for Java http://github-api.kohsuke.org/ GitHub API for Java @@ -16,7 +16,7 @@ scm:git:git@github.com/kohsuke/${project.artifactId}.git scm:git:ssh://git@github.com/kohsuke/${project.artifactId}.git http://${project.artifactId}.kohsuke.org/ - github-api-1.77 + HEAD From 38983df42dc43ba9b02917af1202ad87ef900e6e Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 19 Sep 2016 09:48:23 -0700 Subject: [PATCH 2/4] If we are a returning a collection of all things, we might as well use the maximum page size to minimize HTTP requests. --- src/main/java/org/kohsuke/github/GHOrganization.java | 2 +- src/main/java/org/kohsuke/github/GHPerson.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GHOrganization.java b/src/main/java/org/kohsuke/github/GHOrganization.java index 0c62fd8a2a..f174decf2f 100644 --- a/src/main/java/org/kohsuke/github/GHOrganization.java +++ b/src/main/java/org/kohsuke/github/GHOrganization.java @@ -220,7 +220,7 @@ public GHTeam createTeam(String name, Permission p, GHRepository... repositories */ public List getRepositoriesWithOpenPullRequests() throws IOException { List r = new ArrayList(); - for (GHRepository repository : listRepositories()) { + for (GHRepository repository : listRepositories(100)) { repository.wrap(root); List pullRequests = repository.getPullRequests(GHIssueState.OPEN); if (pullRequests.size() > 0) { diff --git a/src/main/java/org/kohsuke/github/GHPerson.java b/src/main/java/org/kohsuke/github/GHPerson.java index ef93dd75aa..f8aae9a487 100644 --- a/src/main/java/org/kohsuke/github/GHPerson.java +++ b/src/main/java/org/kohsuke/github/GHPerson.java @@ -52,7 +52,7 @@ protected synchronized void populate() throws IOException { */ public synchronized Map getRepositories() throws IOException { Map repositories = new TreeMap(); - for (GHRepository r : listRepositories()) { + for (GHRepository r : listRepositories(100)) { repositories.put(r.getName(),r); } return Collections.unmodifiableMap(repositories); From 50b47fb73b538d4e7b80c9414c3410e727f0ace3 Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Mon, 24 Oct 2016 21:12:56 +0100 Subject: [PATCH 3/4] Expose the commit dates --- .../java/org/kohsuke/github/GHCommit.java | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/kohsuke/github/GHCommit.java b/src/main/java/org/kohsuke/github/GHCommit.java index 6e606ef603..5872233567 100644 --- a/src/main/java/org/kohsuke/github/GHCommit.java +++ b/src/main/java/org/kohsuke/github/GHCommit.java @@ -2,12 +2,12 @@ import com.infradna.tool.bridge_method_injector.WithBridgeMethods; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - import java.io.IOException; import java.net.URL; import java.util.AbstractList; import java.util.ArrayList; import java.util.Collections; +import java.util.Date; import java.util.List; /** @@ -42,11 +42,19 @@ public GitUser getAuthor() { return author; } + public Date getAuthoredDate() { + return GitHub.parseDate(author.date); + } + @WithBridgeMethods(value = GHAuthor.class, castRequired = true) public GitUser getCommitter() { return committer; } + public Date getCommitDate() { + return GitHub.parseDate(author.date); + } + /** * Commit message. */ @@ -63,6 +71,7 @@ public int getCommentCount() { * @deprecated Use {@link GitUser} instead. */ public static class GHAuthor extends GitUser { + private String date; } public static class Stats { @@ -272,10 +281,29 @@ public GHUser getAuthor() throws IOException { return resolveUser(author); } + /** + * Gets the date the change was authored on. + * @return the date the change was authored on. + * @throws IOException if the information was not already fetched and an attempt at fetching the information failed. + */ + public Date getAuthoredDate() throws IOException { + return getCommitShortInfo().getAuthoredDate(); + } + public GHUser getCommitter() throws IOException { return resolveUser(committer); } + /** + * Gets the date the change was committed on. + * + * @return the date the change was committed on. + * @throws IOException if the information was not already fetched and an attempt at fetching the information failed. + */ + public Date getCommitDate() throws IOException { + return getCommitShortInfo().getCommitDate(); + } + private GHUser resolveUser(User author) throws IOException { if (author==null || author.login==null) return null; return owner.root.getUser(author.login); From b0df93bbcb5a27fa7268e2d778f708a66b100e69 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Mon, 24 Oct 2016 14:10:30 -0700 Subject: [PATCH 4/4] [maven-release-plugin] prepare release github-api-1.78 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e24d8f1748..25340a1c27 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ github-api - 1.78-SNAPSHOT + 1.78 GitHub API for Java http://github-api.kohsuke.org/ GitHub API for Java @@ -16,7 +16,7 @@ scm:git:git@github.com/kohsuke/${project.artifactId}.git scm:git:ssh://git@github.com/kohsuke/${project.artifactId}.git http://${project.artifactId}.kohsuke.org/ - HEAD + github-api-1.78