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 7fc68f2

Browse filesBrowse files
authored
Merge branch 'master' into installation-repository-event
2 parents 32ff315 + c5ee07a commit 7fc68f2
Copy full SHA for 7fc68f2

File tree

Expand file treeCollapse file tree

35 files changed

+512
-939
lines changed
Filter options
Expand file treeCollapse file tree

35 files changed

+512
-939
lines changed

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHCreateRepositoryBuilder.java
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ public GHCreateRepositoryBuilder issues(boolean enabled) {
7979
return this;
8080
}
8181

82+
/**
83+
* Enables projects
84+
*
85+
* @param enabled
86+
* true if enabled
87+
* @return a builder to continue with building
88+
*/
89+
public GHCreateRepositoryBuilder projects(boolean enabled) {
90+
this.builder.with("has_projects", enabled);
91+
return this;
92+
}
93+
8294
/**
8395
* Enables wiki
8496
*

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHRepository.java
+22-1Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public class GHRepository extends GHObject {
7676

7777
private String git_url, ssh_url, clone_url, svn_url, mirror_url;
7878
private GHUser owner; // not fully populated. beware.
79-
private boolean has_issues, has_wiki, fork, has_downloads, has_pages, archived;
79+
private boolean has_issues, has_wiki, fork, has_downloads, has_pages, archived, has_projects;
8080

8181
private boolean allow_squash_merge;
8282
private boolean allow_merge_commit;
@@ -547,6 +547,15 @@ public boolean hasIssues() {
547547
return has_issues;
548548
}
549549

550+
/**
551+
* Has projects boolean.
552+
*
553+
* @return the boolean
554+
*/
555+
public boolean hasProjects() {
556+
return has_projects;
557+
}
558+
550559
/**
551560
* Has wiki boolean.
552561
*
@@ -988,6 +997,18 @@ public void enableIssueTracker(boolean v) throws IOException {
988997
edit("has_issues", String.valueOf(v));
989998
}
990999

1000+
/**
1001+
* Enables or disables projects for this repository.
1002+
*
1003+
* @param v
1004+
* the v
1005+
* @throws IOException
1006+
* the io exception
1007+
*/
1008+
public void enableProjects(boolean v) throws IOException {
1009+
edit("has_projects", String.valueOf(v));
1010+
}
1011+
9911012
/**
9921013
* Enables or disables Wiki for this repository.
9931014
*

‎src/test/java/org/kohsuke/github/AppTest.java

Copy file name to clipboardExpand all lines: src/test/java/org/kohsuke/github/AppTest.java
+30-5Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,40 @@ public void testRepoCRUD() throws Exception {
4040
"a test repository",
4141
"http://github-api.kohsuke.org/",
4242
true);
43+
4344
assertThat(r.hasIssues(), is(true));
45+
assertThat(r.hasWiki(), is(true));
46+
assertThat(r.hasDownloads(), is(true));
47+
assertThat(r.hasProjects(), is(true));
4448

4549
r.enableIssueTracker(false);
4650
r.enableDownloads(false);
4751
r.enableWiki(false);
52+
r.enableProjects(false);
53+
4854
r.renameTo(targetName);
49-
getUser().getRepository(targetName).delete();
55+
56+
// local instance remains unchanged
57+
assertThat(r.getName(), equalTo("github-api-test-rename"));
58+
assertThat(r.hasIssues(), is(true));
59+
assertThat(r.hasWiki(), is(true));
60+
assertThat(r.hasDownloads(), is(true));
61+
assertThat(r.hasProjects(), is(true));
62+
63+
r = gitHub.getMyself().getRepository(targetName);
64+
65+
// values are updated
66+
assertThat(r.hasIssues(), is(false));
67+
assertThat(r.hasWiki(), is(false));
68+
assertThat(r.hasDownloads(), is(false));
69+
assertThat(r.getName(), equalTo(targetName));
70+
71+
// ISSUE: #765
72+
// From what I can tell this is a bug in GithHub.
73+
// updating `has_projects` doesn't seem to do anything
74+
assertThat(r.hasProjects(), is(true));
75+
76+
r.delete();
5077
}
5178

5279
@Test
@@ -58,14 +85,12 @@ public void testRepositoryWithAutoInitializationCRUD() throws Exception {
5885
.homepage("http://github-api.kohsuke.org/")
5986
.autoInit(true)
6087
.create();
61-
r.enableIssueTracker(false);
62-
r.enableDownloads(false);
63-
r.enableWiki(false);
6488
if (mockGitHub.isUseProxy()) {
6589
Thread.sleep(3000);
6690
}
6791
assertNotNull(r.getReadme());
68-
getUser().getRepository(name).delete();
92+
93+
r.delete();
6994
}
7095

7196
private void cleanupUserRepository(final String name) throws IOException {
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"id": 212446528,
3-
"node_id": "MDEwOlJlcG9zaXRvcnkyMTI0NDY1Mjg=",
2+
"id": 251751384,
3+
"node_id": "MDEwOlJlcG9zaXRvcnkyNTE3NTEzODQ=",
44
"name": "github-api-test-rename",
55
"full_name": "bitwiseman/github-api-test-rename",
66
"private": false,
@@ -64,9 +64,9 @@
6464
"labels_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/labels{/name}",
6565
"releases_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/releases{/id}",
6666
"deployments_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/deployments",
67-
"created_at": "2019-10-02T21:40:00Z",
68-
"updated_at": "2019-10-02T21:40:01Z",
69-
"pushed_at": "2019-10-02T21:40:01Z",
67+
"created_at": "2020-03-31T21:52:44Z",
68+
"updated_at": "2020-03-31T21:52:45Z",
69+
"pushed_at": "2020-03-31T21:52:45Z",
7070
"git_url": "git://github.com/bitwiseman/github-api-test-rename.git",
7171
"ssh_url": "git@github.com:bitwiseman/github-api-test-rename.git",
7272
"clone_url": "https://github.com/bitwiseman/github-api-test-rename.git",
@@ -99,6 +99,7 @@
9999
"allow_squash_merge": true,
100100
"allow_merge_commit": true,
101101
"allow_rebase_merge": true,
102+
"delete_branch_on_merge": false,
102103
"network_count": 0,
103104
"subscribers_count": 1
104105
}
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"id": 212446528,
3-
"node_id": "MDEwOlJlcG9zaXRvcnkyMTI0NDY1Mjg=",
2+
"id": 251751384,
3+
"node_id": "MDEwOlJlcG9zaXRvcnkyNTE3NTEzODQ=",
44
"name": "github-api-test-rename",
55
"full_name": "bitwiseman/github-api-test-rename",
66
"private": false,
@@ -64,9 +64,9 @@
6464
"labels_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/labels{/name}",
6565
"releases_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/releases{/id}",
6666
"deployments_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/deployments",
67-
"created_at": "2019-10-02T21:40:00Z",
68-
"updated_at": "2019-10-02T21:40:01Z",
69-
"pushed_at": "2019-10-02T21:40:01Z",
67+
"created_at": "2020-03-31T21:52:44Z",
68+
"updated_at": "2020-03-31T21:52:46Z",
69+
"pushed_at": "2020-03-31T21:52:45Z",
7070
"git_url": "git://github.com/bitwiseman/github-api-test-rename.git",
7171
"ssh_url": "git@github.com:bitwiseman/github-api-test-rename.git",
7272
"clone_url": "https://github.com/bitwiseman/github-api-test-rename.git",
@@ -99,6 +99,7 @@
9999
"allow_squash_merge": true,
100100
"allow_merge_commit": true,
101101
"allow_rebase_merge": true,
102+
"delete_branch_on_merge": false,
102103
"network_count": 0,
103104
"subscribers_count": 1
104105
}
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"id": 212446528,
3-
"node_id": "MDEwOlJlcG9zaXRvcnkyMTI0NDY1Mjg=",
2+
"id": 251751384,
3+
"node_id": "MDEwOlJlcG9zaXRvcnkyNTE3NTEzODQ=",
44
"name": "github-api-test-rename",
55
"full_name": "bitwiseman/github-api-test-rename",
66
"private": false,
@@ -64,9 +64,9 @@
6464
"labels_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/labels{/name}",
6565
"releases_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/releases{/id}",
6666
"deployments_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/deployments",
67-
"created_at": "2019-10-02T21:40:00Z",
68-
"updated_at": "2019-10-02T21:40:02Z",
69-
"pushed_at": "2019-10-02T21:40:01Z",
67+
"created_at": "2020-03-31T21:52:44Z",
68+
"updated_at": "2020-03-31T21:52:46Z",
69+
"pushed_at": "2020-03-31T21:52:45Z",
7070
"git_url": "git://github.com/bitwiseman/github-api-test-rename.git",
7171
"ssh_url": "git@github.com:bitwiseman/github-api-test-rename.git",
7272
"clone_url": "https://github.com/bitwiseman/github-api-test-rename.git",
@@ -99,6 +99,7 @@
9999
"allow_squash_merge": true,
100100
"allow_merge_commit": true,
101101
"allow_rebase_merge": true,
102+
"delete_branch_on_merge": false,
102103
"network_count": 0,
103104
"subscribers_count": 1
104105
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{
2+
"id": 251751384,
3+
"node_id": "MDEwOlJlcG9zaXRvcnkyNTE3NTEzODQ=",
4+
"name": "github-api-test-rename",
5+
"full_name": "bitwiseman/github-api-test-rename",
6+
"private": false,
7+
"owner": {
8+
"login": "bitwiseman",
9+
"id": 1958953,
10+
"node_id": "MDQ6VXNlcjE5NTg5NTM=",
11+
"avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4",
12+
"gravatar_id": "",
13+
"url": "https://api.github.com/users/bitwiseman",
14+
"html_url": "https://github.com/bitwiseman",
15+
"followers_url": "https://api.github.com/users/bitwiseman/followers",
16+
"following_url": "https://api.github.com/users/bitwiseman/following{/other_user}",
17+
"gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}",
18+
"starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}",
19+
"subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions",
20+
"organizations_url": "https://api.github.com/users/bitwiseman/orgs",
21+
"repos_url": "https://api.github.com/users/bitwiseman/repos",
22+
"events_url": "https://api.github.com/users/bitwiseman/events{/privacy}",
23+
"received_events_url": "https://api.github.com/users/bitwiseman/received_events",
24+
"type": "User",
25+
"site_admin": false
26+
},
27+
"html_url": "https://github.com/bitwiseman/github-api-test-rename",
28+
"description": "a test repository",
29+
"fork": false,
30+
"url": "https://api.github.com/repos/bitwiseman/github-api-test-rename",
31+
"forks_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/forks",
32+
"keys_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/keys{/key_id}",
33+
"collaborators_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/collaborators{/collaborator}",
34+
"teams_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/teams",
35+
"hooks_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/hooks",
36+
"issue_events_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/issues/events{/number}",
37+
"events_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/events",
38+
"assignees_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/assignees{/user}",
39+
"branches_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/branches{/branch}",
40+
"tags_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/tags",
41+
"blobs_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/git/blobs{/sha}",
42+
"git_tags_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/git/tags{/sha}",
43+
"git_refs_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/git/refs{/sha}",
44+
"trees_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/git/trees{/sha}",
45+
"statuses_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/statuses/{sha}",
46+
"languages_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/languages",
47+
"stargazers_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/stargazers",
48+
"contributors_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/contributors",
49+
"subscribers_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/subscribers",
50+
"subscription_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/subscription",
51+
"commits_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/commits{/sha}",
52+
"git_commits_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/git/commits{/sha}",
53+
"comments_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/comments{/number}",
54+
"issue_comment_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/issues/comments{/number}",
55+
"contents_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/contents/{+path}",
56+
"compare_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/compare/{base}...{head}",
57+
"merges_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/merges",
58+
"archive_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/{archive_format}{/ref}",
59+
"downloads_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/downloads",
60+
"issues_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/issues{/number}",
61+
"pulls_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/pulls{/number}",
62+
"milestones_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/milestones{/number}",
63+
"notifications_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/notifications{?since,all,participating}",
64+
"labels_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/labels{/name}",
65+
"releases_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/releases{/id}",
66+
"deployments_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename/deployments",
67+
"created_at": "2020-03-31T21:52:44Z",
68+
"updated_at": "2020-03-31T21:52:47Z",
69+
"pushed_at": "2020-03-31T21:52:45Z",
70+
"git_url": "git://github.com/bitwiseman/github-api-test-rename.git",
71+
"ssh_url": "git@github.com:bitwiseman/github-api-test-rename.git",
72+
"clone_url": "https://github.com/bitwiseman/github-api-test-rename.git",
73+
"svn_url": "https://github.com/bitwiseman/github-api-test-rename",
74+
"homepage": "http://github-api.kohsuke.org/",
75+
"size": 0,
76+
"stargazers_count": 0,
77+
"watchers_count": 0,
78+
"language": null,
79+
"has_issues": false,
80+
"has_projects": true,
81+
"has_downloads": false,
82+
"has_wiki": false,
83+
"has_pages": false,
84+
"forks_count": 0,
85+
"mirror_url": null,
86+
"archived": false,
87+
"disabled": false,
88+
"open_issues_count": 0,
89+
"license": null,
90+
"forks": 0,
91+
"open_issues": 0,
92+
"watchers": 0,
93+
"default_branch": "master",
94+
"permissions": {
95+
"admin": true,
96+
"push": true,
97+
"pull": true
98+
},
99+
"allow_squash_merge": true,
100+
"allow_merge_commit": true,
101+
"allow_rebase_merge": true,
102+
"delete_branch_on_merge": false,
103+
"network_count": 0,
104+
"subscribers_count": 1
105+
}
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"id": 212446528,
3-
"node_id": "MDEwOlJlcG9zaXRvcnkyMTI0NDY1Mjg=",
2+
"id": 251751384,
3+
"node_id": "MDEwOlJlcG9zaXRvcnkyNTE3NTEzODQ=",
44
"name": "github-api-test-rename2",
55
"full_name": "bitwiseman/github-api-test-rename2",
66
"private": false,
@@ -64,9 +64,9 @@
6464
"labels_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename2/labels{/name}",
6565
"releases_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename2/releases{/id}",
6666
"deployments_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename2/deployments",
67-
"created_at": "2019-10-02T21:40:00Z",
68-
"updated_at": "2019-10-02T21:40:02Z",
69-
"pushed_at": "2019-10-02T21:40:01Z",
67+
"created_at": "2020-03-31T21:52:44Z",
68+
"updated_at": "2020-03-31T21:52:47Z",
69+
"pushed_at": "2020-03-31T21:52:45Z",
7070
"git_url": "git://github.com/bitwiseman/github-api-test-rename2.git",
7171
"ssh_url": "git@github.com:bitwiseman/github-api-test-rename2.git",
7272
"clone_url": "https://github.com/bitwiseman/github-api-test-rename2.git",
@@ -99,6 +99,7 @@
9999
"allow_squash_merge": true,
100100
"allow_merge_commit": true,
101101
"allow_rebase_merge": true,
102+
"delete_branch_on_merge": false,
102103
"network_count": 0,
103104
"subscribers_count": 1
104105
}
+7-5Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"id": 212446528,
3-
"node_id": "MDEwOlJlcG9zaXRvcnkyMTI0NDY1Mjg=",
2+
"id": 251751384,
3+
"node_id": "MDEwOlJlcG9zaXRvcnkyNTE3NTEzODQ=",
44
"name": "github-api-test-rename2",
55
"full_name": "bitwiseman/github-api-test-rename2",
66
"private": false,
@@ -64,9 +64,9 @@
6464
"labels_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename2/labels{/name}",
6565
"releases_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename2/releases{/id}",
6666
"deployments_url": "https://api.github.com/repos/bitwiseman/github-api-test-rename2/deployments",
67-
"created_at": "2019-10-02T21:40:00Z",
68-
"updated_at": "2019-10-02T21:40:02Z",
69-
"pushed_at": "2019-10-02T21:40:01Z",
67+
"created_at": "2020-03-31T21:52:44Z",
68+
"updated_at": "2020-03-31T21:52:47Z",
69+
"pushed_at": "2020-03-31T21:52:45Z",
7070
"git_url": "git://github.com/bitwiseman/github-api-test-rename2.git",
7171
"ssh_url": "git@github.com:bitwiseman/github-api-test-rename2.git",
7272
"clone_url": "https://github.com/bitwiseman/github-api-test-rename2.git",
@@ -96,9 +96,11 @@
9696
"push": true,
9797
"pull": true
9898
},
99+
"temp_clone_token": "",
99100
"allow_squash_merge": true,
100101
"allow_merge_commit": true,
101102
"allow_rebase_merge": true,
103+
"delete_branch_on_merge": false,
102104
"network_count": 0,
103105
"subscribers_count": 1
104106
}

0 commit comments

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