forgejo/services/migrations/testdata/gitlab/skipped_issue_number/_api_v4_projects_6590996_merge_requests_1_award_emoji?page=1&per_page=10
Antonin Delpeuch 28884fac10
[GITEA] Avoid conflicts of issue and PR numbers in GitLab migration (#1790)
Closes #1789.

The bug was due to the fact that GitLab does not guarantee that issue numbers are created sequentially: some identifiers can be skipped. Therefore, the new pull requests numbers should not be offset by the number of issues, but by the maximum issue number.

See for instance https://gitlab.com/troyengel/archbuild/-/issues/?sort=created_date&state=all&first_page_size=20, where there is only a singe issue with number "2".

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1790
Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
Co-committed-by: Antonin Delpeuch <antonin@delpeuch.eu>
(cherry picked from commit 2c185c39fe)
(cherry picked from commit 8f68dc4c9c)
(cherry picked from commit 7e932b7fca)
(cherry picked from commit 6bbe75ecf8)
(cherry picked from commit b18c2e8d65)

Conflicts:
	services/migrations/gitlab.go
	https://codeberg.org/forgejo/forgejo/pulls/2075
(cherry picked from commit abc129c762)
2024-01-08 17:05:47 +01:00

31 lines
1.2 KiB
Plaintext

Link: <https://gitlab.com/api/v4/projects/6590996/merge_requests/1/award_emoji?id=6590996&merge_request_iid=1&page=1&per_page=10>; rel="first", <https://gitlab.com/api/v4/projects/6590996/merge_requests/1/award_emoji?id=6590996&merge_request_iid=1&page=1&per_page=10>; rel="last"
Set-Cookie: _cfuvid=qK29tijoyp0AdVoHf9Lqjc8Y28h4jplJDW9hOFLfq28-1701332635229-0-604800000; path=/; domain=.gitlab.com; HttpOnly; Secure; SameSite=None
Cache-Control: max-age=0, private, must-revalidate
Etag: W/"4f53cda18c2baa0c0354bb5f9a3ecbe5"
Ratelimit-Observed: 8
Gitlab-Sv: localhost
Content-Length: 2
Gitlab-Lb: haproxy-main-16-lb-gprd
X-Total: 0
Ratelimit-Remaining: 1992
Ratelimit-Reset: 1701332695
Ratelimit-Limit: 2000
Vary: Origin, Accept-Encoding
X-Frame-Options: SAMEORIGIN
Content-Type: application/json
X-Content-Type-Options: nosniff
X-Next-Page:
X-Page: 1
Strict-Transport-Security: max-age=31536000
Accept-Ranges: bytes
Content-Security-Policy: default-src 'none'
X-Per-Page: 10
X-Total-Pages: 1
Referrer-Policy: strict-origin-when-cross-origin
Ratelimit-Resettime: Thu, 30 Nov 2023 08:24:55 GMT
Cf-Cache-Status: MISS
X-Gitlab-Meta: {"correlation_id":"eb59d63fed23cdbec69308570cc49c3e","version":"1"}
X-Runtime: 0.065972
X-Prev-Page:
[]