Update migrating issues deps script documentation.

Fixes the documentation clarifying what permissions to give the key.

also added note about how we can run the script for you using the
forgebot account.

Fixes #282

Signed-off-by: Ryan Lerch <rlerch@redhat.com>
This commit is contained in:
Ryan Lerch 2025-11-17 13:43:42 +10:00
commit 78d199b9af
2 changed files with 14 additions and 34 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View file

@ -18,6 +18,13 @@ This guide applies to Fedora Project contributors who have migrated their projec
* Issue assignments (who is assigned to work on each issue)
* Issue dependencies (which issues depend on other issues)
[IMPORTANT]
====
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 link:https://forge.fedoraproject.org/forge/forge[forge/forge] and request that an admin run the script for you. The admin will execute the script using the link:https://forge.fedoraproject.org/forgebot[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
@ -72,18 +79,12 @@ 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)
. Go to "Applications" → "Generate New Token"
. Give your token a descriptive name (e.g., "Migration Script")
. Select the appropriate scopes:
** `repo` - Required for reading and writing repository data
** `user` - Required for user-related operations
. Click "Generate Token"
. Copy the generated token and store it securely
[WARNING]
====
Keep your API key secure and never commit it to version control. Consider using environment variables or a secure configuration file.
====
. 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*
image:assign-script-permissions.png[]
. Click *Generate Token*
. Copy the generated token for use with the script.
=== Project Information
@ -124,25 +125,4 @@ python assign_and_depend.py \
--pagure-project "fedora-infra/ansible" \
--forgejo-api-key "gitea_abc123def456..." \
--forgejo-project "infrastructure/fedora-infrastructure"
----
==== Example 2: Using Environment Variables
For security, you can use environment variables:
[source,bash]
----
export FORGEJO_API_KEY="gitea_abc123def456..."
python assign_and_depend.py \
--pagure-project "fedora-infra/ansible" \
--forgejo-api-key "$FORGEJO_API_KEY" \
--forgejo-project "infrastructure/fedora-infrastructure"
----
== Conclusion
The `assign_and_depend.py` script is a critical tool for completing the migration from Pagure.io to Fedora Forge. While the built-in migrator handles the basic project structure, this script ensures that important metadata like issue assignments and dependencies are preserved.
Follow this guide carefully, test with small datasets first, and always verify your results. With proper preparation and execution, you can successfully restore all your project's issue relationships on Fedora Forge.
Last updated in {year}.
----