-
Notifications
You must be signed in to change notification settings - Fork 156
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
#917 Rultor should not ask architect to confirm merge on a closed PR #1048
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 |
---|---|---|
|
@@ -77,16 +77,43 @@ public Req understand(final Comment.Smart comment, | |
final URI home) throws IOException { | ||
final Issue.Smart issue = new Issue.Smart(comment.issue()); | ||
final Req req; | ||
if (issue.isPull()) { | ||
req = this.origin.understand(comment, home); | ||
} else { | ||
if (QnIfPull.isNotPull(issue)) { | ||
new Answer(comment).post( | ||
false, | ||
QnIfPull.PHRASES.getString("QnIfPull.not-pull-request") | ||
); | ||
req = Req.EMPTY; | ||
req = Req.DONE; | ||
} else if (QnIfPull.isClosed(issue)) { | ||
new Answer(comment).post( | ||
false, | ||
QnIfPull.PHRASES.getString("QnIfPull.already-closed") | ||
); | ||
req = Req.DONE; | ||
} else { | ||
req = this.origin.understand(comment, home); | ||
} | ||
return req; | ||
} | ||
|
||
/** | ||
* Is issue not pull request. | ||
* @param issue The issue | ||
* @return TRUE if issue not pull request | ||
* @throws IOException If there is any I/O problem | ||
*/ | ||
private static boolean isNotPull(final Issue.Smart issue) | ||
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. @dskalenko what's the point of adding this method if we already have the method 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. @original-brownbear 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. @dskalenko what warning ? Can you please give the specific warning you're not getting by using this but getting when directly using the issue methods ? 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. @original-brownbear 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. @dskalenko just flip the if and else then.
|
||
throws IOException { | ||
return !issue.isPull(); | ||
} | ||
|
||
/** | ||
* Is issue closed. | ||
* @param issue The issue | ||
* @return TRUE if issue closed | ||
* @throws IOException If there is any I/O problem | ||
*/ | ||
private static boolean isClosed(final Issue.Smart issue) | ||
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. @dskalenko same as in the above, this one is fully redundant, it adds a bunch of lines and confusion only. Just use the issue itself when checking if it's open. You should obviously only add private static utility methods to add logic, not as a glorified negation. 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. @original-brownbear 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. @dskalenko same answer as in the above. |
||
throws IOException { | ||
return !issue.isOpen(); | ||
} | ||
} |
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.
@dskalenko Why did you change this from
Req.EMPTY
toReq.DONE
?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.
@original-brownbear
I changed it since it was required by new logic
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.
@dskalenko Ok but why does the new logic require this kind of change? Why adjust anything to the logic of handling this command being issued in a non-pull request while fixing the logic pertaining to actual pull requests?
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.
@original-brownbear
I don't know why QnIfPull returned EMPTY Req at the beginning, because according to how it used QnIfPull should return Req.DONE in case of some incorrectness with issue (like for QnByArchitect). Why we have to proceed
flow forward if command not possible (see QnFirstOf )
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.
@dskalenko ok let me rephrase the question:
Please explain clear cut why in order to not have this code act on a closed PR we have to adjust the return signature for the
merge
command response outside of an actual PR ?It seems to me that these things are fully unrelated.