You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To do this, an action is run daily that uses gh search code to identify repositories with a pyproject.toml that declares a minimum dependency on Python 3.14. We then shallow clone each such repository and parse the python files, looking for uses of t-strings (contains ast.TemplateStr or imports from string.templatelib).
This has been working without problem until a few days ago. The gh search code invocation that has been used since I first built the project is no longer returning consistent results, and is most definitely not returning a full result set anymore. (3.14 is new enough that there are roughly 500 such repositories at the moment; something changed behind the scenes and I often get far fewer than 100 returned today)
I know from the documentation that gh search code uses the "legacy search API". But I don't really see another better API available to perform a search that looks like this one:
To do this, an action is run daily that uses gh search code to identify repositories with a pyproject.toml that declares a minimum dependency on Python 3.14. We then shallow clone each such repository and parse the python files, looking for uses of t-strings (contains ast.TemplateStr or imports from string.templatelib).
This has been working without problem until a few days ago. The gh search code invocation that has been used since I first built the project is no longer returning consistent results, and is most definitely not returning a full result set anymore. (3.14 is new enough that there are roughly 500 such repositories at the moment; something changed behind the scenes and I often get far fewer than 100 returned today)
I know from the documentation that gh search code uses the "legacy search API". But I don't really see another better API available to perform a search that looks like this one:
Does anyone know if something material changed with the "legacy code search" endpoint in the past week or so?
Can anyone suggest a scalable approach that meets GitHub's terms of service and that would allow me to identify all such repositories? Is there one?
Thanks! This is just a fun side project, but I'd love to figure out how to do this in a way that doesn't tax GitHub and scales nicely.
Cheers, Dave
this is not you — GitHub quietly tightened legacy code search recently, so wide queries now just don’t return the full result set anymore (it’s throttling / anti-fanout).
quick fix that actually works right now:
don’t do one huge search, do multiple smaller buckets, like:
Code Search and NavigationSearch, navigate, and understand code on GitHubQuestionAsk and answer questions about GitHub features and usage
2 participants
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
About a month ago I built a tiny website called "Big Time T-Strings".
The website shows a list of public repositories on GitHub that use Python 3.14's new t-strings feature, which just shipped.
To do this, an action is run daily that uses
gh search codeto identify repositories with apyproject.tomlthat declares a minimum dependency on Python 3.14. We then shallow clone each such repository and parse the python files, looking for uses of t-strings (containsast.TemplateStror imports fromstring.templatelib).This has been working without problem until a few days ago. The
gh search codeinvocation that has been used since I first built the project is no longer returning consistent results, and is most definitely not returning a full result set anymore. (3.14 is new enough that there are roughly 500 such repositories at the moment; something changed behind the scenes and I often get far fewer than 100 returned today)I know from the documentation that
gh search codeuses the "legacy search API". But I don't really see another better API available to perform a search that looks like this one:So, two questions:
Does anyone know if something material changed with the "legacy code search" endpoint in the past week or so?
Can anyone suggest a scalable approach that meets GitHub's terms of service and that would allow me to identify all such repositories? Is there one?
Thanks! This is just a fun side project, but I'd love to figure out how to do this in a way that doesn't tax GitHub and scales nicely.
Cheers,
Dave
Beta Was this translation helpful? Give feedback.
All reactions