Claude Code plugin for reviewing and merging Fedora dist-git pull requests created by Packit automation.
This plugin helps Packit maintainers review downstream Fedora dist-git PRs created during the release process. For each Fedora dist-git branch, Packit creates 4 pull requests:
- Production Packit using
propose_downstreamjob - Production Packit using
pull_from_upstreamjob - Staging Packit using
propose_downstreamjob - Staging Packit using
pull_from_upstreamjob
The plugin analyzes all 4 PRs, compares them for consistency, reviews spec file changes, validates CI test results, and guides you through merging the correct PR (typically staging pull_from_upstream) and closing the others.
From the plugin directory:
cd packit-distgit-reviewer
pip install -r requirements.txtThe plugin requires a Fedora dist-git API token. Two configuration methods are supported:
Option 1: Use existing Packit configuration (Recommended)
If you have ~/.config/packit.yaml with a Pagure token, it will be automatically used:
authentication:
pagure:
token: YOUR_TOKEN_HERE
instance_url: https://src.fedoraproject.orgOption 2: Environment variable
export FEDORA_DISTGIT_TOKEN="your-token-here"Creating a new token:
- Visit https://src.fedoraproject.org/settings/token/new
- Create a token with appropriate permissions
- Configure using Option 1 or Option 2 above
The plugin is automatically available in Claude Code once the symlink is created in the root .claude/commands/ directory.
Review and merge Fedora dist-git PRs for a specific package, version, and branch.
Syntax:
/packit-distgit-reviewer:review-fedora-distgit-prs <PACKAGE> <VERSION> <DIST_GIT_BRANCH>
Example:
/packit-distgit-reviewer:review-fedora-distgit-prs packit 1.11.1 f42
Supported packages:
packitpython-ogrpython-specfile
- Fetches PR information - Retrieves all 4 PRs created for the specified version and branch
- Analyzes changes - Reviews spec file updates, source checksums, changelog entries
- Monitors CI tests - Waits for all CI tests to complete and analyzes results
- Compares PRs - Validates consistency across all 4 PRs
- Provides recommendations - Suggests which PR to merge and which to close
- Executes actions - Merges and closes PRs after user confirmation
The plugin performs comprehensive checks including:
- Version and release number updates
- Changelog format and content
- Source file checksums
- Testing plan updates
- Upstream reference validation
- Fedora packaging guidelines compliance
- CI test status and results
- PR consistency across all 4 PRs
The plugin uses scripts/packit-distgit-updater.py to interact with Fedora dist-git. You can also use it directly:
Print PR information:
./scripts/packit-distgit-updater.py print-pr <PACKAGE> <VERSION> <DIST_GIT_BRANCH>Merge a PR:
./scripts/packit-distgit-updater.py merge <PACKAGE> <PR_ID>Close a PR:
./scripts/packit-distgit-updater.py close <PACKAGE> <PR_ID>The workflow waits for all CI checks to complete. Currently, some Fedora CI checks (rpmlint, rpminspect) may show as pending even when finished due to a status sync issue.
Workaround: Inspect the checks manually and tell Claude to proceed:
Ignore the pending CI results, they are complete and passed but statuses were not properly synced. Proceed with rest of the steps.
packit-distgit-reviewer/
├── .claude/
│ └── commands/
│ └── review-fedora-distgit-prs.md # Claude Code command definition
├── scripts/
│ └── packit-distgit-updater.py # Python helper script
├── requirements.txt # Plugin dependencies
├── plugin.yaml # Plugin metadata
└── README.md # This file
This plugin is part of the Packit internal AI workflows repository. For issues or contributions, please refer to the main repository documentation.
See the main repository for license information.