forgejo-aneksajo/services/migrations
forgejo-backport-action 19d920931d [v12.0/forgejo] fix: migration failing when importing either issues or PRs but not the other (#9121)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8892

Related to https://codeberg.org/Codeberg/Community/issues/1944

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
  - A place for fix architecture is still in discussion with @fnetX
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

## What was done

* Allowed the githubdownloaderv3 to know whether issues and, or PRs are requested to migrate
* Used this information to decide to filter for "/pulls/" or "/issues"
  * Or not to filter at all if issues == true && prs == true
* Added isolated test for the downloader and for the uploader
* Created a new test_repo in github.com/forgejo and set it up properly together with @Gusted
* Updated github_downloader_test with the new URLs and test data from the repo
* Recorded the API calls for local testing
* Added a minimal gitbucket test (which uses the github downloader under the hood)

Co-authored-by: patdyn <patdyn@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9121
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-09-02 10:31:10 +02:00
..
testdata [v12.0/forgejo] fix: migration failing when importing either issues or PRs but not the other (#9121) 2025-09-02 10:31:10 +02:00
codebase.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
codebase_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
common.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
dump.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
error.go Update module github.com/google/go-github/v63 to v64 2024-08-24 16:05:36 +00:00
forgejo_downloader.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
forgejo_downloader_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
git.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
gitbucket.go [v12.0/forgejo] fix: migration failing when importing either issues or PRs but not the other (#9121) 2025-09-02 10:31:10 +02:00
gitbucket_test.go [v12.0/forgejo] fix: migration failing when importing either issues or PRs but not the other (#9121) 2025-09-02 10:31:10 +02:00
gitea_downloader.go fix(migrations): transfer PR flow information (#7421) 2025-04-03 06:47:37 +00:00
gitea_downloader_test.go fix(migrations): transfer PR flow information (#7421) 2025-04-03 06:47:37 +00:00
gitea_sdk_hack.go fix(migrations): transfer PR flow information (#7421) 2025-04-03 06:47:37 +00:00
gitea_uploader.go [gitea] week 2025-22 cherry pick (gitea/main -> forgejo) (#8198) 2025-06-17 18:28:07 +02:00
gitea_uploader_test.go [v12.0/forgejo] fix: migration failing when importing either issues or PRs but not the other (#9121) 2025-09-02 10:31:10 +02:00
github.go [v12.0/forgejo] fix: migration failing when importing either issues or PRs but not the other (#9121) 2025-09-02 10:31:10 +02:00
github_test.go [v12.0/forgejo] fix: migration failing when importing either issues or PRs but not the other (#9121) 2025-09-02 10:31:10 +02:00
gitlab.go Update module gitlab.com/gitlab-org/api/client-go to v0.130.1 (forgejo) (#8163) 2025-06-12 11:38:25 +02:00
gitlab_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
gogs.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
gogs_test.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
http_client.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
main_test.go fix(migrations): transfer PR flow information (#7421) 2025-04-03 06:47:37 +00:00
migrate.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
migrate_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
onedev.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
onedev_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
restore.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
update.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00