-
Notifications
You must be signed in to change notification settings - Fork 60
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
feat(discussions): refactor get_discussions function for pagination support #433
feat(discussions): refactor get_discussions function for pagination support #433
Conversation
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.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no suggestions.
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.
Hey! Thanks for contributing this! Have you been able to test this out locally? Can you post the results for a a run on an open source repo?
Hey @zkoppert, how are you? Thanks for the review! I've tested this with both GitHub Enterprise Server (GHES) and public GitHub repositories to ensure the pagination works correctly across different environments. Here are the results from testing against the GitHub CLI's discussion repository (cli/cli):
The script successfully processed 283 total discussions: $ python3 issue_metrics.py
Starting issue-metrics search...
Average time to first response: 3 days, 5:30:50
Time to close: 18 days, 1:09:56
Average time to answer: 8 days, 4:01:42
Wrote issue metrics to issue_metrics.md # Discussion Metrics Report
| Metric | Average | Median | 90th percentile |
| --- | --- | --- | ---: |
| Time to first response | 3 days, 5:30:50 | 8:11:30 | 5 days, 18:12:07 |
| Time to close | 18 days, 1:09:56 | 6:14:52 | 22 days, 13:37:09 |
| Time to answer | 8 days, 4:01:42 | 18:12:44 | 12 days, 21:03:25 |
| Metric | Count |
| --- | ---: |
| Number of items that remain open | 237 |
| Number of items closed | 46 |
| Number of most active mentors | 0 |
| Total number of items created | 283 |
| Title | URL | Author | Time to first response | Time to close | Time to answer |
| --- | --- | --- | --- | --- | --- |
| Failing to authenticate on new wsl setup | https://github.com/cli/cli/discussions/6884 | [None](https://github.com/None) | 5:06:12 | None | None |
| How to ‘push’ with gh? | https://github.com/cli/cli/discussions/6889 | [None](https://github.com/None) | 1:09:47 | None | 1:32:20 |
| Issue with Cloning Repository Using GitHub CLI | https://github.com/cli/cli/discussions/9796 | [None](https://github.com/None) | 0:08:56 | 21 days, 22:52:23 | 22 days, 21:52:18 |
| What is the order of filtering operations for search? | https://github.com/cli/cli/discussions/9750 | [None](https://github.com/None) | 8 days, 1:29:17 | 29 days, 2:29:54 | None |
| gh repo create: when adding a team, the granted permission is "read"? | https://github.com/cli/cli/discussions/6906 | [None](https://github.com/None) | 17:53:14 | None | None |
(truncated)
| Issue GH CLI Auth with Jenkins | https://github.com/cli/cli/discussions/6604 | [None](https://github.com/None) | 6:39:41 | None | None |
| GitHub CLI 2.20.0 | https://github.com/cli/cli/discussions/6585 | [None](https://github.com/None) | 2 days, 17:42:43 | None | None |
| GitHub CLI 2.19.0 | https://github.com/cli/cli/discussions/6561 | [None](https://github.com/None) | None | None | None |
_This report was generated with the [Issue Metrics Action](https://github.com/github/issue-metrics)_
Search query used to find these items: `repo:cli/cli type:discussions created:2022-10-31..2024-10-31` I've included a truncated result, but let me know if you want the full output. Let me know if you'd like me to test against any other repositories or if you need any additional information! |
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.
Fantastic! Thank you!!
Pull Request
This pull request includes enhancements to the
get_discussions
function indiscussions.py
to support pagination and improvements to the corresponding tests intest_discussions.py
. The most important changes include adding pagination to the GraphQL query, handling pagination in the function, and updating the tests to cover these scenarios.Closes #44
Proposed Changes
Respective Issue: #44
Readiness Checklist
Author/Contributor
make lint
and fix any issues that you have introducedmake test
and ensure you have test coverage for the lines you are introducing@jeffrey-luszcz
Reviewer
fix
,documentation
,enhancement
,infrastructure
,maintenance
, orbreaking