Migrating Issue Dependencies and Assignments from Pagure.io to Fedora Forge
|
DRAFT DOCUMENTATION: This documentation is currently in draft form and may not be fully tested and correct. Please verify all procedures before use and report any issues or inaccuracies. |
Purpose
This document provides a comprehensive guide for using the assign_and_depend.py script to restore issue dependencies and assignments after migrating a project from Pagure.io to Fedora Forge. The built-in migrator does not handle this critical metadata, making this script an essential post-migration step.
Scope
This guide applies to Fedora Project contributors who have migrated their projects from Pagure.io to Fedora Forge and need to restore:
-
Issue assignments (who is assigned to work on each issue)
-
Issue dependencies (which issues depend on other issues)
|
When running this script with an access token from your user account, all issue assignment and dependency changes will be logged in the issue history as actions performed by your user. If you prefer these changes to be attributed to the system bot account instead, please file a ticket at forge/forge and request that an admin run the script for you. The admin will execute the script using the forgebot user account, which will attribute all changes to the system bot. |
Prerequisites
-
Migrated Project: Your project must already be migrated from Pagure.io to Fedora Forge
-
Python Environment: Python 3.6 or later with pip installed
-
Required Dependencies: The following Python packages must be installed:
-
requests- For making HTTP requests to Pagure API -
backoff- For retry logic with exponential backoff -
click- For command-line interface -
pyforgejo- For interacting with Forgejo API
-
-
API Access:
-
Forgejo API key with write permissions to the target repository
-
Access to Pagure.io API (publicly accessible)
-
Installation
Installing Required Dependencies
It’s recommended to use a Python virtual environment to avoid conflicts with system packages. Create and activate a virtual environment, then install the required packages:
python -m venv migration-env
source migration-env/bin/activate
pip install requests backoff click pyforgejo
When you’re done with the migration, you can deactivate the virtual environment:
deactivate
Obtaining Required Information
Forgejo API Key
To obtain a Forgejo API key:
-
Log in to your Fedora Forge account
-
Navigate to your user settings (click your avatar in the top-right corner)
-
In the Left Tab bar, Go to Applications
-
In the Access tokens section, under Generate new Token enter the name for your token under Token Name (e.g., "Migration Script")
-
Under Select Permissions, ensure that issue is set to read and write

-
Click Generate Token
-
Copy the generated token for use with the script.
Usage
Basic Command Structure
The script uses the following command structure:
python assign_and_depend.py \
--pagure-project "PAGURE_PROJECT_NAME" \
--forgejo-api-key "YOUR_API_KEY" \
--forgejo-project "FORGEJO_PROJECT_NAME"
Command-Line Options
-
--pagure-base-url: Base URL for Pagure API (default:https://pagure.io/api/0) -
--pagure-project: Pagure project name, including namespace if applicable (required) -
--forgejo-base-url: Base URL for Forgejo API (default:https://forge.fedoraproject.org/api/v1) -
--forgejo-api-key: Your Forgejo API key (required) -
--forgejo-project: Forgejo project name in formatorganization/project(required)
Want to help? Learn how to contribute to Fedora Docs ›