- Python 100%
|
All checks were successful
Run tests / test (pull_request) Successful in 28s
- Enable use of specific Kerberos principal using --krb-principal CLI option - Add principal autodetection if possible - Add --user-details CLI option to request fetching real user names from FAS - Fix FAS login error handling - Extend tests to cover implemented changes Fixes #8 Assisted-By: Claude Code |
||
|---|---|---|
| .forgejo/workflows | ||
| tests | ||
| .gitignore | ||
| COPYING.AGPL3 | ||
| COPYING.GPL2 | ||
| pyproject.toml | ||
| README.md | ||
| requirements-dev.txt | ||
| requirements-test.txt | ||
| requirements.txt | ||
| stats_bodhi.py | ||
| stats_bugzilla.py | ||
qa-stats
This project contains scripts for generating statistics on Fedora QA contributions to various systems. These scripts are primarily used to generate the 'Heroes of Fedora' posts which identify and thank major QA contributors.
Note that it previous contained stats-wiki.py (for generating user stats from Wikitcms release validation testing) and testcase_stats (for generating some longitudinal information on Wikitcms validation test coverage). Both these functions have been merged into the relval project, as relval user-stats and relval testcase-stats respectively.
Also note that this project was split out of the old combined fedora-qa Fedora Hosted repository using git filter-branch, and some early history (before the files were moved to a subdirectory) has been lost. A git expert could probably retrieve it from the backup objects.
stats_bodhi
stats_bodhi.py gathers statistics on feedback to Fedora's update feedback system, Bodhi. It lists all users who posted more than X comments, where X is a configurable cut-off, by default 1. It shows exactly how many comments each person above the cut-off posted, and gives a count of users who submitted more than 0 but fewer than X comments. It also gives a total count of all users who submitted comments, and a total count of all comments submitted. It excludes known bot accounts.
You can tell it to only consider updates submitted within a specific time frame, or for a specific release. Run stats_bodhi.py --help for instructions. It requires the bodhi-client and fasjson-client libraries. By default the script uses FAS login names only. If you pass the --user-details flag, it will query the Fedora Account System (FAS) for real names and Red Hat affiliation, which requires Kerberos authentication. The script auto-detects your @FEDORAPROJECT.ORG principal from the credential cache; use --krb-principal to override it. See the Fedora Kerberos setup guide for instructions on configuring Kerberos and obtaining a ticket with kinit.
stats_bodhi Usage
# Basic usage - all releases, no date constraints (FAS login names only)
./stats_bodhi.py > bodhi.html
# Specific release and date range
./stats_bodhi.py -r F44 -s 2026-03-01 -e 2026-05-01 > bodhi.html
# With a higher threshold (only show users with 5+ comments)
./stats_bodhi.py -r F44 -s 2026-03-01 -e 2026-05-01 -t 5 > bodhi.html
# Include real names from FAS (requires Kerberos)
./stats_bodhi.py -r F44 -s 2026-03-01 -e 2026-05-01 --user-details > bodhi.html
# Use a specific Kerberos principal for FAS authentication
./stats_bodhi.py -r F44 --user-details --krb-principal user@FEDORAPROJECT.ORG > bodhi.html
stats_bodhi's license is GNU GPLv2+.
stats_bugzilla
stats_bugzilla.py gathers statistics on bugs submitted to Bugzilla against Fedora. Like stats_bodhi, it lists all users who submitted more than X reports, where X is a configurable cut-off which defaults to 1. It shows the number of reports each user submitted, along with how many of them were accepted as 'release blocking' bugs, and how many were 'excess' reports (which means they were closed as NOTABUG, WONTFIX, WORKSFORME, CANTFIX or INSUFFICIENT_DATA). It also gives a total count of all users who submitted any bug reports, and a total count of reports. It excludes known bot accounts.
You must pass it a release number and a milestone, which tell it which blocker tracker bug to check against, and a time frame (a 'from' date and a 'to' date). It will check all new reports within that timeframe, and check whether they were accepted as blockers for the specified release and milestone. Run stats_bugzilla.py --help for instructions. It requires the bugzilla library, which is provided by the python3-bugzilla package on Fedora or Python package python-bugzilla.
Authentication
The script requires authentication to Red Hat Bugzilla. There are three ways to authenticate, in order of precedence:
- API key from CLI: Pass it via the
-k/--api-keyflag. - API key from config: Store it in
~/.config/python-bugzilla/bugzillarc. The script picks it up automatically. - Interactive login: If neither of the above is set, the script prompts for username and password.
Please note that API key in bugzillarc is stored in plaintext format. This is unsafe and not really recommended if it can be avoided.
If using CLI option --api-key you can prepend your stats_bugzilla.py command with "space" character to prevent it from being stored in command history.
To set up an API key:
- Log in to https://bugzilla.redhat.com, go to Preferences → API Keys, and generate a new key.
- Optional / Unsafe: Save it to
bugzillarcso the script picks it up automatically:
bugzilla --bugzilla=https://bugzilla.redhat.com login --api-key
This will prompt you to paste the API key and store it in ~/.config/python-bugzilla/bugzillarc.
stats_bugzilla Usage
# With API key from CLI
./stats_bugzilla.py -k YOUR_API_KEY 38 Beta 2023-01-01 2023-06-30 > bugzilla.html
# With API key stored in bugzillarc (no -k needed)
./stats_bugzilla.py 38 Beta 2023-01-01 2023-06-30 > bugzilla.html
# Interactive login fallback (prompts for username/password)
./stats_bugzilla.py 38 Beta 2023-01-01 2023-06-30 > bugzilla.html
# With a higher threshold (only show users with 5+ reports)
./stats_bugzilla.py -t 5 38 Beta 2023-01-01 2023-06-30 > bugzilla.html
stats_bugzilla's license is GNU GPLv2+.