-
-
Notifications
You must be signed in to change notification settings - Fork 23.3k
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
Adds the ability to include data from organization repositories #2459
base: master
Are you sure you want to change the base?
Conversation
@rickstaa is attempting to deploy a commit to the github readme stats Team on Vercel. A member of the Team first needs to authorize it. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #2459 +/- ##
==========================================
- Coverage 97.52% 97.44% -0.08%
==========================================
Files 24 24
Lines 4683 4740 +57
Branches 430 434 +4
==========================================
+ Hits 4567 4619 +52
- Misses 115 120 +5
Partials 1 1
☔ View full report in Codecov by Sentry. |
@anuraghazra I think it would be nice to merge this after all these years, even if it is only available under an experimental env variable (see #1122 (comment)). I'm happy to add the tests and documentation if you agree. |
0ba04e7
to
f344673
Compare
@@ -36,6 +36,7 @@ export default async (req, res) => { | |||
disable_animations, | |||
border_radius, | |||
border_color, | |||
role, |
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.
well I totally forgot what this ownerAffiliation does, but why does this need to be controlled by the user?
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.
They do not. Another option I looked at was to use a include_orgs
variable and only add the COLLABORATOR
flag. I did this in #2277, but people had problems (see #1 (comment)). For some reason, when you are the creator of a repository, you have to add yourself as a collaborator since github does not do this automatically even though you have contributed to the repository (see #1 (comment)).
In short, due to limitations in the GraphQL API, there currently is no clean way to implement this. The only way to get the language data in all repositories a user contributed is by looping through the commits, which is infeasible given the current GraphQL and Vercel rate limits. 😅 I created a feature request to improve this, but I think it's improbable GitHub will implement this (see community/community#18230 and community/community#36108).
I'm therefore also okay with not merging an organization-related PR at all, but I just thought implementing it as a (hidden) experimental feature might help some people who code most of their projects in organizations. 🤔👍
This commit fixes a small error in the stats-fetcher that caused the `exclude_repo` parameter values to be seen as the `ownerAffiliation` inputs.
Hello, any news for this PR ? Do you think it could be merged soon ? |
Hey, @alexleboucher, I can not say when and if it will be merged in the master branch since it still has to be reviewed by @anuraghazra, and both he and I maintain this project in our volunteered free time. However, you don't need to wait, as you can already use this PR by adding it to your fork. I already use it on my README 👍. |
any update? |
@Parth-1612 unfortunately, we still have to revisit this again. There are problems with both #2459 and #1122 due to how the stats and languages are currently calculated. For example, we currently only fetch the first 100 repositories in both the stats and language cards, so adding the ORG stats in the current form will make the cards less accurate. All of these issues are discussed in the following:
We will likely merge this or #1122 and make the feature available under the new GitHub action if #2179 is finished 👍🏻. You can, however, already use both #2459 and #1122 in your own forks. |
I just tested the feature by merging the branch into my fork (resolving conflits), but it seems that the OWNER role doesn't work. Only COLLABORATOR and ORGANIZATION_MEMBER 🤷 |
Just checked your instance. Looks like all works as expected, the stats increases when adding new roles to the query string. I will add an examples below. OWNER<img src="https://github-readme-stats-git-master-airopis-projects.vercel.app/api?username=AiroPi&count_private=true&show_icons=true&locale=en&theme=onedark&role=OWNER" /> OWNER + ORGANIZATION_MEMBER<img src="https://github-readme-stats-git-master-airopis-projects.vercel.app/api?username=AiroPi&count_private=true&show_icons=true&locale=en&theme=onedark&role=OWNER,ORGANIZATION_MEMBER" /> OWNER + ORGANIZATION_MEMBER + COLLABORATOR<img src="https://github-readme-stats-git-master-airopis-projects.vercel.app/api?username=AiroPi&count_private=true&show_icons=true&locale=en&theme=onedark&role=OWNER,ORGANIZATION_MEMBER,COLLABORATOR" /> |
Ok I may have misunderstood how role is supposed to works then. Does OWNER means "repo I am the owner of"? Or "repo from organizations I am the owner of"? |
Yes, you are right, OWNER is a default value. Here is the code:
This means "Repositories that are owned by the authenticated user.". GitHub docs source: |
Hello, any news for this PR ? Do you think it could be merged soon ? |
Hey @alexleboucher. Thanks for your interest. Honestly, I don't think that there will be any new features in the nearest time. Currently I'm alone active from the team and I don't have enought access rights to merge anything without additional approval of another collaborator. Additionally, this pull request needs to be reworked a bit, abiltiy to include organizarions data should be accessible only on users own instances under environment varoable. Enabling this feature on public instance will cause more often downtimes due to high consumption of GitHub API token points. Hope on your understanding and patience. Remember that you can deploy this branch on your own Vercel instance and already use this feature. |
Hi, I have forked the I am using the following -> URL + /api/top-langs?username={username}&count_private=true&layout=compact&hide_border=true&hide_title=true&theme=transparent&role=OWNER,COLLABORATOR,ORGANIZATION_MEMBER |
This PR replaced #1122. It adds the ability to include data from organization repositories.