Compare commits

..

7 Commits

Author SHA1 Message Date
Kohsuke Kawaguchi
f02f2d7585 [maven-release-plugin] prepare release github-api-1.13 2011-09-15 11:44:20 -07:00
Kohsuke Kawaguchi
d4c099d447 Merge pull request #2 from lacostej/lacostej-master
expose issue_updated_at. It looks like a better representation of update
2011-09-06 13:28:30 -07:00
Jerome Lacoste (f19)
5756133840 expose issue_updated_at. It looks like a better representation of update time for an pull request than updated_at 2011-09-06 13:07:50 +02:00
Kohsuke Kawaguchi
6cc966adee [maven-release-plugin] prepare for next development iteration 2011-08-26 18:43:22 -07:00
Kohsuke Kawaguchi
107a1b83c0 [maven-release-plugin] prepare release github-api-1.12 2011-08-26 18:43:18 -07:00
Kohsuke Kawaguchi
1f8e732d3a added command to disable Wiki 2011-08-26 18:36:29 -07:00
Kohsuke Kawaguchi
d5e52a2468 [maven-release-plugin] prepare for next development iteration 2011-08-26 18:12:18 -07:00
4 changed files with 26 additions and 3 deletions

View File

@@ -7,7 +7,7 @@
</parent> </parent>
<artifactId>github-api</artifactId> <artifactId>github-api</artifactId>
<version>1.11</version> <version>1.13</version>
<name>GitHub API for Java</name> <name>GitHub API for Java</name>
<url>http://github-api.kohsuke.org/</url> <url>http://github-api.kohsuke.org/</url>
<description>GitHub API for Java</description> <description>GitHub API for Java</description>

View File

@@ -70,6 +70,10 @@ public class GHPullRequest extends GHIssue {
return head; return head;
} }
public Date getIssueUpdatedAt() {
return GitHub.parseDate(issue_updated_at);
}
/** /**
* The HTML page of this pull request, * The HTML page of this pull request,
* like https://github.com/jenkinsci/jenkins/pull/100 * like https://github.com/jenkinsci/jenkins/pull/100

View File

@@ -207,6 +207,14 @@ public class GHRepository {
.to("/repos/show/" + owner + "/" + name); .to("/repos/show/" + owner + "/" + name);
} }
/**
* Enables or disables Wiki for this repository.
*/
public void enableWiki(boolean v) throws IOException {
new Poster(root).withCredential().with("values[has_wiki]",String.valueOf(v))
.to("/repos/show/" + owner + "/" + name);
}
/** /**
* Deletes this repository. * Deletes this repository.
*/ */

View File

@@ -41,8 +41,10 @@ public class AppTest extends TestCase {
public void testApp() throws IOException { public void testApp() throws IOException {
GitHub gitHub = GitHub.connect(); GitHub gitHub = GitHub.connect();
GHPullRequest i = gitHub.getOrganization("jenkinsci").getRepository("parameterized-trigger-plugin").getPullRequest(3);
System.out.println(i); // tryDisablingIssueTrackers(gitHub);
// tryDisablingWiki(gitHub);
// GHPullRequest i = gitHub.getOrganization("jenkinsci").getRepository("sandbox").getPullRequest(1); // GHPullRequest i = gitHub.getOrganization("jenkinsci").getRepository("sandbox").getPullRequest(1);
// for (GHIssueComment c : i.getComments()) // for (GHIssueComment c : i.getComments())
@@ -87,6 +89,15 @@ public class AppTest extends TestCase {
} }
} }
private void tryDisablingWiki(GitHub gitHub) throws IOException {
for (GHRepository r : gitHub.getOrganization("jenkinsci").getRepositories().values()) {
if (r.hasWiki()) {
System.out.println("DISABLED "+r.getName());
r.enableWiki(false);
}
}
}
private void tryUpdatingIssueTracker(GitHub gitHub) throws IOException { private void tryUpdatingIssueTracker(GitHub gitHub) throws IOException {
GHRepository r = gitHub.getOrganization("jenkinsci").getRepository("lib-task-reactor"); GHRepository r = gitHub.getOrganization("jenkinsci").getRepository("lib-task-reactor");
System.out.println(r.hasIssues()); System.out.println(r.hasIssues());