Skip to content

Commit

Permalink
Merge pull request #404 from Fryguy/github_pr_commenter_to_commit_range
Browse files Browse the repository at this point in the history
Change GithubPrCommenter to be a commit_range worker
  • Loading branch information
bdunne committed Feb 6, 2018
2 parents 40f6f6e + 8fedc58 commit f764857
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/workers/commit_monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def self.commit_handlers
# to check the new commits, but as a group, since newer commits may fix
# issues in prior commits.
def self.commit_range_handlers
@commit_range_handlers ||= handlers_for(:commit_range)
@commit_range_handlers ||= handlers_for(:commit_range).select { |h| !h.respond_to?(:perform_batch_async) }
end

# branch handlers expect to handle an entire branch at once.
Expand All @@ -38,7 +38,7 @@ def self.branch_handlers
#
# Example: A general commenter to GitHub for a number of issues
def self.batch_handlers
@batch_handlers ||= handlers_for(:batch)
@batch_handlers ||= handlers_for(:commit_range).select { |h| h.respond_to?(:perform_batch_async) }
end

def perform
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module CommitMonitorHandlers::Batch
module CommitMonitorHandlers::CommitRange
class GithubPrCommenter
include Sidekiq::Worker
sidekiq_options :queue => :miq_bot_glacial
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rugged'

module CommitMonitorHandlers::Batch
module CommitMonitorHandlers::CommitRange
class GithubPrCommenter::DiffContentChecker
include Sidekiq::Worker
sidekiq_options :queue => :miq_bot
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rugged'

module CommitMonitorHandlers::Batch
module CommitMonitorHandlers::CommitRange
class GithubPrCommenter::DiffFilenameChecker
include Sidekiq::Worker
sidekiq_options :queue => :miq_bot_glacial
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper'

describe CommitMonitorHandlers::Batch::GithubPrCommenter::DiffContentChecker do
describe CommitMonitorHandlers::CommitRange::GithubPrCommenter::DiffContentChecker do
let(:batch_entry) { BatchEntry.create!(:job => BatchJob.create!) }
let(:branch) { create(:pr_branch) }
let(:content_1) { "def a(variable)" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe CommitMonitorHandlers::Batch::GithubPrCommenter::DiffFilenameChecker do
describe CommitMonitorHandlers::CommitRange::GithubPrCommenter::DiffFilenameChecker do
let(:batch_entry) { BatchEntry.create!(:job => BatchJob.create!) }
let(:branch) { create(:pr_branch) }
let(:git_service) { double("GitService", :diff => double("RuggedDiff", :new_files => new_files)) }
Expand Down

0 comments on commit f764857

Please sign in to comment.