#579 Adjust pagure rules for new message format.
Closed 5 years ago by jflory7. Opened 6 years ago by ralph.
ralph/fedora-badges pagure-msg-format-change  into  master

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

          topics:

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

          users:

-         - "%(msg.commit.username)s"

+         - "%(msg.agent)s"

        operation: count

        condition:

          greater than or equal to: 1

  

- recipient: "%(msg.commit.username)s"

+ recipient: "%(msg.agent)s"

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

          topics:

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

          users:

-         - "%(msg.commit.username)s"

+         - "%(msg.agent)s"

        operation: count

        condition:

          greater than or equal to: 10

  

- recipient: "%(msg.commit.username)s"

+ recipient: "%(msg.agent)s"

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

          topics:

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

          users:

-         - "%(msg.commit.username)s"

+         - "%(msg.agent)s"

        operation: count

        condition:

          greater than or equal to: 1000

  

- recipient: "%(msg.commit.username)s"

+ recipient: "%(msg.agent)s"

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

          topics:

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

          users:

-         - "%(msg.commit.username)s"

+         - "%(msg.agent)s"

        operation: count

        condition:

          greater than or equal to: 150

  

- recipient: "%(msg.commit.username)s"

+ recipient: "%(msg.agent)s"

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

          topics:

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

          users:

-         - "%(msg.commit.username)s"

+         - "%(msg.agent)s"

        operation: count

        condition:

          greater than or equal to: 50

  

- recipient: "%(msg.commit.username)s"

+ recipient: "%(msg.agent)s"

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

          topics:

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

          users:

-         - "%(msg.commit.username)s"

+         - "%(msg.agent)s"

        operation: count

        condition:

          greater than or equal to: 500

  

- recipient: "%(msg.commit.username)s"

+ recipient: "%(msg.agent)s"

@bex mentioned that the pagure badges were broken. It seems like the pagure
message format may have changed at some point in the past, and these rules were
never updated to match the new format.

See an example message here:
https://apps.fedoraproject.org/datagrepper/id?id=2017-9c6f4d9f-577e-4347-829f-9952cd4b4ff3&is_raw=true&size=extra-large

rebased onto 85adab7

6 years ago

Should this PR address the "total_commits": 8, component of the message?

Hoo boy, that's going to be tricky.

This will get tricky.

We can rebrand the badges to be about "how many times you have pushed to a dist-git repo" and call it a day.

Otherwise:

  • I don't think it will be easy to call up a full list of those "total_commits" values, and sum them.
  • Imagine the case where you have 10 commits, and the message says there are two authors. Did one of them author one commit, and the other did 9? Did one author 5 and the other did the other 5? If we want to key off of commit authorship, the new messages aren't sufficiently structured.

Further, take a look at this message (it is the same message you posted, but with an additional meta argument): https://apps.fedoraproject.org/datagrepper/id?id=2017-4febfb40-6ee1-4a9f-a05c-cad8d01ba4da&is_raw=true&size=extra-large&meta=usernames

See that even though @stbuehler appears in the message, datagrepper only knows about @pingou's association with the event.

I am cool with counting pushes instead of commits. However, we need to count authors because, in the case of docs, not every author has commit/push rights.

Hoo boy, that's going to be tricky.
This will get tricky.
We can rebrand the badges to be about "how many times you have pushed to a dist-git repo" and call it a day.

The earlier version of pagure supported that. But, with the newer API it cannot distinguish between multiple authors.

@pingou ^^ as it sounds like we may need some pagure thinking here.

I thought there was a ticket to enhance the data provided in the fedmsg message but I'm not finding it.

If someone would want to adjust the hook, I'd review it :)

I'm marking this PR as blocked because of the external reasons mentioned above.

Metadata Update from @jflory7:
- Pull-request tagged with: blocked
- Request assigned

5 years ago

@pingou Almost a year has passed since this PR was opened ­– could Pagure support @ralph's change now? If not, I suggest we close this PR and reopen with a new PR when the fedora-messaging message support is there.

Metadata Update from @ralph:
- Request reset

5 years ago

@pingou Almost a year has passed since this PR was opened ­– could Pagure support @ralph's change now?

It does not no :(

@pingou Thanks for the quick answer. I'm going to close this as stale.

Pull-Request has been closed by jflory7

5 years ago