Commit 73a7070
gopls/internal/telemetry/cmd/stacks: paginate issue search
The GitHub API returns at most 100 results per page, but gopls already
has 101 issues, so we are dropping issues and need pagination.
The GitHub search API has a hard limit of 1000 results
(https://docs.github.com/en/rest/search/search?apiVersion=2022-11-28#about-search),
which we'll hit eventually.
As an alternative, use the "List repository issues" API
(https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#list-repository-issues).
This allows filtering by label, which is all we need.
Note that the old code was mistakenly searching all of GitHub, not just
golang/go. That is now fixed.
GitHub pagination uses an awkward header format
(https://docs.github.com/en/rest/using-the-rest-api/using-pagination-in-the-rest-api?apiVersion=2022-11-28),
but it is ultimately just ?page=1, ?page=2, etc, so we just keep trying
new pages until we get no more results.
Updates golang/go#71045.
Change-Id: I6a6a636ccc17c9e1b1024369f98965f59456896a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/642436
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>1 parent fec8580 commit 73a7070
1 file changed
+54
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
| 394 | + | |
400 | 395 | | |
401 | | - | |
| 396 | + | |
402 | 397 | | |
403 | 398 | | |
404 | 399 | | |
405 | 400 | | |
406 | | - | |
| 401 | + | |
407 | 402 | | |
408 | 403 | | |
409 | 404 | | |
| |||
480 | 475 | | |
481 | 476 | | |
482 | 477 | | |
483 | | - | |
| 478 | + | |
484 | 479 | | |
485 | 480 | | |
486 | 481 | | |
| |||
798 | 793 | | |
799 | 794 | | |
800 | 795 | | |
801 | | - | |
802 | | - | |
| 796 | + | |
| 797 | + | |
803 | 798 | | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
817 | 831 | | |
818 | | - | |
819 | | - | |
820 | | - | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
821 | 845 | | |
822 | | - | |
| 846 | + | |
| 847 | + | |
823 | 848 | | |
824 | 849 | | |
825 | 850 | | |
| |||
882 | 907 | | |
883 | 908 | | |
884 | 909 | | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | | - | |
889 | | - | |
890 | | - | |
| 910 | + | |
891 | 911 | | |
892 | 912 | | |
893 | 913 | | |
| |||
0 commit comments