summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-08-27 16:04:57 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-08-27 16:04:57 -0600
commit1b5f54fc5032fffddb8212a974d718bf54383cd2 (patch)
tree9e2ce82ae9fdea999c41c04d8fb23eaa9abb36d8
parent9343e356a65dc363253408fa222a75bcd81f58e6 (diff)
imworkingon: Fix last-updated-by when the last action is resolving a thread
-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
}
}