-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use Waiting for: Product Owner
label to send triage notifications
#492
Use Waiting for: Product Owner
label to send triage notifications
#492
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #492 +/- ##
==========================================
+ Coverage 83.07% 83.37% +0.29%
==========================================
Files 96 96
Lines 2523 2520 -3
Branches 493 490 -3
==========================================
+ Hits 2096 2101 +5
+ Misses 421 412 -9
- Partials 6 7 +1
☔ View full report in Codecov by Sentry. |
…d timestamp isn't there
e214f71
to
b865b19
Compare
d8690e3
to
16e8174
Compare
src/utils/githubEventHelpers.ts
Outdated
node(id: "${issueNodeId}") { | ||
... on ProjectV2Item { | ||
id | ||
fieldValueByName(name: "Respond By") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have to query by name? If we query by id then it would be immutable, maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I like having the flexibility to tinker with the names of the project board and fields without messing up the automation, if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what using fieldValues
looks like
const query = `query{
node(id: "${issueNodeId}") {
... on ProjectV2Item {
id
fieldValues(first: 50) {
nodes {
... on ProjectV2ItemFieldTextValue {
id
text
field {
... on ProjectV2Field {
id
name
}
}
}
}
}
}
}
}`;
const data = {
issueNodeId,
};
const response = await sendQuery(query, data, octokit);
// When the response due date is empty, the node doesn't exist so we default to empty string
const issueDueDateInfoNode = response?.node.fieldValues.nodes.find(item => item.field?.id === RESPONSE_DUE_DATE_FIELD_ID) || "";
return issueDueDateInfoNode.text;
Honestly, I really don't like relying on this line here...
const issueDueDateInfoNode = response?.node.fieldValues.nodes.find(item => item.field?.id === RESPONSE_DUE_DATE_FIELD_ID) || "";```
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not all items on the project board have the same fields
Say more about this? Surprises me if true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Say more about this? Surprises me if true.
Er, I meant to say number of fieldValues
. Say there are 6 fields for an item on a project board. If the due date field is an empty string, GH graphql api returns 5 nodes in the fieldValues
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, gotcha. Yeah, that's weird. :-/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented the changes above. @chadwhitacre are there any other concerns for this to go in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a comment explaining why we're using fieldValues then I'm good to go. 👍
Co-authored-by: Chad Whitacre <chadwhitacre@sentry.io>
Uses
Waiting for: Product Owner
instead ofStatus: Untriaged
to send slack notifications