gotsunami / gitlab-copy

Batch copy issues between GitLab instances, with some cool features
MIT License
128 stars 20 forks source link

Uses API v3 which is now deprecated #29

Closed ghost closed 5 years ago

ghost commented 6 years ago

Shouldn't it be using V4?

matm commented 6 years ago

Probably, yes. Pull request is welcome on this one, thanks! /cc @aboutofpluto

ghost commented 6 years ago

I'm not a go developer - so wouldn't even really know where to start :) I can point out the https://docs.gitlab.com/ee/api/v3_to_v4.html page - and can assist with testing for sure. Also note that v3 will be removed shortly (v11)

On Wed, 30 May 2018 at 21:37 Mathias Monnerville notifications@github.com wrote:

Probably, yes. Pull request is welcome on this one, thanks! /cc @aboutofpluto https://github.com/aboutofpluto

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gotsunami/gitlab-copy/issues/29#issuecomment-393290348, or mute the thread https://github.com/notifications/unsubscribe-auth/ABhCd2t3Ktse3KAD69sQ0O9BXAVDxipnks5t3vUCgaJpZM4UT3m9 .

matm commented 6 years ago

Okay, I'll start investigating. Thanks for reporting it @erzz. We might ask your help for a bit of testing :)

matm commented 6 years ago

@erzz We just published a new 0.7 RC1 version for testing.

Please grab a binary and test gitlab-copy a bit! Now using GitLab API v4.

Please report any related bug here, thanks!

wilmer281 commented 6 years ago

hi, While using same yaml configuration I am now getting message 404 Not found. The same configuration worked before on v3.

GET https://gitlab.com/api/v4/projects/15853109/issues/14068961/notes: 404 {message: 404 Not found}

cacciaresi commented 6 years ago

Hi, same issue here, it seems that the issue is related with how issues are being referenced in the new version of the GitLab API.

I've changed locally the source code from issue.ID => issue.IID, to reference the internal Id and its working as expected.

cacciaresi commented 6 years ago

To be more specific, I've changed the usage of these functions: ListIssueNotes, migrateIssue and CreateIssueNote.

Note that the documentation now reflects that IID should be used: https://docs.gitlab.com/ce/api/notes.html#list-project-issue-notes

aboutofpluto commented 6 years ago

HI Claudio,

Thank you for the information and references. Could you send us a pull request if you have already changed the source code? We will fix this as soon as possible.

charleech commented 6 years ago

Hi,

Regarding to the https://docs.gitlab.com/ce/api/#pagination

Parameter Description
page Page number (default: 1)
per_page Number of items to list per page (default: 20, max: 100)

I've around 25+ labels, the gitlab-copy is only copying 20 labels.

Could you please help to determine about the paging during copying?

wilmer281 commented 6 years ago

Hi again,

New version looking good until start copying issues. Error is:

source: 222 notes

Copying labels ... Copying issues ...

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x72a405]

goroutine 1 [running]: main.(migration).migrateIssue(0xc420011380, 0x1, 0x867a01, 0xc420394960) /home/ab/work/go/src/github.com/gotsunami/gitlab-copy/cmd/gitlab-copy/migration.go:138 +0x3c5 main.(migration).migrate(0xc420011380, 0x1, 0x1) /home/ab/work/go/src/github.com/gotsunami/gitlab-copy/cmd/gitlab-copy/migration.go:375 +0xf22 main.main() /home/ab/work/go/src/github.com/gotsunami/gitlab-copy/cmd/gitlab-copy/main.go:156 +0x933

Thanks!

aboutofpluto commented 6 years ago

Hi wilmer, thanks for reporting. See issue #36 for updates.

matm commented 5 years ago

API v4 is used and #36 is fixed. Closing.