#5137 Add total_commits per author to git.receive notification
Closed by ryanlerch. Opened by oturpe.
oturpe/pagure author-commit-count-notification  into  master

Download 5137.patch

Currently, Fedora Badge "Long Life to Pagure" does not function correctly. The issues it has are described at https://pagure.io/fedora-badges/pull-request/806

One of the issues can be solved by simply making Pagure's git.receive notification list commit count per author. Exactly that is added here.

The notification schema is only changed by adding a new field, which should be non breaking.

Should also the USER schema at pagure-messages be updates? Which one should be done first?

Should also the [USER schema at pagure-messages][schema] be updates? Which one should be done first?

Yes the schema should be updated, we can do the change in the payload first
since we're adding to it, so it won't break the existing schemas

You can drop the .keys() here, it's actually making python slower: http://blog.pingoured.fr/index.php?post/2012/03/12/Python-notes-to-self

2 new commits added

  • Add total_commits per author to git.receive notification
  • Add __pycache__ to .gitignore

Should also the [USER schema at pagure-messages][schema] be updates? Which one should be done first?

Yes the schema should be updated, we can do the change in the payload first
since we're adding to it, so it won't break the existing schemas

Schema update: pagure-messages pull request 6

.keys() dropped.

rebased onto f9e8ce7d51fb69ec91943106416dfddaa283953a

pretty please pagure-ci rebuild

rebased onto aaa739064b5b19e1552fb739bee9ec3f1453cf2a

rebased onto b608113da16b72e9b9217fe6c83944294a37d628

I actually like the proposed changes and think this one and https://pagure.io/pagure-messages/pull-request/6 should be merged. It looks like that I can't rebase this PR to run the unit tests. @ngompa can you rebase? If not, do you want me to create a fresh PR based on the patches?
Btw I learned this week about Fedora Badges and think we should also work to get https://pagure.io/fedora-badges/pull-request/806 reverted and Pagure badges back ;)

This pull request has conflicts, I cannot rebase it. I think a new pull request will need to be made.

rebased onto f729ddae51c40a7d92e2db3b195f509ade331e4a

I (technically) fixed the conflict and pushed. However, there are still some unsolved problems:

First, some test data initialization errors about KeyError: refs/heads/main when running Tox on Python 3.12 environment locally. It has a single line quick fix, which I did not sanity check properly yet. Probably all test code should switch to default branch name main, or test support code should stop assuming master branch being the default head. Something like that.

Second, there seems to be some confusion about the meaning of first and last element in the revs list given to send_notifications(). The code that produces start_commit and end_commit in the notification assumes the final commit is the first element, while the code that produces changed_files assumes the final commit is the last element. It looks like a bug to me (ping @nforro as the author of the changed files code, which was added last).

rebased onto 5c7b9523aef4b893168374b5d8b73ec9356b14cf

This project has moved to https://forge.fedoraproject.org/apps/pagure. As part of the migration, all open pull requests on pagure.io have been closed. If you'd like to continue working on this, please fork the repository on the new forge and re-submit your PR there.

Pull-Request has been closed by ryanlerch

Metadata