-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix pull request triggers from forks #172
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,16 +62,16 @@ protected void handleEvent(PullRequestEvent event) { | |
return; | ||
} | ||
|
||
String strRef = event.getPullRequest().getFromRef().toString() | ||
.replaceFirst(".*refs/heads/", ""); | ||
String strRef = "pr/" + Long.toString(event.getPullRequest().getId()) + "/from"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are the implications of this change? It looks we're changing the whole PR scheme here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I remember well, i'ts necessary, because a PR can come from a fork. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright, I'm going to test this out and look into getting it in. |
||
String strSha1 = event.getPullRequest().getFromRef().getLatestCommit(); | ||
String targetBranch = event.getPullRequest().getToRef().getDisplayId(); | ||
|
||
EventContext context = new EventContext(event, | ||
event.getPullRequest().getToRef().getRepository(), | ||
event.getUser().getName()); | ||
|
||
if (filterChain.shouldDeliverNotification(context)) | ||
notifier.notifyBackground(context.getRepository(), strRef, strSha1); | ||
notifier.notifyBackground(context.getRepository(), strRef, strSha1, targetBranch); | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel the omit bools aren't clear enough. I think we should prefer names like shouldOmitTargetBranch. To me, it makes statements like
if (!shouldOmitTargetBranch)
more clear.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I wrote in that manner to maintain consistency with the others vars.