miq_bot icon indicating copy to clipboard operation
miq_bot copied to clipboard

[WIP] Unclutter commit monitor

Open Fryguy opened this issue 7 years ago • 9 comments

This PR unclutters the core of the CommitMonitor by removing the whole categorization notion of separate workers. All workers will receive the branch_id and the new_commits on that branch, and it is up to the worker how they want to deal with that.

@bdunne Please review.

PR is WIP because I haven't tested enough yet.

Fryguy avatar Feb 09 '18 19:02 Fryguy

First 2 commits are flattening the commit_range directory. The last commit is the big change to the CommitMonitor

Fryguy avatar Feb 09 '18 20:02 Fryguy

Did a quick first pass on testing and something is wrong. It seems to execute all of the handlers even if there haven't been any changes to the branch. I must have removed a check somewhere in all those deletions. No issues though when the actual workers run.

Fryguy avatar Feb 16 '18 21:02 Fryguy

This pull request is not mergeable. Please rebase and repush.

miq-bot avatar Mar 02 '18 15:03 miq-bot

Checked commits https://github.com/Fryguy/miq_bot/compare/b30558e2dc32850601dc1b95352365cfb6b3439c~...879a668368ac4bb3056f6c21a6b634f74a0cd19a with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 32 files checked, 330 offenses detected

**

  • [ ] :bomb: :boom: :fire: :fire_engine: - Linter/Haml - missing config files

app/workers/commit_monitor.rb

  • [ ] :exclamation: - Line 12, Col 22 - Rails/FilePath - Please use Rails.root.join('path', 'to') instead.

app/workers/commit_monitor_handlers/bugzilla_commenter.rb

app/workers/commit_monitor_handlers/bugzilla_pr_checker.rb

app/workers/commit_monitor_handlers/github_pr_commenter/diff_filename_checker.rb

  • [ ] :exclamation: - Line 42, Col 10 - Rails/TimeZone - Do not use Time.parse without zone. Use one of Time.zone.parse, Time.current, Time.parse.in_time_zone, Time.parse.utc, Time.parse.getlocal, Time.parse.iso8601, Time.parse.jisx0301, Time.parse.rfc3339, Time.parse.to_i, Time.parse.to_f instead.

app/workers/commit_monitor_handlers/path_based_labeler.rb

app/workers/commit_monitor_handlers/rubocop_checker.rb

  • [ ] :exclamation: - Line 24, Col 5 - Rails/Present - Use if @results["files"].present? instead of unless @results["files"].blank?.

app/workers/commit_monitor_handlers/rubocop_checker/message_builder.rb

app/workers/commit_monitor_handlers/rubocop_checker/rubocop_results_filter.rb

spec/workers/commit_monitor_handlers/github_pr_commenter/diff_content_checker_spec.rb

spec/workers/commit_monitor_handlers/rubocop_checker/data/with_lines_not_in_the_diff/example.rb

  • [ ] :exclamation: - Line 2, Col 10 - Style/MutableConstant - Freeze mutable objects assigned to constants.
  • [ ] :exclamation: - Line 3, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 4, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.

spec/workers/commit_monitor_handlers/rubocop_checker/data/with_results_generating_multiple_comments/lots_of_issues.rb

miq-bot avatar Mar 09 '18 22:03 miq-bot

...continued

  • [ ] :exclamation: - Line 147, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 148, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 149, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 14, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 150, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 151, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 152, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 153, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 154, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 155, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 156, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 157, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 158, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 159, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 15, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 160, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 161, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 162, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 163, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 164, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 165, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 166, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 167, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 168, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 169, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 16, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 170, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 171, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 172, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 173, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 174, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 175, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 176, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 177, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 178, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 179, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 17, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 180, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 181, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 182, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 183, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 184, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 185, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 186, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 187, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 188, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 189, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 18, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 190, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 191, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 192, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 193, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 194, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 195, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 196, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 19, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 20, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 21, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 22, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 23, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 24, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 25, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 26, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 27, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 28, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 29, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 2, Col 10 - Style/MutableConstant - Freeze mutable objects assigned to constants.
  • [ ] :exclamation: - Line 30, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 31, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 32, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 33, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 34, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 35, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 36, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 37, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 38, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 39, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 3, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 40, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 41, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 42, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 43, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 44, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 45, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 46, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 47, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 48, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 49, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 4, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 50, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 51, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 52, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 53, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 54, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 55, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 56, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 57, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 58, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 59, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 5, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 60, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 61, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 62, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 63, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 64, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 65, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 66, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 67, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 68, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 69, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 6, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 70, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 71, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 72, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 73, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 74, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 75, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 76, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 77, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 78, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 79, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 7, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 80, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 81, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 82, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 83, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 84, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 85, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 86, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 87, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 88, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 89, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 8, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 90, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 91, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 92, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 93, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 94, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 95, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 96, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 97, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 98, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 99, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 9, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.

spec/workers/commit_monitor_handlers/rubocop_checker/data/with_results_with_offenses/coding_convention.rb

  • [ ] :exclamation: - Line 3, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.
  • [ ] :exclamation: - Line 4, Col 5 - Layout/AlignHash - Align the elements of a hash literal if they span more than one line.

spec/workers/commit_monitor_handlers/rubocop_checker/data/with_results_with_offenses/ruby_syntax_error.rb

  • [ ] :bomb: :boom: :fire: :fire_engine: - Line 3, Col 1 - Lint/Syntax - unexpected token kEND (Using Ruby 2.3 parser; configure using TargetRubyVersion parameter, under AllCops)

spec/workers/commit_monitor_handlers/rubocop_checker/data/with_results_with_offenses/ruby_warning.rb

spec/workers/commit_monitor_handlers/rubocop_checker/data/with_void_warnings_in_spec_files/non_spec_file_with_void_warning.rb

  • [ ] :warning: - Line 2, Col 13 - Lint/Void - Operator == used in void context.

spec/workers/commit_monitor_handlers/rubocop_checker/data/with_void_warnings_in_spec_files/spec/non_spec_file_in_spec_dir_with_void_warning.rb

  • [ ] :warning: - Line 2, Col 13 - Lint/Void - Operator == used in void context.

spec/workers/commit_monitor_handlers/rubocop_checker/message_builder_spec.rb

miq-bot avatar Mar 09 '18 22:03 miq-bot

This pull request is not mergeable. Please rebase and repush.

miq-bot avatar Mar 05 '19 02:03 miq-bot

This pull request has been automatically closed because it has not been updated for at least 3 months.

Feel free to reopen this pull request if these changes are still valid.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

miq-bot avatar Mar 06 '23 00:03 miq-bot

Reopening cause I still think this is the right approacj

Fryguy avatar Mar 10 '23 16:03 Fryguy

This pull request is not mergeable. Please rebase and repush.

miq-bot avatar Mar 16 '23 13:03 miq-bot