public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/rbot-bugzilla:master commit in: /
@ 2011-09-22 23:14 Christian Ruppert
  0 siblings, 0 replies; 11+ messages in thread
From: Christian Ruppert @ 2011-09-22 23:14 UTC (permalink / raw
  To: gentoo-commits

commit:     fa35d46b5ae356d2e35dc266a933ee59f56fec16
Author:     Christian Ruppert <idl0r <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 22 23:13:54 2011 +0000
Commit:     Christian Ruppert <idl0r <AT> gentoo <DOT> org>
CommitDate: Thu Sep 22 23:13:54 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/rbot-bugzilla.git;a=commit;h=fa35d46b

Add IN_PROGRESS, CONFIRMED

---
 bugzilla.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bugzilla.rb b/bugzilla.rb
index 474c7eb..d428ddb 100644
--- a/bugzilla.rb
+++ b/bugzilla.rb
@@ -29,7 +29,7 @@ String.send(:include, BugzillaStringExtensions)
 # Valid statuses
 # 'DONE' and 'OPEN' are special cases that expand to the rest of the statuses in that array
 DONE_STATUS = ['DONE','RESOLVED','VERIFIED','CLOSED']
-OPEN_STATUS = ['OPEN','UNCONFIRMED','NEW','ASSIGNED','REOPENED']
+OPEN_STATUS = ['OPEN','UNCONFIRMED','NEW','ASSIGNED','REOPENED', 'IN_PROGRESS', 'CONFIRMED']
 VALID_RESO  = ['FIXED', 'INVALID', 'WONTFIX', 'LATER', 'REMIND', 'DUPLICATE', 'WORKSFORME', 'CANTFIX', 'NEEDINFO', 'TEST-REQUEST', 'UPSTREAM']
 
 # Each zilla instance may have these parameters



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/rbot-bugzilla:master commit in: /
@ 2012-02-28  6:30 Robin H. Johnson
  0 siblings, 0 replies; 11+ messages in thread
From: Robin H. Johnson @ 2012-02-28  6:30 UTC (permalink / raw
  To: gentoo-commits

commit:     4c864f9a89d3ea597aefb505e4887ae9f536e9a7
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 28 06:29:55 2012 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Tue Feb 28 06:30:29 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/rbot-bugzilla.git;a=commit;h=4c864f9a

Support 'bug X comment Y' and 'bug X#cY' as commands and detection in text.

---
 bugzilla.rb |   68 +++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 43 insertions(+), 25 deletions(-)

diff --git a/bugzilla.rb b/bugzilla.rb
index d428ddb..13f19fe 100644
--- a/bugzilla.rb
+++ b/bugzilla.rb
@@ -389,7 +389,7 @@ class BugzillaPlugin < Plugin
 	'STATUS' => status,
 	'REPORTER' => reporter,
 	'ASSIGNEE' => assignee,
-	'URL' => showbugurl.gsub('@BUGNO@', bugno).gsub('@COMMENT@', comment),
+	'URL' => showbugurl.gsub('@BUGNO@', bugno).gsub('@COMMENT@', comment.length > 0 ? '#c'+comment : '' ),
       }
       output = template.dup
       mapping.each { |k,v|
@@ -533,10 +533,11 @@ class BugzillaPlugin < Plugin
   def listen(m)
     return if m.address?
     return unless lurk?(m)
-    return if m.message !~ /\bbug(?:[[:space:]]*)?#?([0-9]+)(#c[0-9]+)?/i
+    return if m.message !~ /\bbug(?:[[:space:]]*)?#?([0-9]+)(?:(?:#c| comment #?)([0-9]+))?/i
     bugno = $1
     comment = $2 || ""
     bugno.gsub!(/^#/,'')
+    comment.gsub!(/^#c?/,'')
     zilla = get_zilla(m)
     m.reply zilla.summary(bugno, comment)
   end
@@ -560,14 +561,19 @@ class BugzillaPlugin < Plugin
   # Answer to a bug information request, long form.
   def buglong(m, params)
     begin
-	  if params[:number].chomp("#") =~ /#?([0-9]+)(#c[0-9]+)?/i
-		  bugno = $1
-		  comment = $2 || ""
-		  bugno.gsub!(/^#/,'')
-	  else
-		  m.reply "Wrong parameters - invalid bugnumber, see 'help bug' for help."
-		  return
-	  end
+      comment = ""
+      if params[:garbage] == 'comment' and params[:comment] =~ /^(?:#|#c)?([0-9]+)$/
+        comment = $1
+      end
+      if params[:number].chomp("#") =~ /#?([0-9]+)(?:(?:#c|comment #?)([0-9]+))?/i
+        bugno = $1
+        comment = $2 if $2
+        bugno.gsub!(/^#/,'')
+      else
+        m.reply "Wrong parameters - invalid bugnumber, see 'help bug' for help."
+        return
+      end
+      comment.gsub!(/^#c?/,'')
 
       if params[:zilla] and bugno
         check_zilla(params[:zilla])
@@ -585,17 +591,23 @@ class BugzillaPlugin < Plugin
   # Answer to a bug information request, short form.
   def bug(m, params)
     begin
-		if params[:number].chomp("#") =~ /#?([0-9]+)(#c[0-9]+)?/i
-			bugno = $1
-			comment = $2 ? $2 : ""
-			bugno.gsub!(/^#/,'')
-		else
-			m.reply "Wrong parameters - invalid bugnumber, see 'help bug' for help."
-			return
-		end
+      comment = ""
+      if params[:garbage] == 'comment' and params[:comment] =~ /^(?:#|#c)?([0-9]+)$/
+        comment = $1
+      end
+      if params[:number].chomp("#") =~ /#?([0-9]+)(?:(?:#c|comment #?)([0-9]+))?/i
+        bugno = $1
+        comment = $2 if $2
+        bugno.gsub!(/^#/,'')
+      else
+        m.reply "Wrong parameters - invalid bugnumber, see 'help bug' for help."
+        return
+      end
+      comment.gsub!(/^#c?/,'')
+
       zilla = get_zilla(m)
 
-	  if not zilla
+      if not zilla
         m.reply "Wrong parameters - unknown zilla, see 'help bug' for help."
       end
       m.reply zilla.summary(bugno, comment)
@@ -1035,19 +1047,25 @@ plugin = BugzillaPlugin.new
 plugin.default_auth( 'modify', false )
 plugin.default_auth( 'view', true )
 
-plugin.map 'bug :number',
+plugin.map 'bug :number :garbage :comment',
   :requirements => {
     :number => /^[^ ]+$/,
+    :garbage => /^[^ ]+$/,
+    :comment => /^[^ ]+$/,
   },
+  :defaults => { :garbage => "", :comment => "" },
   :action => 'bug',
   :thread => 'yes',
   :auth_path => 'view'
 
-plugin.map 'bugl :zilla :number',
+plugin.map 'bugl :zilla :number :garbage :comment',
   :requirements => {
     :number => /^[^ ]+$/,
-    :zilla => /^[^ ]+$/
+    :zilla => /^[^ ]+$/,
+    :garbage => /^[^ ]+$/,
+    :comment => /^[^ ]+$/,
   },
+  :defaults => { :garbage => "", :comment => "" },
   :action => 'buglong',
   :thread => 'yes',
   :auth_path => 'view'
@@ -1082,7 +1100,7 @@ plugin.map 'zilla instance add :zilla :baseurl',
   :action => 'instance_add',
   :requirements => {
     :zilla => /^[^ ]+$/,
-    :baseurl => /^https?:\/\/.*/
+    :baseurl => /^https?:\/\/.*/,
   },
   :auth_path => 'modify'
 
@@ -1090,7 +1108,7 @@ plugin.map 'zilla instance set :zilla :setting :value',
   :action => 'instance_set',
   :requirements => {
     :zilla => /^[^\. ]+$/,
-    :setting => OPTIONS_INPUT_1
+    :setting => OPTIONS_INPUT_1,
   },
   :auth_path => 'modify'
 
@@ -1109,7 +1127,7 @@ plugin.map 'zilla instance show :zilla :full',
   :action => 'instance_show',
   :requirements => {
     :zilla => /^[^ ]+$/,
-    :full => /^full|registry$/
+    :full => /^full|registry$/,
   },
   :defaults => { :full => "registry" },
   :auth_path => 'view'



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/rbot-bugzilla:master commit in: /
@ 2015-11-16  4:23 Robin H. Johnson
  0 siblings, 0 replies; 11+ messages in thread
From: Robin H. Johnson @ 2015-11-16  4:23 UTC (permalink / raw
  To: gentoo-commits

commit:     172ea72b8d730a44268db23b5fe954a8cd15de4b
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 16 04:22:29 2015 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Mon Nov 16 04:22:29 2015 +0000
URL:        https://gitweb.gentoo.org/proj/rbot-bugzilla.git/commit/?id=172ea72b

Update for newer HTMLEntities.

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 bugzilla.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bugzilla.rb b/bugzilla.rb
index 97743cc..d9af38f 100644
--- a/bugzilla.rb
+++ b/bugzilla.rb
@@ -21,7 +21,7 @@ require 'htmlentities'
 
 module BugzillaStringExtensions
   def decode_entities
-    return HTMLEntities.decode_entities(self)
+    return HTMLEntities.new().decode(self)
   end
 end
 String.send(:include, BugzillaStringExtensions)


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/rbot-bugzilla:master commit in: /
@ 2015-11-16  4:23 Robin H. Johnson
  0 siblings, 0 replies; 11+ messages in thread
From: Robin H. Johnson @ 2015-11-16  4:23 UTC (permalink / raw
  To: gentoo-commits

commit:     b82b012c7122e06f805155a62fa6727ad401f390
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 16 04:22:18 2015 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Mon Nov 16 04:22:18 2015 +0000
URL:        https://gitweb.gentoo.org/proj/rbot-bugzilla.git/commit/?id=b82b012c

Update for newer Ruby.

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 bugzilla.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bugzilla.rb b/bugzilla.rb
index 13f19fe..97743cc 100644
--- a/bugzilla.rb
+++ b/bugzilla.rb
@@ -435,13 +435,13 @@ class BugzillaPlugin < Plugin
 
     def search(urlparams, params = nil)
       url = buglisturl + '&' + urlparams
-      searchdata = CSV::Reader.create(@bot.httputil.get(url)).to_a
+      searchdata = CSV.parse(@bot.httputil.get(url))
       return searchdata
     end
 
     def report(urlparams, params = nil)
       url = "#{reporturl}&#{urlparams}"
-      reportdata = CSV::Reader.create(@bot.httputil.get(url)).to_a
+      reportdata = CSV.parse(@bot.httputil.get(url))
       if params and params[:total]
         sum = 0
         column = params[:total]


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/rbot-bugzilla:master commit in: /
@ 2015-11-16  4:27 Robin H. Johnson
  0 siblings, 0 replies; 11+ messages in thread
From: Robin H. Johnson @ 2015-11-16  4:27 UTC (permalink / raw
  To: gentoo-commits

commit:     6340025d9ae6139c414c337bc92cfcc177a2a5b1
Author:     Doug Freed <dwfreed <AT> mtu <DOT> edu>
AuthorDate: Mon Nov 16 04:22:18 2015 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Mon Nov 16 04:26:54 2015 +0000
URL:        https://gitweb.gentoo.org/proj/rbot-bugzilla.git/commit/?id=6340025d

CSV: Update for newer Ruby.

CSV::Reader is no longer available after Ruby 1.9; we need to do it
differently.

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 bugzilla.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bugzilla.rb b/bugzilla.rb
index 13f19fe..97743cc 100644
--- a/bugzilla.rb
+++ b/bugzilla.rb
@@ -435,13 +435,13 @@ class BugzillaPlugin < Plugin
 
     def search(urlparams, params = nil)
       url = buglisturl + '&' + urlparams
-      searchdata = CSV::Reader.create(@bot.httputil.get(url)).to_a
+      searchdata = CSV.parse(@bot.httputil.get(url))
       return searchdata
     end
 
     def report(urlparams, params = nil)
       url = "#{reporturl}&#{urlparams}"
-      reportdata = CSV::Reader.create(@bot.httputil.get(url)).to_a
+      reportdata = CSV.parse(@bot.httputil.get(url))
       if params and params[:total]
         sum = 0
         column = params[:total]


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/rbot-bugzilla:master commit in: /
@ 2015-11-16  4:27 Robin H. Johnson
  0 siblings, 0 replies; 11+ messages in thread
From: Robin H. Johnson @ 2015-11-16  4:27 UTC (permalink / raw
  To: gentoo-commits

commit:     2560e4f2c846790efdf74f059111d01349a77ea4
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 16 04:22:29 2015 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Mon Nov 16 04:27:06 2015 +0000
URL:        https://gitweb.gentoo.org/proj/rbot-bugzilla.git/commit/?id=2560e4f2

Update for newer HTMLEntities.

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 bugzilla.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bugzilla.rb b/bugzilla.rb
index 97743cc..d9af38f 100644
--- a/bugzilla.rb
+++ b/bugzilla.rb
@@ -21,7 +21,7 @@ require 'htmlentities'
 
 module BugzillaStringExtensions
   def decode_entities
-    return HTMLEntities.decode_entities(self)
+    return HTMLEntities.new().decode(self)
   end
 end
 String.send(:include, BugzillaStringExtensions)


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/rbot-bugzilla:master commit in: /
@ 2021-06-19  5:25 Robin H. Johnson
  0 siblings, 0 replies; 11+ messages in thread
From: Robin H. Johnson @ 2021-06-19  5:25 UTC (permalink / raw
  To: gentoo-commits

commit:     b7dd157b41e1c3a57c098a6a5402899784b2041f
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 19 05:25:25 2021 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sat Jun 19 05:25:25 2021 +0000
URL:        https://gitweb.gentoo.org/proj/rbot-bugzilla.git/commit/?id=b7dd157b

bugzilla: support bug aliases

Closes: https://bugs.gentoo.org/356123
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 bugzilla.rb | 32 +++++++++++++++++++++++++-------
 1 file changed, 25 insertions(+), 7 deletions(-)

diff --git a/bugzilla.rb b/bugzilla.rb
index d9af38f..a1f0e6a 100644
--- a/bugzilla.rb
+++ b/bugzilla.rb
@@ -533,13 +533,31 @@ class BugzillaPlugin < Plugin
   def listen(m)
     return if m.address?
     return unless lurk?(m)
-    return if m.message !~ /\bbug(?:[[:space:]]*)?#?([0-9]+)(?:(?:#c| comment #?)([0-9]+))?/i
-    bugno = $1
-    comment = $2 || ""
-    bugno.gsub!(/^#/,'')
-    comment.gsub!(/^#c?/,'')
-    zilla = get_zilla(m)
-    m.reply zilla.summary(bugno, comment)
+    # bug 1234
+    # bug 1234#c1234
+    # bug 1234 comment 1234
+    # bug 1234 comment #1234
+    # bug #1234
+    # bug #1234#c1234
+    # bug #1234 comment 1234
+    # bug #1234 comment #1234
+    # bug #gcc
+    # bug #gcc#c1234
+    # bug #gcc comment 1234
+    # bug #gcc comment #1234
+    #
+    # bug aliases can contain
+    # 0-9, a-z, A-Z
+    # and then every punctuation except ","
+    message_re = /\bbug(?:[[:space:]]*)(?:#?([0-9]+|#[-[:alnum:]~`!@#$%^&*()_+={}\]\[\\/|:;\'"<>.?]{3,40}))(?:(?:#c| comment #?)([0-9]+))?/i
+    message.scan(message_re).each do |bug_comment|
+      bugno = bug_comment[0]
+      comment = bug_comment[1] || ""
+      bugno.gsub!(/^#/,'')
+      comment.gsub!(/^#c?/,'')
+      zilla = get_zilla(m)
+      m.reply zilla.summary(bugno, comment)
+    end
   end
 
   # Function checking when a new channel is joined


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/rbot-bugzilla:master commit in: /
@ 2024-02-09 19:44 Robin H. Johnson
  0 siblings, 0 replies; 11+ messages in thread
From: Robin H. Johnson @ 2024-02-09 19:44 UTC (permalink / raw
  To: gentoo-commits

commit:     68f157e15941877f5a16d233c2815421c5493653
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Fri Feb  9 19:43:59 2024 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Fri Feb  9 19:44:39 2024 +0000
URL:        https://gitweb.gentoo.org/proj/rbot-bugzilla.git/commit/?id=68f157e1

feat: report how many bugs get skipped and make it configurable

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 bugzilla.rb | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)

diff --git a/bugzilla.rb b/bugzilla.rb
index a1f0e6a..ed23915 100644
--- a/bugzilla.rb
+++ b/bugzilla.rb
@@ -34,7 +34,7 @@ VALID_RESO  = ['FIXED', 'INVALID', 'WONTFIX', 'LATER', 'REMIND', 'DUPLICATE', 'W
 
 # Each zilla instance may have these parameters
 # TODO: Add 'nicename' that is used for output to IRC. Defaults to name.capitialize
-OPTIONS = [ 'name', 'baseurl', 'dataurl', 'showbugurl', 'reporturl', 'buglisturl', 'template' ]
+OPTIONS = [ 'name', 'baseurl', 'dataurl', 'showbugurl', 'reporturl', 'buglisturl', 'template', 'max_announce' ]
 
 # Now life gets fun, these are regular expresses to check the above arrays
 _STATUS_INPUT = (DONE_STATUS+OPEN_STATUS+['ALL']).uniq.join('|')
@@ -100,7 +100,7 @@ class BugzillaPlugin < Plugin
       "Bug ##{@bugno} not found in #{@zilla}"
     end
   end
-  
+
   # Exception class for bugs that are security-locked
   # It is thrown when the XML document does not contain either a <bug>
   # or <issue> element that is recognised.
@@ -213,6 +213,14 @@ class BugzillaPlugin < Plugin
       @template = @registry["zilla.#{name}.template"] = val
     end
 
+    def max_announce
+      @registry["zilla.#{name}.max_announce"] || 5
+    end
+
+    def max_announce=(val)
+      @registry["zilla.#{name}.max_announce"] = val
+    end
+
     def lastseenid
       return @registry["zilla.#{name}.lastseenid"]
     end
@@ -314,7 +322,7 @@ class BugzillaPlugin < Plugin
 
       @client = nil
     end
-  
+
     # TODO: Promote EMAIL_REPLACEMENTS to a config hash instead, with a nice
     # large set of defaults.
     EMAIL_REPLACEMENTS = { 'gentoo.org' => 'g.o', 'gentooexperimental.org' => 'ge.o' }
@@ -421,16 +429,24 @@ class BugzillaPlugin < Plugin
 
       buglist = search(recent_url)
       buglist.delete_at(0)
-      upper_bound = [buglist.size, 5].min
+      upper_bound = [buglist.size, max_announce].min
+
+      if (buglist.size > upper_bound)
+        first_skip = buglist[0][0].to_i
+        last_skip = buglist[-(upper_bound+1)][0].to_i
+        @registry["zilla.#{@name}.announcements"].each do |chan|
+          @bot.say chan, "(too many new bugs, skipping Bug IDs #{first_skip}..#{last_skip})"
+        end
+        self.lastseenid = last_skip
+      end
+
       buglist[-upper_bound..-1].each do |bug|
         bugsummary = summary(bug[0])
-
         @registry["zilla.#{@name}.announcements"].each do |chan|
           @bot.say chan, "New bug: #{bugsummary}"
         end
+        self.lastseenid = bug[0].to_i
       end
-
-      self.lastseenid = buglist[-1][0].to_i if buglist.size > 0
     end
 
     def search(urlparams, params = nil)
@@ -549,7 +565,7 @@ class BugzillaPlugin < Plugin
     # bug aliases can contain
     # 0-9, a-z, A-Z
     # and then every punctuation except ","
-    message_re = /\bbug(?:[[:space:]]*)(?:#?([0-9]+|#[-[:alnum:]~`!@#$%^&*()_+={}\]\[\\/|:;\'"<>.?]{3,40}))(?:(?:#c| comment #?)([0-9]+))?/i
+    message_re = /\bbug(?:[[:space:]]*)(?:#?([0-9]+|#[-[:alnum:]~`!@#$%^&*()_+={}\]\[\\\/|:;\'"<>.?]{3,40}))(?:(?:#c| comment #?)([0-9]+))?/i
     message.scan(message_re).each do |bug_comment|
       bugno = bug_comment[0]
       comment = bug_comment[1] || ""


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/rbot-bugzilla:master commit in: /
@ 2024-02-10  5:30 Robin H. Johnson
  0 siblings, 0 replies; 11+ messages in thread
From: Robin H. Johnson @ 2024-02-10  5:30 UTC (permalink / raw
  To: gentoo-commits

commit:     18a4ab9ac73695a7e55bc4b17b428967629f5104
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 10 05:30:18 2024 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sat Feb 10 05:30:18 2024 +0000
URL:        https://gitweb.gentoo.org/proj/rbot-bugzilla.git/commit/?id=18a4ab9a

fix: cannot compare string and int

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 bugzilla.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bugzilla.rb b/bugzilla.rb
index ed23915..5000e4a 100644
--- a/bugzilla.rb
+++ b/bugzilla.rb
@@ -214,7 +214,7 @@ class BugzillaPlugin < Plugin
     end
 
     def max_announce
-      @registry["zilla.#{name}.max_announce"] || 5
+      @registry["zilla.#{name}.max_announce"]&.to_i || 5
     end
 
     def max_announce=(val)
@@ -429,7 +429,7 @@ class BugzillaPlugin < Plugin
 
       buglist = search(recent_url)
       buglist.delete_at(0)
-      upper_bound = [buglist.size, max_announce].min
+      upper_bound = [buglist.size, max_announce&.to_i].min
 
       if (buglist.size > upper_bound)
         first_skip = buglist[0][0].to_i


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/rbot-bugzilla:master commit in: /
@ 2024-02-10 19:13 Robin H. Johnson
  0 siblings, 0 replies; 11+ messages in thread
From: Robin H. Johnson @ 2024-02-10 19:13 UTC (permalink / raw
  To: gentoo-commits

commit:     0b0ca1a283eb592a08974ae7bb00d33a600a5ceb
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 10 19:13:03 2024 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sat Feb 10 19:13:03 2024 +0000
URL:        https://gitweb.gentoo.org/proj/rbot-bugzilla.git/commit/?id=0b0ca1a2

fix: variable naming error

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 bugzilla.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bugzilla.rb b/bugzilla.rb
index 5000e4a..a4d88f5 100644
--- a/bugzilla.rb
+++ b/bugzilla.rb
@@ -546,6 +546,7 @@ class BugzillaPlugin < Plugin
   # This function is used to check if an user requested bug
   # information inline in the text of a message rather than directly
   # to the bot.
+  MESSAGE_RE = /\bbug(?:[[:space:]]*)(?:#?([0-9]+|#[-[:alnum:]~`!@#$%^&*()_+={}\]\[\\\/|:;\'"<>.?]{3,40}))(?:(?:#c| comment #?)([0-9]+))?/i
   def listen(m)
     return if m.address?
     return unless lurk?(m)
@@ -565,8 +566,7 @@ class BugzillaPlugin < Plugin
     # bug aliases can contain
     # 0-9, a-z, A-Z
     # and then every punctuation except ","
-    message_re = /\bbug(?:[[:space:]]*)(?:#?([0-9]+|#[-[:alnum:]~`!@#$%^&*()_+={}\]\[\\\/|:;\'"<>.?]{3,40}))(?:(?:#c| comment #?)([0-9]+))?/i
-    message.scan(message_re).each do |bug_comment|
+    m.scan(MESSAGE_RE).each do |bug_comment|
       bugno = bug_comment[0]
       comment = bug_comment[1] || ""
       bugno.gsub!(/^#/,'')


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/rbot-bugzilla:master commit in: /
@ 2024-02-10 19:22 Robin H. Johnson
  0 siblings, 0 replies; 11+ messages in thread
From: Robin H. Johnson @ 2024-02-10 19:22 UTC (permalink / raw
  To: gentoo-commits

commit:     242113aa6a719477ddf8246ed9a6104f2b7b9d63
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 10 19:22:07 2024 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sat Feb 10 19:22:07 2024 +0000
URL:        https://gitweb.gentoo.org/proj/rbot-bugzilla.git/commit/?id=242113aa

fix: missing field

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 bugzilla.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bugzilla.rb b/bugzilla.rb
index a4d88f5..8af205a 100644
--- a/bugzilla.rb
+++ b/bugzilla.rb
@@ -566,7 +566,7 @@ class BugzillaPlugin < Plugin
     # bug aliases can contain
     # 0-9, a-z, A-Z
     # and then every punctuation except ","
-    m.scan(MESSAGE_RE).each do |bug_comment|
+    m.message.scan(MESSAGE_RE).each do |bug_comment|
       bugno = bug_comment[0]
       comment = bug_comment[1] || ""
       bugno.gsub!(/^#/,'')


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-02-10 19:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-19  5:25 [gentoo-commits] proj/rbot-bugzilla:master commit in: / Robin H. Johnson
  -- strict thread matches above, loose matches on Subject: below --
2024-02-10 19:22 Robin H. Johnson
2024-02-10 19:13 Robin H. Johnson
2024-02-10  5:30 Robin H. Johnson
2024-02-09 19:44 Robin H. Johnson
2015-11-16  4:27 Robin H. Johnson
2015-11-16  4:27 Robin H. Johnson
2015-11-16  4:23 Robin H. Johnson
2015-11-16  4:23 Robin H. Johnson
2012-02-28  6:30 Robin H. Johnson
2011-09-22 23:14 Christian Ruppert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox