Document importing issues and some troubleshooting tips

This commit is contained in:
benjamin melançon 2024-05-15 19:18:49 -04:00
parent a3b0596584
commit f0f78e7640

View file

@ -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.