fedora-infra / fedbadges

Fedora Badges Consumer for fedmsg
GNU General Public License v2.0
21 stars 26 forks source link

Make the list of banned users configurable #99

Open abompard opened 4 months ago

abompard commented 4 months ago

In fedbadges/rules.py, there's a list of banned users that should be skipped when awarding badges. This should be in the configuration (and please rename it to skip_users, we don't actually "ban" bodhi or pagure).

jeffiscow2 commented 2 months ago

I'm new to all this, and I'd really like to help because I love collecting the fedora badges.

If I understand this issue correctly, is it asking to just have the "banned_usernames" variable name changed to "skip_users"? I'm not sure what "make a list of banned users configurable" means. Configurable how? Is there some type of command line tool, or is there a UI I'd need to tie this into for that?

Thanks for any guidance you can give.

I've read a bunch of the documentation on the badges rewrite still wrapping my head around it all.

penguinpee commented 2 months ago

If you look at

https://github.com/fedora-infra/fedbadges/blob/a230c7525d1e4c8137a4660c81227a64f601a1fb/fedbadges/rules.py#L93-L110

you can see the list of "banned" users is statically maintained in the code. My guess is that should be runtime configurable (e.g. maintained in and read from a config file or such). I'm not sure what runtime configuration is currently used. I guess some Python or YAML file. Aurélien will know for sure.

The name of that parameter should be skip_users instead of banned_usernames.

Thanks for taking a deep dive!

jeffiscow2 commented 2 months ago

you can see the list of "banned" users is statically maintained in the code. My guess is that should be runtime configurable (e.g. maintained in and read from a config file or such). I'm not sure what runtime configuration is currently used. I guess some Python or YAML file. Aurélien will know for sure.

I'll look into the documentation about runtime configuration and see if I can figure it out while I wait for confirmation. Thanks again!

jeffiscow2 commented 2 months ago

Looks like I found my answer by looking at the readme lol. I just assumed it was the same kinda stuff from https://fedora-arc.readthedocs.io/en/latest/badges/index.html.

smh

abompard commented 1 month ago

Hey @jeffiscow2 ! The configuration for the consumer is in the Fedora Messaging TOML file (described here). There's an example in fedbadges.toml.example at the root of the repo, and there's the one used by the Vagrant development environment in devel/ansible/roles/dev/files/config.toml.

The content of the consumer_config dict is available in Rule objects as self.config, so you can use that. Let me know if you have any questions!