#717 Fix rules broken due to bodhi 4 release
Merged 2 years ago by laxathom. Opened 2 years ago by misc.
misc/fedora-badges fix_bodhi  into  master

Fix rules broken due to bodhi 4 release
Michael Scherer • 2 years ago  
file modified
+2 -2
@@ -32,9 +32,9 @@ 

          topics:

          - "%(topic)s"     # The topic of the message that triggered us.

          users:

-         - "%(msg.update.submitter)s"  # The user that was created.

+         - "%(msg.update.user.name)s"  # The user that was created.

        operation: count

        condition:

          greater than or equal to: 1 

  

- recipient: "%(msg.update.submitter)s"

+ recipient: "%(msg.update.user.name)s"

file modified
+2 -2
@@ -27,9 +27,9 @@ 

          topics:

          - "%(topic)s"     # The topic of the message that triggered us.

          users:

-         - "%(msg.update.submitter)s"  # The user that was created.

+         - "%(msg.update.user.name)s"  # The user that was created.

        operation: count

        condition:

          greater than or equal to: 1 

  

- recipient: "%(msg.update.submitter)s"

+ recipient: "%(msg.update.user.name)s"

file modified
+2 -2
@@ -21,9 +21,9 @@ 

          topics:

          - "%(topic)s"     # The topic of the message that triggered us.

          users:

-         - "%(msg.update.submitter)s"

+         - "%(msg.update.user.name)s"

        operation: count

        condition:

          greater than or equal to: 1

  

- recipient: "%(msg.update.submitter)s"

+ recipient: "%(msg.update.user.name)s"

file modified
+2 -2
@@ -23,9 +23,9 @@ 

          topics:

          - "%(topic)s"     # The topic of the message that triggered us.

          users:

-         - "%(msg.update.submitter)s"  # The user that was created.

+         - "%(msg.update.user.name)s"  # The user that was created.

        operation: count

        condition:

          greater than or equal to: 1 

  

- recipient: "%(msg.update.submitter)s"

+ recipient: "%(msg.update.user.name)s"

file modified
+2 -2
@@ -23,11 +23,11 @@ 

          topics:

          - "%(topic)s"     # The topic of the message that triggered us.

          users:

-         - "%(msg.update.submitter)s"  # The user that was created.

+         - "%(msg.update.user.name)s"  # The user that was created.

          rows_per_page: 9999999

        operation:

            lambda: len([msg for msg in query.all() if msg.msg['update']['release']['id_prefix'] == 'FEDORA-EPEL'])

        condition:

          greater than or equal to: 200

  

- recipient: "%(msg.update.submitter)s"

+ recipient: "%(msg.update.user.name)s"

file modified
+2 -2
@@ -23,11 +23,11 @@ 

          topics:

          - "%(topic)s"     # The topic of the message that triggered us.

          users:

-         - "%(msg.update.submitter)s"  # The user that was created.

+         - "%(msg.update.user.name)s"  # The user that was created.

          rows_per_page: 9999999

        operation:

            lambda: len([msg for msg in query.all() if msg.msg['update']['release']['id_prefix'] == 'FEDORA-EPEL'])

        condition:

          greater than or equal to: 50

  

- recipient: "%(msg.update.submitter)s"

+ recipient: "%(msg.update.user.name)s"

@@ -26,9 +26,9 @@ 

          topics:

          - "%(topic)s"     # The topic of the message that triggered us.

          users:

-         - "%(msg.update.submitter)s"  # The user that was created.

+         - "%(msg.update.user.name)s"  # The user that was created.

        operation: count

        condition:

          greater than or equal to: 1 

  

- recipient: "%(msg.update.submitter)s"

+ recipient: "%(msg.update.user.name)s"

@@ -26,9 +26,9 @@ 

          topics:

          - "%(topic)s"     # The topic of the message that triggered us.

          users:

-         - "%(msg.update.submitter)s"  # The user that was created.

+         - "%(msg.update.user.name)s"  # The user that was created.

        operation: count

        condition:

          greater than or equal to: 20

  

- recipient: "%(msg.update.submitter)s"

+ recipient: "%(msg.update.user.name)s"

@@ -26,9 +26,9 @@ 

          topics:

          - "%(topic)s"     # The topic of the message that triggered us.

          users:

-         - "%(msg.update.submitter)s"  # The user that was created.

+         - "%(msg.update.user.name)s"  # The user that was created.

        operation: count

        condition:

          greater than or equal to: 100

  

- recipient: "%(msg.update.submitter)s"

+ recipient: "%(msg.update.user.name)s"

@@ -26,9 +26,9 @@ 

          topics:

          - "%(topic)s"     # The topic of the message that triggered us.

          users:

-         - "%(msg.update.submitter)s"  # The user that was created.

+         - "%(msg.update.user.name)s"  # The user that was created.

        operation: count

        condition:

          greater than or equal to: 500

  

- recipient: "%(msg.update.submitter)s"

+ recipient: "%(msg.update.user.name)s"

@@ -26,9 +26,9 @@ 

          topics:

          - "%(topic)s"     # The topic of the message that triggered us.

          users:

-         - "%(msg.update.submitter)s"  # The user that was created.

+         - "%(msg.update.user.name)s"  # The user that was created.

        operation: count

        condition:

          greater than or equal to: 1000

  

- recipient: "%(msg.update.submitter)s"

+ recipient: "%(msg.update.user.name)s"

file modified
+2 -2
@@ -26,9 +26,9 @@ 

          topics:

          - "%(topic)s"     # The topic of the message that triggered us.

          users:

-         - "%(msg.update.submitter)s"  # The user that was created.

+         - "%(msg.update.user.name)s"  # The user that was created.

        operation: count

        condition:

          greater than or equal to: 1 

  

- recipient: "%(msg.update.submitter)s"

+ recipient: "%(msg.update.user.name)s"

file modified
+2 -2
@@ -26,9 +26,9 @@ 

          topics:

          - "%(topic)s"     # The topic of the message that triggered us.

          users:

-         - "%(msg.update.submitter)s"  # The user that was created.

+         - "%(msg.update.user.name)s"  # The user that was created.

        operation: count

        condition:

          greater than or equal to: 20

  

- recipient: "%(msg.update.submitter)s"

+ recipient: "%(msg.update.user.name)s"

file modified
+2 -2
@@ -26,9 +26,9 @@ 

          topics:

          - "%(topic)s"     # The topic of the message that triggered us.

          users:

-         - "%(msg.update.submitter)s"  # The user that was created.

+         - "%(msg.update.user.name)s"  # The user that was created.

        operation: count

        condition:

          greater than or equal to: 100 

  

- recipient: "%(msg.update.submitter)s"

+ recipient: "%(msg.update.user.name)s"

file modified
+2 -2
@@ -26,9 +26,9 @@ 

          topics:

          - "%(topic)s"     # The topic of the message that triggered us.

          users:

-         - "%(msg.update.submitter)s"  # The user that was created.

+         - "%(msg.update.user.name)s"  # The user that was created.

        operation: count

        condition:

          greater than or equal to: 500 

  

- recipient: "%(msg.update.submitter)s"

+ recipient: "%(msg.update.user.name)s"

file modified
+2 -2
@@ -26,9 +26,9 @@ 

          topics:

          - "%(topic)s"     # The topic of the message that triggered us.

          users:

-         - "%(msg.update.submitter)s"  # The user that was created.

+         - "%(msg.update.user.name)s"  # The user that was created.

        operation: count

        condition:

          greater than or equal to: 1000 

  

- recipient: "%(msg.update.submitter)s"

+ recipient: "%(msg.update.user.name)s"

people in sysadmin-badges are getting a ton of mail due to that.

See https://pagure.io/fedora-badges/pull-request/691

Namely "how do the conditions work in order to sum up the old and the new messages?"

when was msg.update.user.name introduced ? Cause maybe the new format is sufficient. Since the url I linked on the breakage speak of bodhi 1.0, I suspect the update.user.name was added in bodhi 2.0.1 in september 2015.

The badges date back to 2013, so I suspect that indeed, we would need to do some magic to get the information in 2 formats.

in fact no. Since we are using the msg.update.user.name from the current message, we do not need to take anything else in account.

Take for example rules/bodhi-binary-star.yml. We do a query on users based on the current message, in "users". So that part is already handled. And we do substitute for recipient, and again, that part is done for the current message.

So to me, that should be good.

Is there anybody who can confirm or test that assumption? Because I certainly don't.

We can also decide to bite the bullet and merge this.

I'm ok w/ merging it

Pull-Request has been merged by laxathom

2 years ago