fedora-infra / supybot-fedora

Fedora plugin for Supybot
20 stars 23 forks source link

karma is not getting reset properly in Fedora #96

Open smooge opened 1 year ago

smooge commented 1 year ago

Something is causing zodbot .karma not to reset when a new release is marked as active in pdc. This seems to have started in 2022 as the karma for people in the F36 release was reset after the release in May 2022, but did not get done when F37 was released. Instead it finally reset sometime in February 2023.

When F38 was released on 2023-04-18, the pdc was updated and should give zodbot the knowledge the 'cycle' has changed. However the karma still seems to be 'stuck' on the previous ticket.

Requests:

  1. find out why updates aren't happening
  2. see if output can give the actual release cycle, to say 'Karma for nb changed to 2 (for the current release cycle): https://badges.fedoraproject.org/tags/cookie/any' to 'Karma for nb changed to 2 (for the release cycle $release): https://badges.fedoraproject.org/tags/cookie/any' where the release is given.
  3. If manual reset is needed, to document it for Fedora infrastructure.
Zlopez commented 1 year ago

I'm looking into this and the way the zodbot is retrieving the current_release is here.

Basically what it does is:

  1. Retrieve the active Fedora versions from PDC by calling https://pdc.fedoraproject.org/rest_api/v1/releases/?active=true&name=Fedora&release_type=ga&fields=version&ordering=version
  2. Ignores Rawhide and gets the max from data["results"]["version"], which should return the correct one.

When retrieving karma for specific user:

  1. Opens database
  2. Looks for the current release
  3. Gets the entry for user in db data["backwards-f<release>"]["<username>"]

The new entries should be created on demand when cookies are given to users during new release.

I don't see anythnig that could cause the issue when the new active version of Fedora is added to PDC, but I can at least add the release_cycle to the message given by zodbot.