From f0f78e7640facc174db78a5be8427f983b7fefe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Wed, 15 May 2024 19:18:49 -0400 Subject: [PATCH] Document importing issues and some troubleshooting tips --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 3d9128c..1dc9afb 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,14 @@ cp .env.example .env Set your instance URL there and your API token (with permission to read and write issues at least). +## Import issues + +Put your issues in a CSV with the title as the first column. Include a column label (such as "Issue") as the first row will be skipped. No other columns from the CSV will be imported, although it should not be hard to extend this script to import a description (as first comment). Do not include issue titles greater than 255 characters; this will result in a `KeyError: 'html_url'` that really means the server gave a 500 error. + +```bash +python import_issues.py example-org example-repo stories.csv +``` + ## Move issues Currently this is the only script: @@ -29,3 +37,9 @@ It would be easy to change it so these could be environment variables so that on It would not be too hard to allow separate source and destination instances and auth tokens, either, which could give this script a reason for being even after [#1280 - [FEAT] transfer issues to another repo - forgejo](https://codeberg.org/forgejo/forgejo/issues/1280) lands! Although it is probably best to prioritize bulk export and import of issues even over moving single issues, as that tests the API the best and covers the broadest use cases. + +## Troubleshooting + +### "The target couldn't be found." + +404 errors like that probably mean the user whose API token you are using (for Agaric, we typically use tobor) does not have permission to see your repository/organization; the organization needs to be public or the user needs to be added to it.