mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-12 21:59:29 +01:00
Merge pull request 'test: enable gitea migration tests' (#5817) from viceice/test/migrations/gitea into forgejo
Some checks are pending
/ release (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (map[image:docker.io/bitnami/redis:7.2 port:6379]) (push) Blocked by required conditions
testing / test-remote-cacher (map[image:docker.io/bitnami/valkey:7.2 port:6379]) (push) Blocked by required conditions
testing / test-remote-cacher (map[image:ghcr.io/microsoft/garnet-alpine:1.0.14 port:6379]) (push) Blocked by required conditions
testing / test-remote-cacher (map[image:registry.redict.io/redict:7.3.0-scratch port:6379]) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
Some checks are pending
/ release (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (map[image:docker.io/bitnami/redis:7.2 port:6379]) (push) Blocked by required conditions
testing / test-remote-cacher (map[image:docker.io/bitnami/valkey:7.2 port:6379]) (push) Blocked by required conditions
testing / test-remote-cacher (map[image:ghcr.io/microsoft/garnet-alpine:1.0.14 port:6379]) (push) Blocked by required conditions
testing / test-remote-cacher (map[image:registry.redict.io/redict:7.3.0-scratch port:6379]) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5817 Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
commit
c8ba330833
32 changed files with 305 additions and 21 deletions
|
@ -5,12 +5,12 @@ package migrations
|
|||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"os"
|
||||
"sort"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/models/unittest"
|
||||
base "code.gitea.io/gitea/modules/migration"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
@ -18,18 +18,13 @@ import (
|
|||
)
|
||||
|
||||
func TestGiteaDownloadRepo(t *testing.T) {
|
||||
// Skip tests if Gitea token is not found
|
||||
giteaToken := os.Getenv("GITEA_TOKEN")
|
||||
if giteaToken == "" {
|
||||
t.Skip("skipped test because GITEA_TOKEN was not in the environment")
|
||||
}
|
||||
|
||||
resp, err := http.Get("https://gitea.com/gitea")
|
||||
if err != nil || resp.StatusCode != http.StatusOK {
|
||||
t.Skipf("Can't reach https://gitea.com, skipping %s", t.Name())
|
||||
}
|
||||
fixturePath := "./testdata/gitea/full_download"
|
||||
server := unittest.NewMockWebServer(t, "https://gitea.com", fixturePath, giteaToken != "")
|
||||
defer server.Close()
|
||||
|
||||
downloader, err := NewGiteaDownloader(context.Background(), "https://gitea.com", "gitea/test_repo", "", "", giteaToken)
|
||||
downloader, err := NewGiteaDownloader(context.Background(), server.URL, "gitea/test_repo", "", "", giteaToken)
|
||||
if downloader == nil {
|
||||
t.Fatal("NewGitlabDownloader is nil")
|
||||
}
|
||||
|
@ -42,8 +37,8 @@ func TestGiteaDownloadRepo(t *testing.T) {
|
|||
Owner: "gitea",
|
||||
IsPrivate: false,
|
||||
Description: "Test repository for testing migration from gitea to gitea",
|
||||
CloneURL: "https://gitea.com/gitea/test_repo.git",
|
||||
OriginalURL: "https://gitea.com/gitea/test_repo",
|
||||
CloneURL: server.URL + "/gitea/test_repo.git",
|
||||
OriginalURL: server.URL + "/gitea/test_repo",
|
||||
DefaultBranch: "master",
|
||||
}, repo)
|
||||
|
||||
|
@ -89,7 +84,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
|
|||
Title: "V2 Finalize",
|
||||
Created: time.Unix(0, 0),
|
||||
Deadline: timePtr(time.Unix(1599263999, 0)),
|
||||
Updated: timePtr(time.Unix(0, 0)),
|
||||
Updated: timePtr(time.Date(2022, 11, 13, 5, 29, 15, 0, time.UTC)),
|
||||
State: "open",
|
||||
},
|
||||
{
|
||||
|
@ -116,7 +111,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
|
|||
Published: time.Date(2020, 9, 1, 18, 2, 43, 0, time.UTC),
|
||||
PublisherID: 689,
|
||||
PublisherName: "6543",
|
||||
PublisherEmail: "6543@obermui.de",
|
||||
PublisherEmail: "6543@noreply.gitea.com",
|
||||
},
|
||||
{
|
||||
Name: "First Release",
|
||||
|
@ -129,7 +124,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
|
|||
Published: time.Date(2020, 9, 1, 17, 30, 32, 0, time.UTC),
|
||||
PublisherID: 689,
|
||||
PublisherName: "6543",
|
||||
PublisherEmail: "6543@obermui.de",
|
||||
PublisherEmail: "6543@noreply.gitea.com",
|
||||
},
|
||||
}, releases)
|
||||
|
||||
|
@ -203,7 +198,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
|
|||
IssueIndex: 4,
|
||||
PosterID: 689,
|
||||
PosterName: "6543",
|
||||
PosterEmail: "6543@obermui.de",
|
||||
PosterEmail: "6543@noreply.gitea.com",
|
||||
Created: time.Unix(1598975370, 0),
|
||||
Updated: time.Unix(1599070865, 0),
|
||||
Content: "a really good question!\n\nIt is the used as TESTSET for gitea2gitea repo migration function",
|
||||
|
@ -212,7 +207,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
|
|||
IssueIndex: 4,
|
||||
PosterID: -1,
|
||||
PosterName: "Ghost",
|
||||
PosterEmail: "",
|
||||
PosterEmail: "ghost@noreply.gitea.com",
|
||||
Created: time.Unix(1598975393, 0),
|
||||
Updated: time.Unix(1598975393, 0),
|
||||
Content: "Oh!",
|
||||
|
@ -239,7 +234,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
|
|||
IsLocked: false,
|
||||
Created: time.Unix(1598982759, 0),
|
||||
Updated: time.Unix(1599023425, 0),
|
||||
Closed: timePtr(time.Unix(1598982934, 0)),
|
||||
Closed: timePtr(time.Date(2020, 9, 1, 17, 55, 33, 0, time.UTC)),
|
||||
Assignees: []string{"techknowlogick"},
|
||||
Base: base.PullRequestBranch{
|
||||
CloneURL: "",
|
||||
|
@ -249,7 +244,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
|
|||
OwnerName: "gitea",
|
||||
},
|
||||
Head: base.PullRequestBranch{
|
||||
CloneURL: "https://gitea.com/6543-forks/test_repo.git",
|
||||
CloneURL: server.URL + "/6543-forks/test_repo.git",
|
||||
Ref: "refs/pull/12/head",
|
||||
SHA: "b6ab5d9ae000b579a5fff03f92c486da4ddf48b6",
|
||||
RepoName: "test_repo",
|
||||
|
@ -258,7 +253,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
|
|||
Merged: true,
|
||||
MergedTime: timePtr(time.Unix(1598982934, 0)),
|
||||
MergeCommitSHA: "827aa28a907853e5ddfa40c8f9bc52471a2685fd",
|
||||
PatchURL: "https://gitea.com/gitea/test_repo/pulls/12.patch",
|
||||
PatchURL: server.URL + "/gitea/test_repo/pulls/12.patch",
|
||||
}, prs[1])
|
||||
|
||||
reviews, err := downloader.GetReviews(&base.Issue{Number: 7, ForeignIndex: 7})
|
||||
|
@ -285,7 +280,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
|
|||
PosterID: 689,
|
||||
Reactions: nil,
|
||||
CreatedAt: time.Date(2020, 9, 1, 16, 12, 58, 0, time.UTC),
|
||||
UpdatedAt: time.Date(2020, 9, 1, 16, 12, 58, 0, time.UTC),
|
||||
UpdatedAt: time.Date(2024, 6, 3, 1, 18, 36, 0, time.UTC),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
7
services/migrations/testdata/gitea/full_download/GET_%2Fapi%2Fv1%2Frepos%2Fgitea%2Ftest_repo
vendored
Normal file
7
services/migrations/testdata/gitea/full_download/GET_%2Fapi%2Fv1%2Frepos%2Fgitea%2Ftest_repo
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
X-Frame-Options: SAMEORIGIN
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Vary: Origin
|
||||
X-Content-Type-Options: nosniff
|
||||
|
||||
{"id":16268,"owner":{"id":3,"login":"gitea","login_name":"","source_id":0,"full_name":"","email":"","avatar_url":"https://gitea.com/avatars/35dea380390772b3130aafbac7ca49e6","html_url":"https://gitea.com/gitea","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2018-11-29T03:16:17Z","restricted":false,"active":false,"prohibit_login":false,"location":"Git Universe","website":"https://about.gitea.com","description":"Git with a cup of tea","visibility":"public","followers_count":53,"following_count":0,"starred_repos_count":0,"username":"gitea"},"name":"test_repo","full_name":"gitea/test_repo","description":"Test repository for testing migration from gitea to gitea","empty":false,"private":false,"fork":false,"template":false,"parent":null,"mirror":false,"size":68,"language":"","languages_url":"https://gitea.com/api/v1/repos/gitea/test_repo/languages","html_url":"https://gitea.com/gitea/test_repo","url":"https://gitea.com/api/v1/repos/gitea/test_repo","link":"","ssh_url":"git@gitea.com:gitea/test_repo.git","clone_url":"https://gitea.com/gitea/test_repo.git","original_url":"","website":"","stars_count":1,"forks_count":2,"watchers_count":9,"open_issues_count":2,"open_pr_counter":2,"release_counter":2,"default_branch":"master","archived":false,"created_at":"2020-09-01T00:12:27Z","updated_at":"2020-09-01T18:03:41Z","archived_at":"1970-01-01T00:00:00Z","permissions":{"admin":false,"push":false,"pull":true},"has_issues":true,"internal_tracker":{"enable_time_tracker":true,"allow_only_contributors_to_track_time":true,"enable_issue_dependencies":true},"has_wiki":true,"has_pull_requests":true,"has_projects":true,"projects_mode":"","has_releases":true,"has_packages":false,"has_actions":false,"ignore_whitespace_conflicts":false,"allow_merge_commits":true,"allow_rebase":true,"allow_rebase_explicit":true,"allow_squash_merge":true,"allow_fast_forward_only_merge":false,"allow_rebase_update":true,"default_delete_branch_after_merge":false,"default_merge_style":"merge","default_allow_maintainer_edit":false,"avatar_url":"","internal":false,"mirror_interval":"","object_format_name":"sha1","mirror_updated":"0001-01-01T00:00:00Z","repo_transfer":null,"topics":["gitea","test","migration","ci"],"licenses":null}
|
|
@ -0,0 +1,10 @@
|
|||
Access-Control-Expose-Headers: X-Total-Count
|
||||
X-Total-Count: 2
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Vary: Origin
|
||||
X-Content-Type-Options: nosniff
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 1293
|
||||
|
||||
[{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"gitea","created_at":"2020-09-01T00:15:14Z"},{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"confused","created_at":"2020-09-01T00:15:19Z"}]
|
|
@ -0,0 +1,10 @@
|
|||
Content-Length: 5
|
||||
Vary: Origin
|
||||
X-Content-Type-Options: nosniff
|
||||
X-Total-Count: 0
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Access-Control-Expose-Headers: X-Total-Count
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
|
||||
null
|
|
@ -0,0 +1,10 @@
|
|||
Access-Control-Expose-Headers: X-Total-Count
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
X-Total-Count: 0
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 5
|
||||
Vary: Origin
|
||||
X-Content-Type-Options: nosniff
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
|
||||
null
|
|
@ -0,0 +1,10 @@
|
|||
X-Frame-Options: SAMEORIGIN
|
||||
Access-Control-Expose-Headers: X-Total-Count
|
||||
X-Content-Type-Options: nosniff
|
||||
Vary: Origin
|
||||
X-Total-Count: 0
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 5
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
|
||||
null
|
|
@ -0,0 +1,10 @@
|
|||
Content-Length: 5
|
||||
Access-Control-Expose-Headers: X-Total-Count
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Vary: Origin
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
Content-Type: application/json;charset=utf-8
|
||||
X-Content-Type-Options: nosniff
|
||||
X-Total-Count: 0
|
||||
|
||||
null
|
|
@ -0,0 +1,10 @@
|
|||
Access-Control-Expose-Headers: X-Total-Count
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
X-Total-Count: 0
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 5
|
||||
Vary: Origin
|
||||
X-Content-Type-Options: nosniff
|
||||
|
||||
null
|
|
@ -0,0 +1,10 @@
|
|||
X-Content-Type-Options: nosniff
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 5
|
||||
Access-Control-Expose-Headers: X-Total-Count
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Vary: Origin
|
||||
X-Total-Count: 0
|
||||
|
||||
null
|
|
@ -0,0 +1,10 @@
|
|||
X-Frame-Options: SAMEORIGIN
|
||||
X-Total-Count: 2
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Access-Control-Expose-Headers: X-Total-Count
|
||||
X-Content-Type-Options: nosniff
|
||||
Content-Length: 1824
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Vary: Origin
|
||||
|
||||
[{"id":116550,"html_url":"https://gitea.com/gitea/test_repo/issues/4#issuecomment-116550","pull_request_url":"","issue_url":"https://gitea.com/gitea/test_repo/issues/4","user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@noreply.gitea.com","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"original_author":"","original_author_id":0,"body":"a really good question!\n\nIt is the used as TESTSET for gitea2gitea repo migration function","assets":[],"created_at":"2020-09-01T15:49:30Z","updated_at":"2020-09-02T18:21:05Z"},{"id":116552,"html_url":"https://gitea.com/gitea/test_repo/issues/4#issuecomment-116552","pull_request_url":"","issue_url":"https://gitea.com/gitea/test_repo/issues/4","user":{"id":-1,"login":"Ghost","login_name":"","source_id":0,"full_name":"","email":"ghost@noreply.gitea.com","avatar_url":"https://gitea.com/assets/img/avatar_default.png","html_url":"https://gitea.com/Ghost","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"1970-01-01T00:00:00Z","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"Ghost"},"original_author":"","original_author_id":0,"body":"Oh!","assets":[],"created_at":"2020-09-01T15:49:53Z","updated_at":"2020-09-01T15:49:53Z"}]
|
|
@ -0,0 +1,10 @@
|
|||
X-Frame-Options: SAMEORIGIN
|
||||
X-Total-Count: 2
|
||||
Access-Control-Expose-Headers: X-Total-Count
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Vary: Origin
|
||||
X-Content-Type-Options: nosniff
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 1290
|
||||
|
||||
[{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"gitea","created_at":"2020-09-01T19:36:40Z"},{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"laugh","created_at":"2020-09-01T19:36:45Z"}]
|
|
@ -0,0 +1,10 @@
|
|||
X-Content-Type-Options: nosniff
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
Content-Length: 1288
|
||||
Access-Control-Expose-Headers: X-Total-Count
|
||||
Vary: Origin
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
X-Total-Count: 2
|
||||
|
||||
[{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"+1","created_at":"2020-09-01T16:07:06Z"},{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"hooray","created_at":"2020-09-01T16:07:11Z"}]
|
|
@ -0,0 +1,10 @@
|
|||
Access-Control-Expose-Headers: X-Total-Count
|
||||
X-Content-Type-Options: nosniff
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 5
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Vary: Origin
|
||||
X-Total-Count: 0
|
||||
|
||||
null
|
|
@ -0,0 +1,10 @@
|
|||
Content-Type: application/json;charset=utf-8
|
||||
Access-Control-Expose-Headers: X-Total-Count
|
||||
X-Content-Type-Options: nosniff
|
||||
X-Total-Count: 0
|
||||
Content-Length: 5
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Vary: Origin
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
|
||||
null
|
|
@ -0,0 +1,10 @@
|
|||
Vary: Origin
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
X-Total-Count: 0
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 5
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Access-Control-Expose-Headers: X-Total-Count
|
||||
X-Content-Type-Options: nosniff
|
||||
|
||||
null
|
|
@ -0,0 +1,10 @@
|
|||
X-Total-Count: 0
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 5
|
||||
Access-Control-Expose-Headers: X-Total-Count
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Vary: Origin
|
||||
X-Content-Type-Options: nosniff
|
||||
|
||||
null
|
|
@ -0,0 +1,8 @@
|
|||
Vary: Origin
|
||||
X-Content-Type-Options: nosniff
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 5
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
|
||||
null
|
|
@ -0,0 +1,8 @@
|
|||
X-Content-Type-Options: nosniff
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 5
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Vary: Origin
|
||||
|
||||
null
|
|
@ -0,0 +1,10 @@
|
|||
Link: <https://gitea.com/api/v1/repos/gitea/test_repo/issues?limit=2&page=4&state=all&type=issues>; rel="next",<https://gitea.com/api/v1/repos/gitea/test_repo/issues?limit=2&page=4&state=all&type=issues>; rel="last",<https://gitea.com/api/v1/repos/gitea/test_repo/issues?limit=2&page=1&state=all&type=issues>; rel="first",<https://gitea.com/api/v1/repos/gitea/test_repo/issues?limit=2&page=2&state=all&type=issues>; rel="prev"
|
||||
Access-Control-Expose-Headers: Link, X-Total-Count
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
X-Content-Type-Options: nosniff
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
X-Total-Count: 7
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Vary: Origin
|
||||
|
||||
[{"id":30475,"url":"https://gitea.com/api/v1/repos/gitea/test_repo/issues/4","html_url":"https://gitea.com/gitea/test_repo/issues/4","number":4,"user":{"id":-1,"login":"Ghost","login_name":"","source_id":0,"full_name":"","email":"","avatar_url":"https://gitea.com/assets/img/avatar_default.png","html_url":"https://gitea.com/Ghost","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"1970-01-01T00:00:00Z","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"Ghost"},"original_author":"","original_author_id":0,"title":"what is this repo about?","body":"","ref":"","assets":[],"labels":[{"id":3733,"name":"Question","exclusive":false,"is_archived":false,"color":"fbca04","description":"","url":"https://gitea.com/api/v1/repos/gitea/test_repo/labels/3733"}],"milestone":{"id":1300,"title":"V1","description":"Generate Content","state":"closed","open_issues":0,"closed_issues":4,"created_at":"1970-01-01T00:00:00Z","updated_at":"1970-01-01T00:00:00Z","closed_at":"2020-09-01T18:36:46Z","due_on":null},"assignee":null,"assignees":null,"state":"closed","is_locked":true,"comments":2,"created_at":"2020-09-01T15:48:41Z","updated_at":"2020-09-01T15:50:00Z","closed_at":"2020-09-01T15:49:34Z","due_date":null,"pull_request":null,"repository":{"id":16268,"name":"test_repo","owner":"gitea","full_name":"gitea/test_repo"},"pin_order":0},{"id":30471,"url":"https://gitea.com/api/v1/repos/gitea/test_repo/issues/2","html_url":"https://gitea.com/gitea/test_repo/issues/2","number":2,"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"original_author":"","original_author_id":0,"title":"Spam","body":":(","ref":"","assets":[],"labels":[{"id":3732,"name":"Invalid","exclusive":false,"is_archived":false,"color":"d4c5f9","description":"","url":"https://gitea.com/api/v1/repos/gitea/test_repo/labels/3732"}],"milestone":null,"assignee":null,"assignees":null,"state":"closed","is_locked":false,"comments":2,"created_at":"2020-09-01T00:23:00Z","updated_at":"2020-09-01T14:11:37Z","closed_at":"2020-09-01T14:11:37Z","due_date":null,"pull_request":null,"repository":{"id":16268,"name":"test_repo","owner":"gitea","full_name":"gitea/test_repo"},"pin_order":0}]
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,10 @@
|
|||
Content-Type: application/json;charset=utf-8
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Vary: Origin
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
X-Total-Count: 6
|
||||
Content-Length: 1026
|
||||
Access-Control-Expose-Headers: X-Total-Count
|
||||
X-Content-Type-Options: nosniff
|
||||
|
||||
[{"id":3730,"name":"Bug","exclusive":false,"is_archived":false,"color":"e11d21","description":"","url":"https://gitea.com/api/v1/repos/gitea/test_repo/labels/3730"},{"id":3735,"name":"Enhancement","exclusive":false,"is_archived":false,"color":"207de5","description":"","url":"https://gitea.com/api/v1/repos/gitea/test_repo/labels/3735"},{"id":3731,"name":"Feature","exclusive":false,"is_archived":false,"color":"0052cc","description":"a feature request","url":"https://gitea.com/api/v1/repos/gitea/test_repo/labels/3731"},{"id":3732,"name":"Invalid","exclusive":false,"is_archived":false,"color":"d4c5f9","description":"","url":"https://gitea.com/api/v1/repos/gitea/test_repo/labels/3732"},{"id":3733,"name":"Question","exclusive":false,"is_archived":false,"color":"fbca04","description":"","url":"https://gitea.com/api/v1/repos/gitea/test_repo/labels/3733"},{"id":3734,"name":"Valid","exclusive":false,"is_archived":false,"color":"53e917","description":"","url":"https://gitea.com/api/v1/repos/gitea/test_repo/labels/3734"}]
|
|
@ -0,0 +1,10 @@
|
|||
Access-Control-Expose-Headers: X-Total-Count
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
X-Total-Count: 2
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 453
|
||||
Vary: Origin
|
||||
X-Content-Type-Options: nosniff
|
||||
|
||||
[{"id":1301,"title":"V2 Finalize","description":"","state":"open","open_issues":1,"closed_issues":2,"created_at":"1970-01-01T00:00:00Z","updated_at":"2022-11-13T05:29:15Z","closed_at":null,"due_on":"2020-09-04T23:59:59Z"},{"id":1300,"title":"V1","description":"Generate Content","state":"closed","open_issues":0,"closed_issues":4,"created_at":"1970-01-01T00:00:00Z","updated_at":"1970-01-01T00:00:00Z","closed_at":"2020-09-01T18:36:46Z","due_on":null}]
|
|
@ -0,0 +1,8 @@
|
|||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 1211
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Vary: Origin
|
||||
X-Content-Type-Options: nosniff
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
|
||||
[{"id":116561,"body":"is one `\\newline` to less?","user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"resolver":null,"pull_request_review_id":1770,"created_at":"2020-09-01T16:12:58Z","updated_at":"2024-06-03T01:18:36Z","path":"README.md","commit_id":"187ece0cb6631e2858a6872e5733433bb3ca3b03","original_commit_id":"","diff_hunk":"@@ -2,3 +2,3 @@\n \n-Test repository for testing migration from gitea 2 gitea\n\\ No newline at end of file\n+Test repository for testing migration from gitea 2 gitea","position":4,"original_position":0,"html_url":"https://gitea.com/gitea/test_repo/pulls/7#issuecomment-116561","pull_request_url":"https://gitea.com/gitea/test_repo/pulls/7"}]
|
|
@ -0,0 +1,8 @@
|
|||
Vary: Origin
|
||||
X-Content-Type-Options: nosniff
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 3
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
|
||||
[]
|
|
@ -0,0 +1,8 @@
|
|||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 3
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Vary: Origin
|
||||
X-Content-Type-Options: nosniff
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
|
||||
[]
|
|
@ -0,0 +1,9 @@
|
|||
Access-Control-Expose-Headers: X-Total-Count
|
||||
X-Content-Type-Options: nosniff
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Vary: Origin
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
X-Total-Count: 3
|
||||
|
||||
[{"id":1770,"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"team":null,"state":"COMMENT","body":"","commit_id":"187ece0cb6631e2858a6872e5733433bb3ca3b03","stale":false,"official":false,"dismissed":true,"comments_count":1,"submitted_at":"2020-09-01T16:12:58Z","updated_at":"2021-04-18T22:00:49Z","html_url":"https://gitea.com/gitea/test_repo/pulls/7#issuecomment-116562","pull_request_url":"https://gitea.com/gitea/test_repo/pulls/7"},{"id":1771,"user":{"id":9,"login":"techknowlogick","login_name":"","source_id":0,"full_name":"","email":"techknowlogick@noreply.gitea.com","avatar_url":"https://gitea.com/avatars/9b588dd0b384d6f6ae841c5d62302033","html_url":"https://gitea.com/techknowlogick","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-01-14T06:48:35Z","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"https://techknowlogick.com","description":"","visibility":"public","followers_count":11,"following_count":1,"starred_repos_count":4,"username":"techknowlogick"},"team":null,"state":"REQUEST_CHANGES","body":"I think this needs some changes","commit_id":"187ece0cb6631e2858a6872e5733433bb3ca3b03","stale":false,"official":false,"dismissed":true,"comments_count":0,"submitted_at":"2020-09-01T17:06:47Z","updated_at":"2021-04-18T22:00:49Z","html_url":"https://gitea.com/gitea/test_repo/pulls/7#issuecomment-116563","pull_request_url":"https://gitea.com/gitea/test_repo/pulls/7"},{"id":1772,"user":{"id":9,"login":"techknowlogick","login_name":"","source_id":0,"full_name":"","email":"techknowlogick@noreply.gitea.com","avatar_url":"https://gitea.com/avatars/9b588dd0b384d6f6ae841c5d62302033","html_url":"https://gitea.com/techknowlogick","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-01-14T06:48:35Z","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"https://techknowlogick.com","description":"","visibility":"public","followers_count":11,"following_count":1,"starred_repos_count":4,"username":"techknowlogick"},"team":null,"state":"APPROVED","body":"looks good","commit_id":"187ece0cb6631e2858a6872e5733433bb3ca3b03","stale":false,"official":true,"dismissed":true,"comments_count":0,"submitted_at":"2020-09-01T17:19:51Z","updated_at":"2021-04-18T22:00:49Z","html_url":"https://gitea.com/gitea/test_repo/pulls/7#issuecomment-116564","pull_request_url":"https://gitea.com/gitea/test_repo/pulls/7"}]
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,9 @@
|
|||
Content-Type: application/json;charset=utf-8
|
||||
Vary: Origin
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
Access-Control-Expose-Headers: X-Total-Count
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
X-Content-Type-Options: nosniff
|
||||
X-Total-Count: 2
|
||||
|
||||
[{"id":167250,"tag_name":"v2-rc1","target_commitish":"master","name":"Second Release","body":"this repo has:\r\n* reactions\r\n* wiki\r\n* issues (open/closed)\r\n* pulls (open/closed/merged) (external/internal)\r\n* pull reviews\r\n* projects\r\n* milestones\r\n* labels\r\n* releases\r\n\r\nto test migration against","url":"https://gitea.com/api/v1/repos/gitea/test_repo/releases/167250","html_url":"https://gitea.com/gitea/test_repo/releases/tag/v2-rc1","tarball_url":"https://gitea.com/gitea/test_repo/archive/v2-rc1.tar.gz","zipball_url":"https://gitea.com/gitea/test_repo/archive/v2-rc1.zip","upload_url":"https://gitea.com/api/v1/repos/gitea/test_repo/releases/167250/assets","draft":false,"prerelease":true,"created_at":"2020-09-01T18:02:43Z","published_at":"2020-09-01T18:02:43Z","author":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@noreply.gitea.com","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"assets":[]},{"id":167249,"tag_name":"V1","target_commitish":"master","name":"First Release","body":"as title","url":"https://gitea.com/api/v1/repos/gitea/test_repo/releases/167249","html_url":"https://gitea.com/gitea/test_repo/releases/tag/V1","tarball_url":"https://gitea.com/gitea/test_repo/archive/V1.tar.gz","zipball_url":"https://gitea.com/gitea/test_repo/archive/V1.zip","upload_url":"https://gitea.com/api/v1/repos/gitea/test_repo/releases/167249/assets","draft":false,"prerelease":false,"created_at":"2020-09-01T17:30:32Z","published_at":"2020-09-01T17:30:32Z","author":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@noreply.gitea.com","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"assets":[]}]
|
|
@ -0,0 +1,10 @@
|
|||
Vary: Origin
|
||||
X-Content-Type-Options: nosniff
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
X-Total-Count: 4
|
||||
Content-Length: 45
|
||||
Access-Control-Expose-Headers: X-Total-Count
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Content-Type: application/json;charset=utf-8
|
||||
|
||||
{"topics":["ci","gitea","migration","test"]}
|
8
services/migrations/testdata/gitea/full_download/GET_%2Fapi%2Fv1%2Fsettings%2Fapi
vendored
Normal file
8
services/migrations/testdata/gitea/full_download/GET_%2Fapi%2Fv1%2Fsettings%2Fapi
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 117
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Vary: Origin
|
||||
X-Content-Type-Options: nosniff
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
|
||||
{"max_response_items":50,"default_paging_num":30,"default_git_trees_per_page":1000,"default_max_blob_size":10485760}
|
8
services/migrations/testdata/gitea/full_download/GET_%2Fapi%2Fv1%2Fversion
vendored
Normal file
8
services/migrations/testdata/gitea/full_download/GET_%2Fapi%2Fv1%2Fversion
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
Content-Length: 41
|
||||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Vary: Origin
|
||||
X-Content-Type-Options: nosniff
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
Content-Type: application/json;charset=utf-8
|
||||
|
||||
{"version":"1.23.0+dev-608-gec2d1593c2"}
|
Loading…
Reference in a new issue