|
3 | 3 | import junit.framework.TestCase; |
4 | 4 | import org.kohsuke.github.GHOrganization; |
5 | 5 | import org.kohsuke.github.GHOrganization.Permission; |
6 | | -import org.kohsuke.github.GHPullRequest; |
7 | | -import org.kohsuke.github.GHPullRequest.State; |
8 | 6 | import org.kohsuke.github.GHRepository; |
9 | 7 | import org.kohsuke.github.GHTeam; |
10 | 8 | import org.kohsuke.github.GitHub; |
11 | 9 |
|
12 | 10 | import java.io.IOException; |
13 | 11 | import java.net.URL; |
14 | | -import java.util.Collections; |
15 | | -import java.util.Comparator; |
16 | | -import java.util.Date; |
17 | | -import java.util.List; |
18 | 12 | import java.util.Set; |
19 | | -import java.util.concurrent.TimeUnit; |
20 | 13 |
|
21 | 14 | /** |
22 | 15 | * Unit test for simple App. |
@@ -55,6 +48,26 @@ public void testApp() throws IOException { |
55 | 48 | // System.out.println(hub.getUser("kohsuke").getRepository("hudson").getCollaborators()); |
56 | 49 | } |
57 | 50 |
|
| 51 | + private void tryDisablingIssueTrackers(GitHub gitHub) throws IOException { |
| 52 | + for (GHRepository r : gitHub.getOrganization("jenkinsci").getRepositories().values()) { |
| 53 | + if (r.hasIssues()) { |
| 54 | + if (r.getOpenIssueCount()==0) { |
| 55 | + System.out.println("DISABLED "+r.getName()); |
| 56 | + r.enableIssueTracker(false); |
| 57 | + } else { |
| 58 | + System.out.println("UNTOUCHED "+r.getName()); |
| 59 | + } |
| 60 | + } |
| 61 | + } |
| 62 | + } |
| 63 | + |
| 64 | + private void tryUpdatingIssueTracker(GitHub gitHub) throws IOException { |
| 65 | + GHRepository r = gitHub.getOrganization("jenkinsci").getRepository("lib-task-reactor"); |
| 66 | + System.out.println(r.hasIssues()); |
| 67 | + System.out.println(r.getOpenIssueCount()); |
| 68 | + r.enableIssueTracker(false); |
| 69 | + } |
| 70 | + |
58 | 71 | private void tryRenaming(GitHub gitHub) throws IOException { |
59 | 72 | gitHub.getUser("kohsuke").getRepository("test").renameTo("test2"); |
60 | 73 | } |
|
0 commit comments