| .cursor/plans | ||
| .gitignore | ||
| forge_migrate_story_points.py | ||
| pagure_add_migration_comment.py | ||
| pagure_create_issues.py | ||
| README.md | ||
| requirements.txt | ||
Forge Helpers
This repository contains various helpers used for migrating Fedora QA repositories from Pagure into Fedora Forge (based on Forgejo), and mass-changing the target tickets if there is some subsequent action needed.
Setup
# Create and activate virtualenv
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
Pagure API Token
Several scripts require a Pagure API token for authentication. To create one:
- Log in to Pagure
- Go to your API settings
- Click "Create new API key"
- Select the required ACLs (e.g., "Comment on a ticket" for adding migration comments)
- Save the token to a file (e.g.,
~/.pagure-token) for use with--token-file
Forge (Forgejo) API Token
Several scripts require a Forge API token for authentication. To create one:
- Log in to Fedora Forge
- Go to your Applications settings
- Under "Manage Access Tokens", enter a token name and select the required scopes (e.g., "write:issue" for modifying issues)
- Click "Generate Token"
- Save the token to a file (e.g.,
~/.forge-token) for use with--token-file
Scripts
pagure_add_migration_comment.py
Adds a migration notice comment to Pagure tickets, linking to their new Forge location.
Usage:
# Dry run on all issues (preview without making changes)
python pagure_add_migration_comment.py https://pagure.io/fedora-qa/some-repo \
https://forge.fedoraproject.org/quality/some-repo \
--token-file ~/.pagure-token --dry-run
# Process specific issues on staging instances
python pagure_add_migration_comment.py https://stg.pagure.io/fedora-qa/some-repo \
https://forge.stg.fedoraproject.org/quality/some-repo \
--token-file ~/.pagure-token --issues 1 2 3
Run with --help for all available options.
pagure_create_issues.py
Creates numbered test issues in a Pagure repository. Useful for testing or setting up migration scenarios.
Usage:
# Dry run creating 5 issues (preview without making changes)
python pagure_create_issues.py https://pagure.io/fedora-qa/some-repo \
--count 5 --token-file ~/.pagure-token --dry-run
# Create 10 issues on staging Pagure
python pagure_create_issues.py https://stg.pagure.io/fedora-qa/some-repo \
--count 10 --token-file ~/.pagure-token
# Create issues with longer delay between calls
python pagure_create_issues.py https://pagure.io/fedora-qa/some-repo \
--count 3 --token-file ~/.pagure-token --delay 2.0
Run with --help for all available options.
forge_migrate_story_points.py
Migrates story points from Pagure custom fields to Forge labels. Reads the story_points custom field from Pagure issues and applies corresponding point labels (points/01, points/02, points/03, points/05, points/08, points/13) to the matching Forge issues.
Usage:
# Dry run on all issues (preview without making changes)
python forge_migrate_story_points.py https://pagure.io/fedora-qa/some-repo \
https://forge.fedoraproject.org/quality/some-repo \
--token-file ~/.forge-token --dry-run
# Process specific issues
python forge_migrate_story_points.py https://pagure.io/fedora-qa/some-repo \
https://forge.fedoraproject.org/quality/some-repo \
--token-file ~/.forge-token --issues 1 2 3
Run with --help for all available options.
Note
Most of the code in this repository is AI-generated using Claude (Anthropic) via Cursor IDE.