github-readme-stats icon indicating copy to clipboard operation
github-readme-stats copied to clipboard

Adds the ability to include data from organization repositories

Open rickstaa opened this issue 2 years ago • 13 comments

This PR replaced #1122. It adds the ability to include data from organization repositories.

rickstaa avatar Jan 24 '23 09:01 rickstaa

@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.

vercel[bot] avatar Jan 24 '23 09:01 vercel[bot]

Codecov Report

Patch coverage: 92.75% and project coverage change: -0.08 :warning:

Comparison is base (c96e84a) 97.52% compared to head (522ec4b) 97.44%.

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              
Impacted Files Coverage Δ
src/common/utils.js 99.00% <86.84%> (-1.00%) :arrow_down:
api/index.js 96.19% <100.00%> (+0.07%) :arrow_up:
api/top-langs.js 95.74% <100.00%> (+0.09%) :arrow_up:
src/fetchers/stats-fetcher.js 92.08% <100.00%> (+0.32%) :arrow_up:
src/fetchers/top-languages-fetcher.js 88.95% <100.00%> (+0.27%) :arrow_up:

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Jan 24 '23 09:01 codecov[bot]

@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 https://github.com/anuraghazra/github-readme-stats/pull/1122#issuecomment-1401638826). I'm happy to add the tests and documentation if you agree.

rickstaa avatar Jan 24 '23 10:01 rickstaa

Hello, any news for this PR ? Do you think it could be merged soon ? Thanks !

alexleboucher avatar Jan 27 '23 09:01 alexleboucher

Hello, any news for this PR ? Do you think it could be merged soon ? Thanks !

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 👍.

rickstaa avatar Jan 27 '23 10:01 rickstaa

any update?

Parth-1612 avatar Mar 06 '23 02:03 Parth-1612

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:

  • https://github.com/anuraghazra/github-readme-stats/issues/1.
  • https://github.com/anuraghazra/github-readme-stats/pull/1122.
  • https://github.com/anuraghazra/github-readme-stats/issues/1852
  • https://github.com/anuraghazra/github-readme-stats/issues/1801

We will likely merge this or #1122 and make the feature available under the new GitHub action if https://github.com/anuraghazra/github-readme-stats/issues/2179 is finished 👍🏻. You can, however, already use both #2459 and #1122 in your own forks.

rickstaa avatar Mar 06 '23 07:03 rickstaa

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 🤷

AiroPi avatar Mar 20 '24 00:03 AiroPi

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" />

qwerty541 avatar Mar 21 '24 10:03 qwerty541

Ok I may have misunderstood how role is supposed to works then. Is "OWNER" like a default value if the "role" argument isn't provided ?

Does OWNER means "repo I am the owner of"? Or "repo from organizations I am the owner of"?

AiroPi avatar Mar 21 '24 11:03 AiroPi

Ok I may have misunderstood how role is supposed to works then. Is "OWNER" like a default value if the "role" argument isn't provided ?

Yes, you are right, OWNER is a default value. Here is the code: https://github.com/anuraghazra/github-readme-stats/pull/2459/files#diff-658a74e9e49cfa0bc40425a3275025795e81f2492c36d010ac2662510044ce0dR444-R447

Does OWNER means "repo I am the owner of"? Or "repo from organizations I am the owner of"?

This means "Repositories that are owned by the authenticated user.". GitHub docs source: https://docs.github.com/en/graphql/reference/enums#repositoryaffiliation

qwerty541 avatar Mar 23 '24 21:03 qwerty541

Hello, any news for this PR ? Do you think it could be merged soon ? (yes, I already asked this 15 months ago 😅)

alexleboucher avatar Apr 22 '24 08:04 alexleboucher

Hello, any news for this PR ? Do you think it could be merged soon ? (yes, I already asked this 15 months ago 😅)

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.

qwerty541 avatar May 01 '24 18:05 qwerty541