diff options
| author | mo khan <mo@mokhan.ca> | 2024-05-18 13:28:49 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2024-05-18 13:28:49 -0600 |
| commit | cbb9da23761f059b8b43704a402c5bb913a100b0 (patch) | |
| tree | 75011098bf8da0ca0f4c527b5cfa9d54cbb54184 /pkg | |
| parent | d2a9990f40d6fe4bd2231a663dae1f2e5ac0e3b8 (diff) | |
feat: parse labels
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/gitlab/issue.go | 1 | ||||
| -rw-r--r-- | pkg/gitlab/issue_test.go | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/pkg/gitlab/issue.go b/pkg/gitlab/issue.go index 8ccaebe..2c7a9be 100644 --- a/pkg/gitlab/issue.go +++ b/pkg/gitlab/issue.go @@ -39,6 +39,7 @@ type Issue struct { UpdatedAt time.Time `json:"updated_at"` ClosedAt time.Time `json:"closed_at"` ClosedBy User `json:"closed_by"` + Labels []string `json:"labels"` } func FromIssues(r io.Reader) ([]Issue, error) { diff --git a/pkg/gitlab/issue_test.go b/pkg/gitlab/issue_test.go index 894c91a..61f2fcd 100644 --- a/pkg/gitlab/issue_test.go +++ b/pkg/gitlab/issue_test.go @@ -58,6 +58,12 @@ func TestIssue(t *testing.T) { assert.Equal(t, "https://gitlab.com/uploads/-/system/user/avatar/1786152/avatar.png", user.AvatarUrl) assert.Equal(t, "https://gitlab.com/gitlab-bot", user.WebUrl) }) + + assert.ElementsMatch(t, []string{ + "Engineering Productivity", + "master-broken::job-timeout", + "master:broken", + }, result.Labels) }) }) } |
