Skip to content

Instantly share code, notes, and snippets.

@okurz
Created February 23, 2026 09:45
Show Gist options
  • Select an option

  • Save okurz/90916a92bf29f0d62fb515a399d9f40b to your computer and use it in GitHub Desktop.

Select an option

Save okurz/90916a92bf29f0d62fb515a399d9f40b to your computer and use it in GitHub Desktop.
qem-bot AGENTS.md
# qem-bot
## Project Overview
`qem-bot` is a Python command-line tool for scheduling maintenance tests on openQA based on SMELT incidents and Gitea PRs. It is tightly coupled with `qem-dashboard` where it reads and updates information about submissions and related openQA tests.
The project is structured as a Python application with the main logic in the `openqabot` package. It uses `argparse` to handle command-line arguments and subcommands.
**Key Technologies:**
* Python
* osc
* openqa-client
* pika
* zstandard
* requests
* ruamel.yaml
* jsonschema
* lxml
* PyYAML
* ty (Type checker)
* ruff (Linter & Formatter)
* radon (Maintainability metric)
* vulture (Dead code finder)
## Building and Running
### Dependencies
It is recommended to use `uv` for dependency management and local development:
```bash
uv sync
```
Alternatively, you can install the required Python packages using pip:
```bash
pip install -r requirements.txt
```
For development, install the development dependencies:
```bash
pip install -r requirements-dev.txt
```
### Running the bot
The bot is executed using the `qem-bot.py` script. It requires a subcommand and various options.
**General Usage:**
```bash
python qem-bot.py [subcommand] [options]
```
**Subcommands:**
* `full-run`: Full schedule for Maintenance Submissions in openQA
* `submissions-run`: Submissions only schedule for Maintenance Submissions in openQA
* `updates-run`: Updates only schedule for Maintenance Submissions in openQA
* `smelt-sync`: Sync data from SMELT into QEM Dashboard
* `gitea-sync`: Sync data from Gitea into QEM Dashboard
* `inc-approve`: Approve submissions which passed tests
* `inc-comment`: Comment submissions in BuildService
* `inc-sync-results`: Sync results of openQA submissions jobs to Dashboard
* `aggr-sync-results`: Sync results of openQA aggregates jobs to Dashboard
* `increment-approve`: Approve the most recent product increment for an OBS project if tests passed
* `repo-diff`: Computes the diff between two repositories
* `amqp`: AMQP listener daemon
For more detailed information on the arguments for each subcommand, run:
```bash
python qem-bot.py [subcommand] --help
```
### Configuration
The bot requires a configuration file or directory, which can be specified using the `-c` or `--configs` option. The default configuration path is `/etc/openqabot`.
## Development Conventions
### Files and Directories
* **Never Delete tasks/**: Always preserve files in the `tasks/` directory. They are considered permanent artifacts for tracking and context.
### Commit Strategy and Validation
* **Small, Atomic Commits:** Always create individual, small, easy to review commits for changes. Each commit should represent a single logical step.
* **Separation of Concerns:** Do not mix refactoring with functional changes or style fixes in the same commit.
* **Fully Validated Steps:** Every single commit must be fully validated. Before committing, always run:
```bash
make tidy checkstyle typecheck-ty test-with-coverage
```
* **100% Coverage:** Ensure 100% code coverage for every change and no regressions.
### Code Style
The project uses `ruff` for linting and code formatting. Before committing any changes, run the following command to format the code and check for style issues:
```bash
make tidy
```
**Hint:** Run `make tidy` to automatically fix trivial issues like formatting or missing newlines instead of trying to fix them manually.
To run all style checks (including maintainability and dead code checks) run:
```bash
make checkstyle
```
### Type Checking
The project uses both `ty` for type checking. Ensure no errors are reported by either tool:
```bash
make typecheck-ty
```
### Testing
The project uses `pytest` for unit testing. To run the tests, use the following command:
```bash
make test
```
or
```bash
pytest
```
### Continuous Integration
The project uses GitHub Actions for continuous integration. The CI pipeline is defined in the `.github/workflows/ci.yml` file. It enforces code coverage, style, and type checks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment