Skip to content

Commit

Permalink
[JENKINS-69482] Support for ready_for_review and `converted_to_draf…
Browse files Browse the repository at this point in the history
…t` events (#615)

* [JENKINS-69482] Support for ready_for_review and converted_to_draft events
  • Loading branch information
Dohbedoh authored Sep 13, 2022
1 parent d46793a commit 88de84e
Show file tree
Hide file tree
Showing 4 changed files with 848 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ protected void onEvent(GHSubscriberEvent event) {
event.getOrigin()));
} else if ("reopened".equals(action)
|| "synchronize".equals(action)
|| "edited".equals(action)) {
|| "edited".equals(action)
|| "ready_for_review".equals(action)
|| "converted_to_draft".equals(action)) {
fireAfterDelay(
new SCMHeadEventImpl(
SCMEvent.Type.UPDATED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,25 @@ public void given_ghPullRequestEventSync_then_updatedHeadEventFired() throws Exc
waitAndAssertReceived(true);
}

@Test
public void given_ghPullRequestEventConvertedToDraft_then_updatedHeadEventFired()
throws Exception {
PullRequestGHEventSubscriber subscriber = new PullRequestGHEventSubscriber();

firedEventType = SCMEvent.Type.UPDATED;
ghEvent = callOnEvent(subscriber, "EventsTest/pullRequestEventUpdatedConvertedToDraft.json");
waitAndAssertReceived(true);
}

@Test
public void given_ghPullRequestEventReadyForReview_then_updatedHeadEventFired() throws Exception {
PullRequestGHEventSubscriber subscriber = new PullRequestGHEventSubscriber();

firedEventType = SCMEvent.Type.UPDATED;
ghEvent = callOnEvent(subscriber, "EventsTest/pullRequestEventUpdatedReadyForReview.json");
waitAndAssertReceived(true);
}

@Test
public void given_ghRepositoryEventCreatedFromFork_then_createdSourceEventFired()
throws Exception {
Expand Down
Loading

0 comments on commit 88de84e

Please sign in to comment.