Skip to content

Commit e60520b

Browse files
committed
add interface for comment creation in issue updates
1 parent 22bba0e commit e60520b

4 files changed

Lines changed: 13 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
### 1.3.0
1+
### 1.3.0 (Next)
22
- Add issue lock/unlock functionality.
3+
- Add issue update with comment creation functionality.
34
- Add `creator` parameter to issue search filter.
45

56
### 1.2.2

src/concourse.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ pub(super) struct OutParams {
9898
assignees: Option<Vec<String>>,
9999
milestone: Option<u64>,
100100
// update only
101+
comment: Option<String>,
101102
lock: Option<bool>,
102103
state: Option<String>,
103104
}
@@ -119,6 +120,9 @@ impl OutParams {
119120
pub(super) fn milestone(&self) -> Option<u64> {
120121
self.milestone
121122
}
123+
pub(super) fn comment(&self) -> Option<&str> {
124+
self.comment.as_deref()
125+
}
122126
pub(super) fn lock(&self) -> Option<bool> {
123127
self.lock
124128
}

src/concourse/tests.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ fn test_outparams_title() {
8888
labels: None,
8989
assignees: None,
9090
milestone: None,
91+
comment: None,
9192
lock: None,
9293
state: None,
9394
}
@@ -104,6 +105,8 @@ fn test_outparams_deserialize() {
104105
"body": "approve the concourse step",
105106
"assignees": ["my_user_one", "my_user_two"],
106107
"milestone": 2,
108+
"comment": "good comment",
109+
"lock": false,
107110
"state": "closed"
108111
}"#;
109112
let out_params =
@@ -119,7 +122,8 @@ fn test_outparams_deserialize() {
119122
String::from("my_user_two")
120123
]),
121124
milestone: Some(2),
122-
lock: None,
125+
comment: Some(String::from("good comment")),
126+
lock: Some(false),
123127
state: Some(String::from("closed")),
124128
},
125129
"out params did not contain the expected member values",

src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ impl concourse_resource::Resource for GithubIssue {
6060
source.creator(),
6161
source.number(),
6262
None,
63+
None,
6364
source.state(),
6465
source.milestone(),
6566
);
@@ -143,6 +144,7 @@ impl concourse_resource::Resource for GithubIssue {
143144
params.assignees(),
144145
None,
145146
source.number(),
147+
params.comment(),
146148
params.lock(),
147149
params.state(),
148150
params.milestone(),

0 commit comments

Comments
 (0)