1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-09-30 19:22:08 +00:00
forgejo/models/unittest
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
..
consistency.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
fixture_loader.go chore: replace github.com/go-testfixtures/testfixtures (#7715) 2025-04-29 19:28:56 +00:00
fixtures.go chore: replace github.com/go-testfixtures/testfixtures (#7715) 2025-04-29 19:28:56 +00:00
fscopy.go chore: simplify CopyDir 2024-11-10 17:21:57 +01:00
mock_http.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
reflection.go Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
testdb.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
unit_tests.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00