gotsunami / gitlab-copy

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

"error closing issue" with gitlab API v4 #38

Closed alexxcons closed 5 years ago

alexxcons commented 6 years ago

Thank alot for this tool, it saved me a bunch of work !

However for gitlab API v4, it seems to have problems on closing bugs. I just closed them by hand now, which was no big deal for only ~20 bugs. Here the console output:

schwinn@belpc077:~/git/src/github.com/gotsunami/gitlab-copy$ ./bin/gitlab-copy -y gitlab.yml 
source: aschwinn/silecs at https://gitlab.cern.ch/api/v4
target: al.schwinn/silecs at https://gitlab.com/api/v4
--
source: finding issues ... OK
source: 46 issues (26 opened, 20 closed)
source: 3 milestone(s): 2.1.0, 3.0.0, 2.1.2
source: 7 label(s): virtual-controller, mergeWithCERN, silecs-cli-client, silecs-codegen, silecs-communication-cpp, silecs-diagnostic-cpp, silecs-model
source: 237 notes                                                  
--
Copying labels ...
Copying issues ...
2018/09/04 09:45:30 target: error closing issue #1: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882209: 404 {message: 404 Not found}
2018/09/04 09:45:38 target: error closing issue #2: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882210: 404 {message: 404 Not found}
2018/09/04 09:45:44 target: error closing issue #3: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882212: 404 {message: 404 Not found}
target: created issue #4: Build unit-tests to compile ( and link ? ) a DU-wrapper [opened]
target: created issue #5: Provide a way to have lab-specific code-generation [opened]
2018/09/04 09:45:59 target: error closing issue #6: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882218: 404 {message: 404 Not found}
2018/09/04 09:46:05 target: error closing issue #7: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882222: 404 {message: 404 Not found}
2018/09/04 09:46:09 target: error closing issue #8: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882225: 404 {message: 404 Not found}
target: created issue #9: Add support for boolean data-type [opened]
2018/09/04 09:46:15 target: error closing issue #10: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882228: 404 {message: 404 Not found}
target: created issue #11: show in type-selection which FESA-type corresponds to which PLC-type [opened]
target: created issue #12: Use xsd naming for C++ "access types" [opened]
target: created issue #13: Restructure C++ Classes in order to reflect SilecsClasses [opened]
target: created issue #14: replace all tabs by spaces [opened]
target: created issue #15: Usage of c-templates for different register-data types [opened]
target: created issue #16: Support for enums missing [opened]
target: created issue #17: restructure class "SilecsCluster" and rename it to "SilecsDesign" [opened]
target: created issue #18: Allow to give alias-names for fesa-classes and DU's [opened]
target: created issue #19: Provide template-builder which can re-use arguments [opened]
target: created issue #20: Introduce package "virtual controller" [opened]
2018/09/04 09:46:43 target: error closing issue #21: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882327: 404 {message: 404 Not found}
target: created issue #22: Re-Structure C++ Block model [opened]
target: created issue #23: move generated code for fesa-class into "generated" folder [opened]
target: created issue #24: Split library into snap7 / modbus / etc [opened]
target: created issue #25: Investigate: How to make use of BLOCK_MODE in FESA [opened]
2018/09/04 09:46:55 target: error closing issue #26: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882336: 404 {message: 404 Not found}
2018/09/04 09:46:57 target: error closing issue #27: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882337: 404 {message: 404 Not found}
target: created issue #28: Provide lab-specific install-script [opened]
target: created issue #29: Provide a compartibility-mode for old checksums [opened]
target: created issue #30: Create merge requests for differences between CERN silecs-communication-cpp and GSI version [opened]
2018/09/04 09:47:12 target: error closing issue #31: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882342: 404 {message: 404 Not found}
target: created issue #32: Create merge requests for differences between CERN silecs-diagnostic-cpp and GSI version [opened]
2018/09/04 09:47:21 target: error closing issue #33: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882351: 404 {message: 404 Not found}
2018/09/04 09:47:25 target: error closing issue #34: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882354: 404 {message: 404 Not found}
2018/09/04 09:47:28 target: error closing issue #35: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882356: 404 {message: 404 Not found}
2018/09/04 09:47:32 target: error closing issue #36: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882358: 404 {message: 404 Not found}
target: created issue #37: Evaluate possibility to connect memory register with outputs in Siemens scl code [opened]
2018/09/04 09:47:36 target: error closing issue #38: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882362: 404 {message: 404 Not found}
target: created issue #39: Make use of python package 'unittest' [opened]
target: created issue #40: move  string to value method(s) to silecs-communication utils [opened]
2018/09/04 09:47:48 target: error closing issue #41: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882367: 404 {message: 404 Not found}
target: created issue #42: isInitialized_ check in codegen should get it's own method [opened]
2018/09/04 09:47:54 target: error closing issue #43: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882372: 404 {message: 404 Not found}
2018/09/04 09:47:59 target: error closing issue #44: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882374: 404 {message: 404 Not found}
2018/09/04 09:48:04 target: error closing issue #45: PUT https://gitlab.com/api/v4/projects/7953820/issues/13882376: 404 {message: 404 Not found}
target: created issue #46: Prefix Block Makros in generated ClassHeader with Classname [opened]
matm commented 6 years ago

Thanks for reporting and for the logs, we'll investigate ASAP.

boTux commented 5 years ago

migration.go Line 223

-   _, _, err := target.Issues.UpdateIssue(tarProjectID, ni.ID, &gitlab.UpdateIssueOptions{StateEvent: &event, Labels: issue.Labels})
+   _, _, err := target.Issues.UpdateIssue(tarProjectID, ni.IID, &gitlab.UpdateIssueOptions{StateEvent: &event, Labels: issue.Labels})

At cmd/gitlab-copy/migration.go#L223 seem to do the trick !

aboutofpluto commented 5 years ago

Thanks boTux!