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

Make the list of banned users configurable #99

Open
abompard opened this issue Apr 24, 2024 · 10 comments
Open

Make the list of banned users configurable #99

abompard opened this issue Apr 24, 2024 · 10 comments
Assignees
Labels
good first issue Good for new contributors

Comments

@abompard
Copy link
Member

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).

@abompard abompard added the good first issue Good for new contributors label Apr 24, 2024
@jeffiscow2
Copy link

jeffiscow2 commented Jul 13, 2024

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
Copy link

If you look at

banned_usernames = frozenset(
[
"bodhi",
"bodhidev-bot",
"oscar",
"apache",
"koji",
"bodhi",
"taskotron",
"pagure",
"packit",
"packit-stg",
"koschei",
"distrobuildsync-eln/jenkins-continuous-infra.apps.ci.centos.org",
"osbuild-automation-bot",
"zodbot",
"root",
]

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
Copy link

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
Copy link

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
Copy link
Member Author

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!

@abompard
Copy link
Member Author

Hey @jeffiscow2 , are you still interested in working on this?

@jeffiscow2
Copy link

@abompard yeah I am. Just got busy for a bit with the kids starting school and even after reading everything I'm still lost. I'll need more guidance for sure, lol.

@abompard
Copy link
Member Author

Sure, just ask when you're ready.

@jeffiscow2
Copy link

I made some modifications to rules.py (changed the BadgesRule class) and created a skip_users.toml with the list of skipped usernames.

Let me know if I'm on the right track. I should be home all day to respond if you need to tell me anything.

https://github.com/jeffiscow2/fedbadges

@abompard
Copy link
Member Author

abompard commented Nov 6, 2024

Could you create a draft pull request? It would make reviewing easier. Thanks!

Also, you can use the [consumer_config] section in the main config file instead of adding a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for new contributors
Projects
None yet
Development

No branches or pull requests

3 participants