Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stable_karma and unstable_karma values in API data should not be allowed to be 'None' #274

Closed
tflink opened this issue Aug 20, 2015 · 6 comments
Labels
API Issues related to Bodhi's REST API Discussion Issues that may be controversial and warrant a discussion Migration Issues or pull requests that involve a database migration

Comments

@tflink
Copy link

tflink commented Aug 20, 2015

At the time I'm writing this, there are updates whose API data includes 'None' for the stable_karma and unstable_karma values. The example I hit is bash-4.3.42-1.fc21 but at least the updates for bash in other releases show the same issue in api data.

The updates submitted after the bodhi2 upgrade seem to have stable_karma (the updates for the latest gnome megaupdate and python-django amongst others do) where the updates that were submitted before the upgrade and migrated over to the new bodhi2 instance don't.

stable_karma is an important piece of data which should always be an integer. If the old updates are left as is (assuming I'm right about old updates not have stable_karma) they should at least return 0, a sane default (assuming that None means that nothing was changed from the default of 3) or some obvious filler data (-9999999).

@ralphbean
Copy link
Contributor

Looking back over the code, it seems like it is intentional to allow None values for karma thresholds.

  • The database models marks them as explicitly nullable.
  • The new update form allows you to check a box to disable "Auto-request stable"
  • When checked, that flag causes the server to delete the submitted values for stable and unstable threshold.

So, for some updates -- those thresholds are meaningless, and it makes sense to return a None value indicating as much.

Aside from that, it does look like a migration error caused the old karma thresholds to be dropped from all the migrated updates.... and that's worth fixing up(?)

@ralphbean ralphbean added API Issues related to Bodhi's REST API Discussion Issues that may be controversial and warrant a discussion Migration Issues or pull requests that involve a database migration labels Aug 21, 2015
@tflink
Copy link
Author

tflink commented Aug 21, 2015

So None for stable_karma means that auto-request has been disabled for that update?

@ralphbean
Copy link
Contributor

I'll hazard a "yes". That's the only circumstance I've found in the code where it gets set that way.

@sergiomb2
Copy link

Hi, stable_karma and unstable_karma simple disappear from all updates, I pretty sure because my updates don't have it now , and all had it . Also stable_karma is not working ,

https://bodhi.fedoraproject.org/updates/FEDORA-2015-4638

I think that had 3 for stable_karma, I added +1 karma yesterday , but bodhi2 haven't push it .

@ralphbean
Copy link
Contributor

@sergiomb2, that's a separate migration issue (that is in fact an issue). You can follow the status of that in #372.

As for this issue, Luke and I agree that having None for stable_karma means that auto-request has been disabled for that update.

@tflink
Copy link
Author

tflink commented Aug 26, 2015

Thanks for the clarification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Issues related to Bodhi's REST API Discussion Issues that may be controversial and warrant a discussion Migration Issues or pull requests that involve a database migration
Projects
None yet
Development

No branches or pull requests

3 participants