Skip to content

Fix of issues in remove_reviewer command #416

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

Closed
wants to merge 2 commits into from

Conversation

europ
Copy link
Member

@europ europ commented Mar 27, 2018

The merge of #411 can cause undesirable problems.

In lib/github_service/commands/remove_reviewer.rb is an method missing error due to a dependent octokit/octokit.rb#990 which is not merged yet and also an undefined two local variables error which is due to wrong method call.

The errors undefined local variable fq_repo_name and undefined local variable number were fixed with correct calling as an issue method call.

The undefined method delete_pull_request_review_request error is solved via catching NoMethodError exception. The call of this method will inform the requester of remove_reviewer command that this command is currently not working and it will perform no action (only posting a github comment with this informative text). This is a temporary solution until merge of octokit/octokit.rb#990.


Errors

  • undefined local variable fq_repo_name
2018-03-22T16:48:45.326Z 15110 TID-grjjui1pk GithubNotificationMonitorWorker JID-6d1eab0b08206f522c5b5f18 ERROR: undefined local variable or method `fq_repo_name' for #<GithubService::Commands::RemoveReviewer:0x00005607f6e7cd78>
2018-03-22T16:48:45.327Z 15110 TID-grjjui1pk GithubNotificationMonitorWorker JID-6d1eab0b08206f522c5b5f18 ERROR: /root/miq_bot/lib/github_service/commands/remove_reviewer.rb:28:in `requested_reviewers'
/root/miq_bot/lib/github_service/commands/remove_reviewer.rb:13:in `_execute'
/root/miq_bot/lib/github_service/commands/base.rb:33:in `execute!'
/root/miq_bot/lib/github_service/command_dispatcher.rb:36:in `block in dispatch!'
/root/miq_bot/lib/github_service/command_dispatcher.rb:26:in `each'
/root/miq_bot/lib/github_service/command_dispatcher.rb:26:in `dispatch!'
...
  • undefined local variable number
2018-03-22T18:34:12.120Z 16901 TID-gnk6maz3k GithubNotificationMonitorWorker JID-350692fa2e343c95c4eb66d3 ERROR: undefined local variable or method `number' for #<GithubService::Commands::RemoveReviewer:0x00005576a6dd7da0>
2018-03-22T18:34:12.121Z 16901 TID-gnk6maz3k GithubNotificationMonitorWorker JID-350692fa2e343c95c4eb66d3 ERROR: /root/miq_bot/lib/github_service/commands/remove_reviewer.rb:22:in `requested_reviewers'
/root/miq_bot/lib/github_service/commands/remove_reviewer.rb:10:in `_execute'
/root/miq_bot/lib/github_service/commands/base.rb:33:in `execute!'
/root/miq_bot/lib/github_service/command_dispatcher.rb:36:in `block in dispatch!'
/root/miq_bot/lib/github_service/command_dispatcher.rb:26:in `each'
/root/miq_bot/lib/github_service/command_dispatcher.rb:26:in `dispatch!'
...
  • undefined method delete_pull_request_review_request
2018-03-22T17:26:27.343Z 16084 TID-gscdlbkhc GithubNotificationMonitorWorker JID-0abb1835ec1b698abd2c5769 ERROR: undefined method `delete_pull_request_review_request' for GithubService:Module
2018-03-22T17:26:27.343Z 16084 TID-gscdlbkhc GithubNotificationMonitorWorker JID-0abb1835ec1b698abd2c5769 ERROR: /root/miq_bot/lib/github_service.rb:158:in `method_missing'
/root/miq_bot/lib/github_service/issue.rb:18:in `remove_reviewer'
/root/miq_bot/lib/github_service/commands/remove_reviewer.rb:11:in `_execute'
/root/miq_bot/lib/github_service/commands/base.rb:33:in `execute!'
/root/miq_bot/lib/github_service/command_dispatcher.rb:36:in `block in dispatch!'
/root/miq_bot/lib/github_service/command_dispatcher.rb:26:in `each'
/root/miq_bot/lib/github_service/command_dispatcher.rb:26:in `dispatch!'
...

\cc
@Fryguy
@skateman

@europ
Copy link
Member Author

europ commented Mar 27, 2018

@miq-bot add_label bug

@miq-bot miq-bot added the bug label Mar 27, 2018
@europ europ force-pushed the remove_reviewer_command_tmp_fix branch 2 times, most recently from cc90085 to af954f0 Compare March 27, 2018 10:19
@europ europ changed the title Fix of method missing and undefined local variable Fix of method missing and undefined local variables Mar 27, 2018
@europ europ force-pushed the remove_reviewer_command_tmp_fix branch from af954f0 to 284ec55 Compare March 27, 2018 10:45
@europ
Copy link
Member Author

europ commented Mar 27, 2018

@miq-bot add_reviewer @skateman

@miq-bot
Copy link
Member

miq-bot commented Mar 27, 2018

@europ 'skateman' is an invalid reviewer, ignoring...

@skateman
Copy link
Member

Why am I an invalid reviewer?

@europ europ force-pushed the remove_reviewer_command_tmp_fix branch from 284ec55 to 750f51a Compare March 27, 2018 12:28
@europ europ changed the title Fix of method missing and undefined local variables Class method call fix and exception handling for unimplemented method Mar 27, 2018
@europ europ changed the title Class method call fix and exception handling for unimplemented method Fix of class method call and exception handling for unimplemented method Mar 27, 2018
@europ europ changed the title Fix of class method call and exception handling for unimplemented method Fix of issues in remove_reviewer command Mar 27, 2018
europ added 2 commits March 27, 2018 14:32
Fix of undefined local variables 'fq_repo_name' and 'number' because of wrong class method call. It was solved as a class method call of a correspodning class.
This is a temporary solution until merge of octokit/octokit.rb#990.

Fix of undefined method `delete_pull_request_review_request' because of dependent pull request was not merged yet. It was solved via catching the NoMethodError exception. The call of this method will inform the requester of remove_reviewer command that this command is currently not working and it will perform no action (only posting a github comment with this informative text).
@europ europ force-pushed the remove_reviewer_command_tmp_fix branch from 750f51a to 91123f5 Compare March 27, 2018 12:33
@miq-bot
Copy link
Member

miq-bot commented Mar 27, 2018

Checked commits europ/miq_bot@212da59~...91123f5 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 👍

@europ europ closed this Apr 17, 2018
europ added a commit to europ/miq_bot that referenced this pull request Apr 17, 2018
Command remove_reviewer is implemented by using the octokit's internal methods because the expected feature is not added yet. This is a temporary solution until merge of dependence in octokit.

Closes ManageIQ#416
@europ europ deleted the remove_reviewer_command_tmp_fix branch April 19, 2018 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants