| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| @SuppressFBWarnings("UWF_UNWRITTEN_FIELD") | ||
| public class GHPullRequestChanges { | ||
|
|
||
| private GHCommitPointer base; |
There was a problem hiding this comment.
base changed - covered with UT
title changed - covered with UT
body changed - cover on demand
Sorry, something went wrong.
| assertThat(event.getPullRequest().getTitle(), is("REST-276 - easy-random")); | ||
| assertThat(event.getChanges().getBase().getRef().getFrom(), is("develop")); | ||
| assertThat(event.getChanges().getBase().getSha().getFrom(), is("4b0f3b9fd582b071652ccfccd10bfc8c143cff96")); | ||
| assertThat(event.getPullRequest().getBody(), startsWith("**JIRA Ticket URL:**")); |
There was a problem hiding this comment.
body not changed - hence "changes" does not contain it
Sorry, something went wrong.
There was a problem hiding this comment.
Minor changes to test.
Sorry, something went wrong.
| assertThat(event.getChanges().getBase(), nullValue()); | ||
| assertThat(event.getPullRequest().getBody(), startsWith("**JIRA Ticket URL:**")); | ||
| assertThat(event.getChanges().getBody(), nullValue()); | ||
| assertThat(event.getChanges(). getChanges(), nullValue()); |
There was a problem hiding this comment.
| assertThat(event.getChanges(). getChanges(), nullValue()); |
Sorry, something went wrong.
|
@bitwiseman not sure what changes did you expect. My logic was: for three fields: title, body and base check old value (in "changes" field) and current value (in "pull_request field). There is a small test enhancement. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
Webhook with X-GitHub-Event: pull_request and "action": "edited" has a field "changes" that is not present in GHEventPayload.PullRequest. I've found three triggers that leads to "edited" action:
(full payload - in test data)
So, "changes" fields contain old value that was changed, while pull_request object has latest values (see UT json payloads). Any other changes of a PR in GitHub UI leads to other types of notifications (e.g. action is assigned or ready_for_review or labeled).