Add stage/prod support, test suite, and fix issues #14 and #18 #20

Closed
psklenar wants to merge 6 commits from feature/stage-prod-support into main
Owner

Summary

Add multi-environment support and comprehensive test suite for IssueBot.

Changes

Features

  • Environment-based configuration via BUGZILLA_URL, DISCOURSE_URL env vars
  • Complete test suite with 2 tests (test-find-updates, test-clean-declined)
  • Whiteboard update retry logic with verification (3 attempts)
  • HIDE_CLOSED_DAYS override for testing (default: 7)
  • Comprehensive documentation in docs/

Bug Fixes

  • Fix #14: Handle Bodhi updates with package lists (pkg1, pkg2, and N more)
  • Fix #18: Use correct URLs in stage environment

Files

  • Added: test/ (8 files), docs/ (3 files)
  • Modified: issuebot.py (180 insertions, 63 deletions)

Testing

export BUGZILLA_URL="bugzilla.stage.redhat.com"
export DISCOURSE_URL="discussion.stg.fedoraproject.org"
export UPDATEINFO_USER="psklenar" # user with rights to edit whiteboard, user issuebot hasnt now
export FORCE_VERSIONS="40" # current fedora version in stage bugzilla
export BUGZILLA_API_STG_KEY='api key to stage bz with rights to edit whiteboard (issuebot api key hasnt)'
export DISCOURSE_API_STG_KEY='issuebot api key'

bash test/test-find-updates.sh

Fixes #14, #18

## Summary Add multi-environment support and comprehensive test suite for IssueBot. ## Changes ### Features - Environment-based configuration via `BUGZILLA_URL`, `DISCOURSE_URL` env vars - Complete test suite with 2 tests (`test-find-updates`, `test-clean-declined`) - Whiteboard update retry logic with verification (3 attempts) - `HIDE_CLOSED_DAYS` override for testing (default: 7) - Comprehensive documentation in `docs/` ### Bug Fixes - Fix #14: Handle Bodhi updates with package lists `(pkg1, pkg2, and N more)` - Fix #18: Use correct URLs in stage environment ### Files - Added: `test/` (8 files), `docs/` (3 files) - Modified: `issuebot.py` (180 insertions, 63 deletions) ## Testing ```bash export BUGZILLA_URL="bugzilla.stage.redhat.com" export DISCOURSE_URL="discussion.stg.fedoraproject.org" export UPDATEINFO_USER="psklenar" # user with rights to edit whiteboard, user issuebot hasnt now export FORCE_VERSIONS="40" # current fedora version in stage bugzilla export BUGZILLA_API_STG_KEY='api key to stage bz with rights to edit whiteboard (issuebot api key hasnt)' export DISCOURSE_API_STG_KEY='issuebot api key' bash test/test-find-updates.sh ``` Fixes #14, #18
- Add environment-based configuration (BUGZILLA_URL, DISCOURSE_URL)
- Fix issue #14: Handle Bodhi updates with package lists
- Fix issue #18: Use correct URLs in stage environment
- Add complete test suite (test-find-updates, test-clean-declined)
- Add whiteboard update retry logic with verification
- Add HIDE_CLOSED_DAYS environment variable for testing
- Add comprehensive documentation (docs/)
- Add TODO for CommonBugs keyword removal in clean_declined

Fixes: #14, #18
Replace unsupported 'note' syntax with state descriptions
Owner

Thanks for the PR! There are lots of generated changes, and we'll need to split this into separate PRs in order keep our sanity 🙂

Please cancel this PR and instead create individual PRs for:

  1. Adding generated docs. @adamwill @jgroman Should there be some central AGENTS.md that AI agents read by default? And perhaps links to other files if the agent needs some special knowledge? Or is it OK as it is?
  2. The actual fix for #14 . Please keep the changes minimal.
  3. The actual fix for #18 . Please keep the changes minimal.
  4. Adding tests. (It would be nice to see a standard test suite that mocks Bugzilla rather than/in addition to scripts that do real stuff. But I understand you don't have experience with it and it can be a gradual process).
  5. Any other improvements that you'd like to see in the code.

It might be better to go one-by-one instead of creating all the PRs simultaneously, I think. Otherwise there might be lots of refactoring, when code changes in one PRs, and affects all the other PRs.

Thanks for the PR! There are lots of generated changes, and we'll need to split this into separate PRs in order keep our sanity 🙂️ Please cancel this PR and instead create individual PRs for: 1. **Adding generated docs**. @adamwill @jgroman Should there be some central AGENTS.md that AI agents read by default? And perhaps links to other files if the agent needs some special knowledge? Or is it OK as it is? 2. **The actual fix for #14** . Please keep the changes minimal. 3. **The actual fix for #18** . Please keep the changes minimal. 4. **Adding tests**. (It would be nice to see a standard test suite that mocks Bugzilla rather than/in addition to scripts that do real stuff. But I understand you don't have experience with it and it can be a gradual process). 5. **Any other improvements that you'd like to see in the code.** It might be better to go one-by-one instead of creating all the PRs simultaneously, I think. Otherwise there might be lots of refactoring, when code changes in one PRs, and affects all the other PRs.
Owner

@kparal wrote in #20 (comment):

Should there be some central AGENTS.md that AI agents read by default? And perhaps links to other files if the agent needs some special knowledge? Or is it OK as it is?

I think this would be very useful as AGENTS.md is autodiscovered by AI and it would definitely save some tokens otherwise spent on scanning the project over and over again. Apparently it is also possible to have such file in any subfolder or add any links to it to feed AI more info as necessary.

brb, adding AGENTS.md to my own projects.

@kparal wrote in https://forge.fedoraproject.org/quality/issuebot/pulls/20#issuecomment-760555: > Should there be some central AGENTS.md that AI agents read by default? And perhaps links to other files if the agent needs some special knowledge? Or is it OK as it is? I think this would be very useful as AGENTS.md is autodiscovered by AI and it would definitely save some tokens otherwise spent on scanning the project over and over again. Apparently it is also possible to have such file in any subfolder or add any links to it to feed AI more info as necessary. brb, adding AGENTS.md to my own projects.
Owner

In that case, maybe we can have some common techniques shared across all our projects. For example having docs/ for human-oriented consumption (mostly handcrafted, more carefully reviewed), and docs/ai/ for AI-oriented consumption (mostly generated, frequently regenerated to be up-to-date, with just a quick skim review).

AGENTS.md can then live in docs/ai/AGENTS.md, and can instruct the AI to read everything in docs/ai/ if it needs more context (we can generate short descriptions of each file directly into AGENTS.md), or even docs/ for human-oriented instructions.

This almost feels like we'll need some central AI-skills repository soon, implementing these workflows...

In that case, maybe we can have some common techniques shared across all our projects. For example having `docs/` for human-oriented consumption (mostly handcrafted, more carefully reviewed), and `docs/ai/` for AI-oriented consumption (mostly generated, frequently regenerated to be up-to-date, with just a quick skim review). `AGENTS.md` can then live in `docs/ai/AGENTS.md`, and can instruct the AI to read everything in `docs/ai/` if it needs more context (we can generate short descriptions of each file directly into `AGENTS.md`), or even `docs/` for human-oriented instructions. This almost feels like we'll need some central **AI-skills** repository soon, implementing these workflows...
Author
Owner

Closing to split into more PR

Closing to split into more PR
psklenar closed this pull request 2026-06-01 11:36:54 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
quality/issuebot!20
No description provided.