Skip to content
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

Exclude bot's comment from "Time to first response" #121

Merged
merged 3 commits into from
Sep 19, 2023
Merged

Exclude bot's comment from "Time to first response" #121

merged 3 commits into from
Sep 19, 2023

Conversation

eichisanden
Copy link
Contributor

Proposed Changes

Exclude bot's comment from "Time to first response".

I believe that bots in GitHub actions often respond faster than users, so it's hard to imagine a use case where measuring the time it takes for a bot to respond would be useful.

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request
  • run make lint and fix any issues that you have introduced
  • run make test and ensure you have test coverage for the lines you are introducing
  • Label as either bug, documentation, enhancement, infrastructure, or breaking

Split function to avoid "too complex" error when executing lint.
Added that the issue author's own comments
and comments by bots are excluded.
# ignore comments by IGNORE_USERS
comment_user.login in ignore_users
# ignore comments by bots
or comment_user.type == "Bot"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were you able to test this one out? I was worried by the documentations description:

A string representing the type of User account this. In all cases should be “User”

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not read the documentation, but I have confirmed that a "bot" is returned when the API is called.

For example.

% gh api \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /users/codesee-maps\[bot\]
{
  "login": "codesee-maps[bot]",
  ...
  "type": "Bot",
  ...
}

As a side note, I hope the api documentation clearly states this. However, the Examples only mentions "User".

https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-a-user

@zkoppert zkoppert self-assigned this Sep 18, 2023
@zkoppert zkoppert added the enhancement New feature or request label Sep 18, 2023
Copy link
Member

@zkoppert zkoppert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @eichisanden and especially for splitting this out to a separate function!

@zkoppert
Copy link
Member

I'll publish a new release tomorrow so this gets deployed to folks.

@zkoppert zkoppert merged commit 66e9f5b into github:main Sep 19, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants