Open tisonkun opened 8 months ago
@tisonkun The data URL is strictly identical with the GitHub repo name and it is case sensitive. So you should visit this URL: https://github.com/GreptimeTeam/greptimedb and the data will show up. We should check if there is another way to get the repo name from page meta data rather than the URL path so we can know the actually name of the repo.
SGTM. How can this plugin currently resolve the name? GitHub treats repo name case insensitive though.
Right now, Hypercrx parses the window.location
to get the repo name, I found there are some places in the web page to find out the real repo name, but we can not ensure to get the name since GitHub change the page content constantly while refactoring the website.
If you can access GitHub API, here are two methods you can resolve the name with "greptimeteam/greptimedb" to the proper fullname:
With REST API:
gh api -H "Accept: application/vnd.github.VERSION.sha" repos/greptimeteam/greptimedb | jq -r '.full_name'
You can rewrite this command with the JS API trivially.
With GraphQL API:
query {
repository(owner: "greptimeteam", name: "greptimedb", followRenames: true) {
nameWithOwner
}
}
Yes, this is a good method, although GitHub API call without token is limited by IP so it will be quite easy to hit the rate limit. If we support login to GitHub from the extension, we can use API calls to get the data and even more other interactions with GitHub.
I'm using GitHub Issue Link Status plugin also which should apply the tech you mention. You can check its code for how to do it.
I installed the extension and it requires a GitHub token input manually on installation to call the API, actually we also provide the functionality before but removed in recent versions. I think we should add it back for further features.
Version
No response
Current Behavior
https://github.com/greptimeteam/greptimedb
I cannot see the OpenRank widgets as well as Perceptor.
Expected Behavior
I'd like to check the data for this repo.
Environment
Any additional comments?
No response