Skip to content

Commit 88de84e

Browse files
authored
[JENKINS-69482] Support for ready_for_review and converted_to_draft events (#615)
* [JENKINS-69482] Support for ready_for_review and converted_to_draft events
1 parent d46793a commit 88de84e

File tree

4 files changed

+848
-1
lines changed

4 files changed

+848
-1
lines changed

src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestGHEventSubscriber.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ protected void onEvent(GHSubscriberEvent event) {
135135
event.getOrigin()));
136136
} else if ("reopened".equals(action)
137137
|| "synchronize".equals(action)
138-
|| "edited".equals(action)) {
138+
|| "edited".equals(action)
139+
|| "ready_for_review".equals(action)
140+
|| "converted_to_draft".equals(action)) {
139141
fireAfterDelay(
140142
new SCMHeadEventImpl(
141143
SCMEvent.Type.UPDATED,

src/test/java/org/jenkinsci/plugins/github_branch_source/EventsTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,25 @@ public void given_ghPullRequestEventSync_then_updatedHeadEventFired() throws Exc
136136
waitAndAssertReceived(true);
137137
}
138138

139+
@Test
140+
public void given_ghPullRequestEventConvertedToDraft_then_updatedHeadEventFired()
141+
throws Exception {
142+
PullRequestGHEventSubscriber subscriber = new PullRequestGHEventSubscriber();
143+
144+
firedEventType = SCMEvent.Type.UPDATED;
145+
ghEvent = callOnEvent(subscriber, "EventsTest/pullRequestEventUpdatedConvertedToDraft.json");
146+
waitAndAssertReceived(true);
147+
}
148+
149+
@Test
150+
public void given_ghPullRequestEventReadyForReview_then_updatedHeadEventFired() throws Exception {
151+
PullRequestGHEventSubscriber subscriber = new PullRequestGHEventSubscriber();
152+
153+
firedEventType = SCMEvent.Type.UPDATED;
154+
ghEvent = callOnEvent(subscriber, "EventsTest/pullRequestEventUpdatedReadyForReview.json");
155+
waitAndAssertReceived(true);
156+
}
157+
139158
@Test
140159
public void given_ghRepositoryEventCreatedFromFork_then_createdSourceEventFired()
141160
throws Exception {

0 commit comments

Comments
 (0)