[gitlab] Improve issue_comment event handling - #391
Open
sondrebr wants to merge 6 commits into
Open
Conversation
The `pr_*` properties should be used instead from now on.
Both `PullRequest.merged` and `PullRequest.is_merged()` return the same value, so both should be implemented in `MockPullRequest` to prevent false test fails.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR focuses on improving the handling of
issue_commentevents:is_pr_commentas anEventInfoproperty. Returns true if the event is a PR comment, false otherwise (issue comment, pull request event etc.)pr_*properties ofEventInfoto enable them to be used when handlingissue_commenteventsis_pr_commentis used to check if it is a PR comment event and, if so, return the appropriate valueis_pr_commentcheck to the start ofhandle_issue_comment_event()to make it return early if the comment is not a PR commentissue_*properties fromEventInfo(pr_*properties should be used instead)The event handler hasn't handled issue comments properly, usually failing when attempting to use the pull/merge request API to interact with the issue. The
is_pr_commentcheck makes it exit gracefully instead. Also, since we're now explicitly handling only PR comments, we can get rid of theissue_*properties and avoid confusion regarding when to use those vs. thepr_*properties.