diff options
author | Mohamed Sekour <mohamed.sekour@exfo.com> | 2022-07-30 18:45:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-30 18:45:59 +0200 |
commit | 0e61a74e5a3fc14ff26d1c85065ba336d3f3994b (patch) | |
tree | 63282d44a77c410f33595e000d5fef7a9e700a35 /integrations | |
parent | e819da083734ddbf30afbc62afd48e9d0e8f3d48 (diff) | |
download | gitea-0e61a74e5a3fc14ff26d1c85065ba336d3f3994b.tar.gz gitea-0e61a74e5a3fc14ff26d1c85065ba336d3f3994b.zip |
Add new API endpoints for push mirrors management (#19841)
- Add a new push mirror to specific repository
- Sync now ( send all the changes to the configured push mirrors )
- Get list of all push mirrors of a repository
- Get a push mirror by ID
- Delete push mirror by ID
Signed-off-by: Mohamed Sekour <mohamed.sekour@exfo.com>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'integrations')
-rw-r--r-- | integrations/mirror_push_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/integrations/mirror_push_test.go b/integrations/mirror_push_test.go index a73b69e786..3a22b00754 100644 --- a/integrations/mirror_push_test.go +++ b/integrations/mirror_push_test.go @@ -13,6 +13,7 @@ import ( "testing" "code.gitea.io/gitea/models" + "code.gitea.io/gitea/models/db" repo_model "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/models/unittest" user_model "code.gitea.io/gitea/models/user" @@ -47,7 +48,7 @@ func testMirrorPush(t *testing.T, u *url.URL) { doCreatePushMirror(ctx, fmt.Sprintf("%s%s/%s", u.String(), url.PathEscape(ctx.Username), url.PathEscape(mirrorRepo.Name)), user.LowerName, userPassword)(t) - mirrors, err := repo_model.GetPushMirrorsByRepoID(srcRepo.ID) + mirrors, _, err := repo_model.GetPushMirrorsByRepoID(db.DefaultContext, srcRepo.ID, db.ListOptions{}) assert.NoError(t, err) assert.Len(t, mirrors, 1) @@ -72,7 +73,7 @@ func testMirrorPush(t *testing.T, u *url.URL) { // Cleanup doRemovePushMirror(ctx, fmt.Sprintf("%s%s/%s", u.String(), url.PathEscape(ctx.Username), url.PathEscape(mirrorRepo.Name)), user.LowerName, userPassword, int(mirrors[0].ID))(t) - mirrors, err = repo_model.GetPushMirrorsByRepoID(srcRepo.ID) + mirrors, _, err = repo_model.GetPushMirrorsByRepoID(db.DefaultContext, srcRepo.ID, db.ListOptions{}) assert.NoError(t, err) assert.Len(t, mirrors, 0) } |