summaryrefslogtreecommitdiff
path: root/cmd/generate/forge_gitlab.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/generate/forge_gitlab.go')
-rw-r--r--cmd/generate/forge_gitlab.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/cmd/generate/forge_gitlab.go b/cmd/generate/forge_gitlab.go
index 56f1401..a1ea7c0 100644
--- a/cmd/generate/forge_gitlab.go
+++ b/cmd/generate/forge_gitlab.go
@@ -140,6 +140,12 @@ func (GitLab) FetchLastUpdated(urls []string) (time.Time, User, error) {
Username string `json:"username"`
Path string `json:"path"`
} `json:"author"`
+ ResolvedAt time.Time `json:"resolved_at"`
+ ResolvedBy struct {
+ ResolvedAt time.Time `json:"resolved_at"`
+ Username string `json:"username"`
+ Path string `json:"path"`
+ } `json:"resolved_by"`
} `json:"notes"`
}
if err := httpGetJSON(fmt.Sprintf("https://%s/%s/noteable/merge_request/%d/notes", authority, projectID, obj.ID), map[string]string{"X-Last-Fetched-At": "0"}, &notes); err != nil {
@@ -147,8 +153,13 @@ func (GitLab) FetchLastUpdated(urls []string) (time.Time, User, error) {
}
for _, note := range notes.Notes {
if withinOneSecond(note.UpdatedAt, retUpdatedAt) {
- retUser.Name = note.Author.Username
- retUser.URL = "https://" + authority + note.Author.Path
+ if withinOneSecond(note.UpdatedAt, note.ResolvedAt) {
+ retUser.Name = note.ResolvedBy.Username
+ retUser.URL = "https://" + authority + note.ResolvedBy.Path
+ } else {
+ retUser.Name = note.Author.Username
+ retUser.URL = "https://" + authority + note.Author.Path
+ }
break
}
}