diff --git a/CHANGELOG b/CHANGELOG index 7f86c05..1c5c90f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,6 @@ v 0.7 + - Use GitLab API v4. #29 + - Use dep to vendor dependencies. #31 - dist: Windows binary is missing .exe suffix. #28 - Fixed segfault when from project has no milestones. #27 - Update go-gitlab library to v0.5.1. #21 diff --git a/cmd/gitlab-copy/config.go b/cmd/gitlab-copy/config.go index 4a3fe9b..222e35e 100644 --- a/cmd/gitlab-copy/config.go +++ b/cmd/gitlab-copy/config.go @@ -14,7 +14,7 @@ import ( ) const ( - apiPath = "/api/v3" + apiPath = "/api/v4" ) type issueRange struct { diff --git a/cmd/gitlab-copy/migration.go b/cmd/gitlab-copy/migration.go index 42aef16..1ab2214 100644 --- a/cmd/gitlab-copy/migration.go +++ b/cmd/gitlab-copy/migration.go @@ -127,7 +127,7 @@ func (m *migration) migrateIssue(issueID int) error { if err == nil { for _, u := range users { if u.Username == issue.Assignee.Username { - iopts.AssigneeID = &u.ID + iopts.AssigneeIDs = []int{u.ID} break } } @@ -152,7 +152,7 @@ func (m *migration) migrateIssue(issueID int) error { cmopts := &gitlab.CreateMilestoneOptions{ Title: &issue.Milestone.Title, Description: &issue.Milestone.Description, - DueDate: &issue.Milestone.DueDate, + DueDate: issue.Milestone.DueDate, } mi, _, err := target.Milestones.CreateMilestone(tarProjectID, cmopts) if err == nil { @@ -296,7 +296,7 @@ func (m *migration) migrate() error { s := make([]issueId, 0) // Copy all source labels on target - labels, _, err := source.Labels.ListLabels(srcProjectID) + labels, _, err := source.Labels.ListLabels(srcProjectID, nil) if err != nil { return fmt.Errorf("source: can't fetch labels: %s", err.Error()) } @@ -327,7 +327,7 @@ func (m *migration) migrate() error { cmopts := &gitlab.CreateMilestoneOptions{ Title: &mi.Title, Description: &mi.Description, - DueDate: &mi.DueDate, + DueDate: mi.DueDate, } tmi, _, err := target.Milestones.CreateMilestone(tarProjectID, cmopts) if err != nil { diff --git a/cmd/gitlab-copy/stats.go b/cmd/gitlab-copy/stats.go index 07f6b47..924a3e1 100644 --- a/cmd/gitlab-copy/stats.go +++ b/cmd/gitlab-copy/stats.go @@ -67,7 +67,7 @@ func (p *projectStats) computeStats(client *gitlab.Client) error { case "closed": p.nbClosed++ } - if issue.Milestone!=nil && issue.Milestone.Title != "" { + if issue.Milestone != nil && issue.Milestone.Title != "" { p.milestones[issue.Milestone.Title]++ } } @@ -82,7 +82,7 @@ func (p *projectStats) computeStats(client *gitlab.Client) error { return err } - labels, _, err := client.Labels.ListLabels(p.project.ID) + labels, _, err := client.Labels.ListLabels(p.project.ID, nil) if err != nil { return fmt.Errorf("source: can't fetch labels: %s", err.Error()) }