Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #35 from cacciaresi/issue-29
Browse files Browse the repository at this point in the history
Fixing issues while interacting with GitLab API v4
  • Loading branch information
aboutofpluto authored Aug 9, 2018
2 parents 46d1f40 + 1798ff0 commit 32f3e2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cmd/gitlab-copy/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ func (m *migration) migrateIssue(issueID int) error {
}

// Copy related notes (comments)
notes, _, err := source.Notes.ListIssueNotes(srcProjectID, issue.ID, nil)
notes, _, err := source.Notes.ListIssueNotes(srcProjectID, issue.IID, nil)
if err != nil {
return fmt.Errorf("source: can't get issue #%d notes: %s", issue.ID, err.Error())
return fmt.Errorf("source: can't get issue #%d notes: %s", issue.IID, err.Error())
}
opts := &gitlab.CreateIssueNoteOptions{}
for j := len(notes) - 1; j >= 0; j-- {
Expand All @@ -201,7 +201,7 @@ func (m *migration) migrateIssue(issueID int) error {
bd := fmt.Sprintf("%s\n\n%s", head, n.Body)
opts.Body = &bd
}
_, resp, err := target.Notes.CreateIssueNote(tarProjectID, ni.ID, opts)
_, resp, err := target.Notes.CreateIssueNote(tarProjectID, ni.IID, opts)
if err != nil {
if resp.StatusCode == http.StatusRequestURITooLong {
fmt.Printf("target: note's body too long, shortening it ...\n")
Expand Down Expand Up @@ -372,7 +372,7 @@ func (m *migration) migrate() error {

for _, issue := range s {
if m.params.From.matches(issue.IID) {
if err := m.migrateIssue(issue.ID); err != nil {
if err := m.migrateIssue(issue.IID); err != nil {
log.Printf(err.Error())
}
if m.params.From.MoveIssues {
Expand Down
2 changes: 1 addition & 1 deletion cmd/gitlab-copy/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (p *projectStats) computeIssueNotes(client *gitlab.Client) error {
}
if len(issues) > 0 {
for _, issue := range issues {
notes, _, err := client.Notes.ListIssueNotes(p.project.ID, issue.ID, nil)
notes, _, err := client.Notes.ListIssueNotes(p.project.ID, issue.IID, nil)
if err != nil {
return false, err
}
Expand Down

0 comments on commit 32f3e2d

Please sign in to comment.