forgejo/modules/migration
Gusted 5e79b39654 fix(migrations): transfer PR flow information (#7421)
- When migrating a pull requests from a Gitea or Forgejo instance, check if the pull request was created via the AGit flow and transfer that bit of information to the migrated pull request.
- Expose this bit of information as the `flow` field for the pull request.
- We have to do a horrible Go hack with Gitea's [go-sdk](gitea.com/gitea/go-sdk) to list all pull requests while being able to decode it to a struct that contains the new `Flow` field. The library does not allow you to do this out of the box, so we have to use `go:linkname` to access the private method that allows us to do this. This in turn means we have to do some boilerplate code that the library otherwise would do for us. The better option would be forking, but that would be a hassle of keeping the library in sync.
- Resolves forgejo/forgejo#5848
- Unit test added.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7421
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-03 06:47:37 +00:00
..
file_format_testdata Validate migration files (#18203) 2022-01-26 10:45:51 +01:00
schemas Validate migration files (#18203) 2022-01-26 10:45:51 +01:00
comment.go Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
downloader.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
error.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
file_format.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
file_format_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
issue.go Fix restore repo bug, clarify the problem of ForeignIndex (#22776) 2023-02-07 09:18:52 +08:00
label.go Scoped labels (#22585) 2023-02-18 21:17:39 +02:00
messenger.go Refactor locale&string&template related code (#29165) 2024-02-16 15:20:52 +01:00
milestone.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
null_downloader.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
options.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
pullrequest.go fix(migrations): transfer PR flow information (#7421) 2025-04-03 06:47:37 +00:00
reaction.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
release.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
repo.go feat: implement migration of website field from gogs/gitea/github (#6474) 2025-01-20 12:18:19 +00:00
retry_downloader.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
review.go Fix restore repo bug, clarify the problem of ForeignIndex (#22776) 2023-02-07 09:18:52 +08:00
schemas_bindata.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
schemas_dynamic.go [CHORE] Update jsonschema library to v6 2024-07-15 17:20:50 +02:00
schemas_static.go [CHORE] Update jsonschema library to v6 2024-07-15 17:20:50 +02:00
uploader.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00