Skip to content

Commit

Permalink
Add the node_id to the Discussion Category payload
Browse files Browse the repository at this point in the history
I reported the fact that the field was missing to the GitHub team and
they were kind enough to add it so we can now take it into account.
  • Loading branch information
gsmet committed Dec 1, 2021
1 parent 08bff69 commit e59b438
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/org/kohsuke/github/GHRepositoryDiscussion.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public String getTimelineUrl() {
public static class Category {

private long id;
private String nodeId;
private long repositoryId;
private String emoji;
private String name;
Expand All @@ -126,6 +127,10 @@ public long getId() {
return id;
}

public String getNodeId() {
return nodeId;
}

public long getRepositoryId() {
return repositoryId;
}
Expand Down
3 changes: 3 additions & 0 deletions src/test/java/org/kohsuke/github/GHEventPayloadTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,7 @@ public void discussion_created() throws Exception {
GHRepositoryDiscussion.Category category = discussion.getCategory();

assertThat(category.getId(), is(33522033L));
assertThat(category.getNodeId(), is("DIC_kwDOEq3cwc4B_4Fx"));
assertThat(category.getEmoji(), is(":pray:"));
assertThat(category.getName(), is("Q&A"));
assertThat(category.getDescription(), is("Ask the community for help"));
Expand Down Expand Up @@ -1000,6 +1001,7 @@ public void discussion_answered() throws Exception {
GHRepositoryDiscussion.Category category = discussion.getCategory();

assertThat(category.getId(), is(33522033L));
assertThat(category.getNodeId(), is("DIC_kwDOEq3cwc4B_4Fx"));
assertThat(category.getEmoji(), is(":pray:"));
assertThat(category.getName(), is("Q&A"));
assertThat(category.getDescription(), is("Ask the community for help"));
Expand Down Expand Up @@ -1048,6 +1050,7 @@ public void discussion_labeled() throws Exception {
GHRepositoryDiscussion.Category category = discussion.getCategory();

assertThat(category.getId(), is(33522033L));
assertThat(category.getNodeId(), is("DIC_kwDOEq3cwc4B_4Fx"));
assertThat(category.getEmoji(), is(":pray:"));
assertThat(category.getName(), is("Q&A"));
assertThat(category.getDescription(), is("Ask the community for help"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"repository_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground",
"category": {
"id": 33522033,
"node_id": "DIC_kwDOEq3cwc4B_4Fx",
"repository_id": 313384129,
"emoji": ":pray:",
"name": "Q&A",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"repository_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground",
"category": {
"id": 33522033,
"node_id": "DIC_kwDOEq3cwc4B_4Fx",
"repository_id": 313384129,
"emoji": ":pray:",
"name": "Q&A",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"repository_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground",
"category": {
"id": 33522033,
"node_id": "DIC_kwDOEq3cwc4B_4Fx",
"repository_id": 313384129,
"emoji": ":pray:",
"name": "Q&A",
Expand Down

0 comments on commit e59b438

Please sign in to comment.