Skip to content

Commit e7cc148

Browse files
committed
include body, state in issues
1 parent d269c31 commit e7cc148

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

mdbook-goals/src/gh/issues.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ pub struct ExistingGithubIssue {
1313
/// Just github username, no `@`
1414
pub assignees: BTreeSet<String>,
1515
pub comments: Vec<ExistingGithubComment>,
16+
pub body: String,
17+
pub state: ExistingIssueState,
1618
}
1719

1820
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
@@ -28,6 +30,8 @@ struct ExistingGithubIssueJson {
2830
number: u64,
2931
assignees: Vec<ExistingGithubAssigneeJson>,
3032
comments: Vec<ExistingGithubCommentJson>,
33+
body: String,
34+
state: ExistingIssueState,
3135
}
3236

3337
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
@@ -47,6 +51,13 @@ struct ExistingGithubAuthorJson {
4751
login: String,
4852
}
4953

54+
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
55+
#[serde(rename_all = "UPPERCASE")]
56+
pub enum ExistingIssueState {
57+
Open,
58+
Closed,
59+
}
60+
5061
pub fn list_issue_titles_in_milestone(
5162
repository: &str,
5263
timeframe: &str,
@@ -61,7 +72,7 @@ pub fn list_issue_titles_in_milestone(
6172
.arg("-s")
6273
.arg("all")
6374
.arg("--json")
64-
.arg("title,assignees,number,comments")
75+
.arg("title,assignees,number,comments,body,state")
6576
.output()?;
6677

6778
let existing_issues: Vec<ExistingGithubIssueJson> = serde_json::from_slice(&output.stdout)?;
@@ -82,6 +93,8 @@ pub fn list_issue_titles_in_milestone(
8293
body: c.body,
8394
})
8495
.collect(),
96+
body: e_i.body,
97+
state: e_i.state,
8598
},
8699
)
87100
})

0 commit comments

Comments
 (0)