-
Notifications
You must be signed in to change notification settings - Fork 119
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
Try to find a comment to edit before creating #228
Conversation
const getPRComments = `query getPRComments($owner: String!, $repo: String!, $number: Int!, $cursor: String){ | ||
repository(owner: $owner, name: $repo) { | ||
pullRequest(number: $number) { | ||
comments(first: 20, after:$cursor) { |
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.
comments(first: 20, after:$cursor) { | |
comments(first: 100, after:$cursor) { |
I just put 20 to see if the recursive querying works.
} | ||
return githubClient.issues.createComment({ owner, repo, number, body }) |
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.
For sure like the looks of using GraphQL and promises 👍
nodes { | ||
name | ||
} | ||
} |
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.
Planning to use these labels for something?
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.
If we want to recognize a bot-out
label, for complete opt-out.
Leaning towards keeping these changes instead of what I suggested in #226, especially when it comes to talking to the GitHub API. The other difference from the mentioned PR, is tests. You got any plans for more tests? |
That's my current WIP... mocking the GQL calls. (H/T to @gr2m for https://github.com/octokit/graphql.js/#writing-tests) |
Holler if you run into any blockers or have any questions about GitHub APIs / Octokit, happy to help |
@refack would you mind if I dived into getting a test in place, with the goal of getting this merged & deployed? |
7212854
to
9e6f42c
Compare
@refack as I would really appreciate getting this landed soon, I took the freedom of rebasing with master to fix a PTAL |
I'd still prefer if the bot limited its commenting when possible. |
8dfab1c
to
09b360f
Compare
Alrighty then, let's give this a test round to see how it behaves 🚀 Rebased and force push to fix conflict in |
This is now live in production. |
Reverting changes related to editing existing comments, going back to the previous behaviour of always creating new comments in PRs about CI / Jenkins runs. This is done primarily due to two things: * It has broken node-core-utils' ability to check if CI's have been run * There's not collaborator consensus about editing comments is actually better than creating new comments Future plans for bot PR comments going forward has to be discussed more thorougly and ensured it doesn't break other automation tools used by collaborators. Refs nodejs#228
Reverting changes related to editing existing comments, going back to the previous behaviour of always creating new comments in PRs about CI / Jenkins runs. This is done primarily due to two things: * It has broken node-core-utils' ability to check if CI's have been run * There's not collaborator consensus about editing comments is actually better than creating new comments Future plans for bot PR comments going forward has to be discussed more thoroughly and ensured it doesn't break other automation tools used by collaborators. Refs #228
@octokit/graphql