summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <alex@a3li.li>2016-06-01 16:53:09 +0200
committerAlex Legler <alex@a3li.li>2016-06-01 16:53:09 +0200
commit4d17512ae8329a209bed8c642c70744bcda45ae0 (patch)
tree899a034fb005ad62a997702a51053161356ab3db
parentSet approval/rejection delta requirement to 1 (diff)
downloadglsamaker-4d17512ae8329a209bed8c642c70744bcda45ae0.tar.gz
glsamaker-4d17512ae8329a209bed8c642c70744bcda45ae0.tar.bz2
glsamaker-4d17512ae8329a209bed8c642c70744bcda45ae0.zip
Add GLSAMAKER_BUGZIE_SKIP to skip bugzilla operations
-rw-r--r--config/initializers/glsamaker.rb.sample1
-rw-r--r--lib/bugzilla.rb15
2 files changed, 16 insertions, 0 deletions
diff --git a/config/initializers/glsamaker.rb.sample b/config/initializers/glsamaker.rb.sample
index a2fb4a2..7282279 100644
--- a/config/initializers/glsamaker.rb.sample
+++ b/config/initializers/glsamaker.rb.sample
@@ -32,6 +32,7 @@ GLSAMAKER_HOST = "localhost:3000"
GLSAMAKER_PORTDIR = "/usr/portage/"
# Bugzilla login info
+GLSAMAKER_BUGZIE_SKIP = false
GLSAMAKER_BUGZIE_HOST = 'bugs.gentoo.org'
GLSAMAKER_BUGZIE_USER = nil
GLSAMAKER_BUGZIE_PW = nil
diff --git a/lib/bugzilla.rb b/lib/bugzilla.rb
index b35c5a8..d9b8c44 100644
--- a/lib/bugzilla.rb
+++ b/lib/bugzilla.rb
@@ -23,6 +23,11 @@ module Bugzilla
module_function
# Adds a comment to a bug. Returns the comment id on success, raises an exception on failure.
def add_comment(bug, comment)
+ if GLSAMAKER_BUGZIE_SKIP
+ Rails.logger.info 'Skipped Bugzilla.add_comment'
+ return
+ end
+
Rails.logger.debug 'Called Bugzilla.add_comment'
did_retry = false
@@ -55,6 +60,11 @@ module Bugzilla
# Updates a bug. Returns an array of changes that were done on the bug.
def update_bug(bug, changes = {})
+ if GLSAMAKER_BUGZIE_SKIP
+ Rails.logger.info 'Skipped Bugzilla.update_bug'
+ return
+ end
+
Rails.logger.debug 'Called Bugzilla.update_bug'
did_retry = false
@@ -100,6 +110,11 @@ module Bugzilla
# Files a bug, and returns the id of the filed bug
def file_bug(data)
+ if GLSAMAKER_BUGZIE_SKIP
+ Rails.logger.info 'Skipped Bugzilla.file_bug'
+ return
+ end
+
Rails.logger.debug 'Called Bugzilla.file_bug'
did_retry = false