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

"Last Push" for a repo can be misleading #135

Open
dgw opened this issue Apr 30, 2024 · 0 comments
Open

"Last Push" for a repo can be misleading #135

dgw opened this issue Apr 30, 2024 · 0 comments

Comments

@dgw
Copy link
Member

dgw commented Apr 30, 2024

Anecdotally, the best way to see if a repo is still "active" is to look at how long it's been since the last commit to the repo's default branch. In most cases, how old that commit is is a decent proxy for how much development is happening.

GitHub's API doesn't return that value for the repo object's updated_at or pushed_at fields, though. pushed_at includes any ref/HEAD, including PR branches that might originate in a fork (because of GitHub internal implementation stuff). updated_at can be changed by any number of events, including issue/PR comments from random users, and who knows what else.

It is possible to take a repo's default_branch value and make a second API call to https://api.github.com/repos/{owner}/{repoName}/branches/{branchName}, then fetch commit.commit.author.date or commit.commit.committer.date* from there—but that is a lot of work for perhaps not much gain.

For that reason I'm not saying that this issue should be implemented. I'm just opening it so we remember this shortcoming of how things work now. At some point the plugin should be rewritten to use GitHub's GraphQL API, and that should let us fetch exactly the fields we want for any given handler without making multiple calls.**


* — This comes back as nested dictionaries in JSON, of course, but dot notation is easier to read than consecutive subscripts.

** — One downside: GitHub's GraphQL endpoint allows no unauthenticated access, unlike the REST API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant