-
Notifications
You must be signed in to change notification settings - Fork 61
Return assignees with issues queries #479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -26,6 +26,11 @@ type Issue struct { | |||||||||||||||||||||||||||||||||
Name string | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
} `graphql:"labels(first: 100)"` | ||||||||||||||||||||||||||||||||||
Assignees struct { | ||||||||||||||||||||||||||||||||||
Nodes []struct { | ||||||||||||||||||||||||||||||||||
models.User | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
} `graphql:"assignees(first: 10)"` | ||||||||||||||||||||||||||||||||||
Author struct { | ||||||||||||||||||||||||||||||||||
models.User `graphql:"... on User"` | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
|
@@ -49,6 +54,7 @@ func (c Issues) Frames() data.Frames { | |||||||||||||||||||||||||||||||||
data.NewField("closed_at", nil, []*time.Time{}), | ||||||||||||||||||||||||||||||||||
data.NewField("updated_at", nil, []time.Time{}), | ||||||||||||||||||||||||||||||||||
data.NewField("labels", nil, []json.RawMessage{}), | ||||||||||||||||||||||||||||||||||
data.NewField("assignees", nil, []json.RawMessage{}), | ||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
for _, v := range c { | ||||||||||||||||||||||||||||||||||
|
@@ -63,8 +69,16 @@ func (c Issues) Frames() data.Frames { | |||||||||||||||||||||||||||||||||
labels[i] = label.Name | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
assignees := make([]string, len(v.Assignees.Nodes)) | ||||||||||||||||||||||||||||||||||
for i, assignee := range v.Assignees.Nodes { | ||||||||||||||||||||||||||||||||||
assignees[i] = assignee.User.Login | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
labelsBytes, _ := json.Marshal(labels) | ||||||||||||||||||||||||||||||||||
rawLabelArray := json.RawMessage(labelsBytes) | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
assigneesBytes, _ := json.Marshal(assignees) | ||||||||||||||||||||||||||||||||||
Comment on lines
77
to
+80
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ignoring the error returned by
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we go with array of strings, then we probably don't need this logic. |
||||||||||||||||||||||||||||||||||
rawAssigneesArray := json.RawMessage(assigneesBytes) | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
frame.AppendRow( | ||||||||||||||||||||||||||||||||||
v.Title, | ||||||||||||||||||||||||||||||||||
|
@@ -77,6 +91,7 @@ func (c Issues) Frames() data.Frames { | |||||||||||||||||||||||||||||||||
closedAt, | ||||||||||||||||||||||||||||||||||
v.UpdatedAt.Time, | ||||||||||||||||||||||||||||||||||
rawLabelArray, | ||||||||||||||||||||||||||||||||||
rawAssigneesArray, | ||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.