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

Parameter hide=stars breaks statistics column #2495

Closed
Olf0 opened this issue Feb 4, 2023 · 9 comments
Closed

Parameter hide=stars breaks statistics column #2495

Olf0 opened this issue Feb 4, 2023 · 9 comments
Labels
bug Something isn't working.

Comments

@Olf0
Copy link

Olf0 commented Feb 4, 2023

Describe the bug

Appending the parameter hide=stars to the parameter set breaks the statistics column. In my specific case only the (then) first line was displaying a erroneous value, "Total Commits: 2" instead of the correct value "Total Commits: 3.2k".

Expected behaviour

Adding the parameter hide=stars to the parameter set solely lets the row "Total Stars Earned:" disappear.

Screenshots / Live demo link

Broken statistics column with parameter hide=stars as last parameter:
broken-statistics-colum-with-hide_stars.svg

Correct statistics column without parameter hide=stars:
correct-statistics-colum-without-hide_stars.svg

Additional context

Ultimately I omitted the parameter hide=stars as a workaround.

@Olf0 Olf0 added the bug Something isn't working. label Feb 4, 2023
@rickstaa
Copy link
Collaborator

rickstaa commented Feb 4, 2023

@Olf0, thanks for the bug report. I, however, can not reproduce the issue (see images below). Could you provide me with the exact command you are using?

Without icons

Anurag's GitHub stats

[![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=olf0&hide=stars&include_all_commits=true)](https://github.com/anuraghazra/github-readme-stats)

Anurag's GitHub stats

[![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=rickstaa&hide=stars&include_all_commits=true)](https://github.com/anuraghazra/github-readme-stats)

With icons

Anurag's GitHub stats

[![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=olf0&hide=stars&include_all_commits=true&show_icons=true)](https://github.com/anuraghazra/github-readme-stats)

Anurag's GitHub stats

[![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=rickstaa&hide=stars&include_all_commits=true&show_icons=true)](https://github.com/anuraghazra/github-readme-stats)

@Olf0
Copy link
Author

Olf0 commented Feb 4, 2023

Could you provide me with the exact command you are using?

I already did in the section "Additional context".

Side notes:

  • Yes, I already suspected some interference between options, obviously it is not show_icons (which I never set to false before).
  • I wanted to check if the option parser may bear some position dependence of options: It is JavaScript, hence I am out (sorry).

@rickstaa
Copy link
Collaborator

rickstaa commented Feb 6, 2023

Could you provide me with the exact command you are using?

I already did in the section "Additional context".

Side notes:

  • Yes, I already suspected some interference between options, obviously it is not show_icons (which I never set to false before).
  • I wanted to check if the option parser may bear some position dependence of options: It is JavaScript, hence I am out (sorry).

@Olf0 I am not able to reproduce your problems. Please take a look at my message above. Please add the live cards with the associated markdown in a comment below. Please take a look at my note above for an example.

@Olf0
Copy link
Author

Olf0 commented Feb 6, 2023

O.K., here are the expanded copies of the link Olf0/Olf0@4c9d7bc provided in my initial message, plus a copy of the results (saved as PNGs) form my initial message.

Does not work as documented:

<a href="https://github.com/anuraghazra/github-readme-stats#readme">
  <img align="center" width="100%" src="https://github-readme-stats.vercel.app/api?username=Olf0&custom_title=olf's%20statistics&show_icons=true&disable_animations=false&line_height=25&cache_seconds=86399&theme=transparent&locale=en&include_all_commits=true&count_private=true&hide=stars" />
</a>

results in broken-statistics-colum-with-hide_stars.svg

Omitting &hide=stars lets it work correctly (but with the unwanted stars row):

<a href="https://github.com/anuraghazra/github-readme-stats#readme">
  <img align="center" width="100%" src="https://github-readme-stats.vercel.app/api?username=Olf0&custom_title=olf's%20statistics&show_icons=true&disable_animations=false&line_height=25&cache_seconds=86399&theme=transparent&locale=en&include_all_commits=true&count_private=true" />
</a>

results in correct-statistics-colum-without-hide_stars.svg


IIRC I had formatting issues with markdown, hence I resorted to HTML. I assume(d) it does not make a difference for the scripts generating these images (I assume they are what you mean with "live cards"?), as they are called with the same parameters.

Is that the information you wanted, or did I misunderstand your request?

P.S.: I avoided to use "the real thing", because that quickly results in "Maximum retries exceeded", as you now can see in your examples above (will be gone tomorrow).

@rickstaa
Copy link
Collaborator

rickstaa commented Feb 6, 2023

Thanks for the information. With Live cards, I mean the exact Markdown or HTML code you used. 👍These can be placed into the comment to let the cards render live on the screen instead of showing it as a static SVG. When I use your command, I can still not reproduce the errors (see below). 🤔

With hide=stars

<a href="https://github.com/anuraghazra/github-readme-stats#readme">
  <img align="center" width="100%" src="https://github-readme-stats.vercel.app/api?username=Olf0&custom_title=olf's%20statistics&show_icons=true&disable_animations=false&line_height=25&cache_seconds=86399&theme=transparent&locale=en&include_all_commits=true&count_private=true&hide=stars" />
</a>

Without hide=stars

<a href="https://github.com/anuraghazra/github-readme-stats#readme">
  <img align="center" width="100%" src="https://github-readme-stats.vercel.app/api?username=Olf0&custom_title=olf's%20statistics&show_icons=true&disable_animations=false&line_height=25&cache_seconds=86399&theme=transparent&locale=en&include_all_commits=true&count_private=true" />
</a>

Olf0 added a commit to Olf0/Olf0 that referenced this issue Feb 6, 2023
anuraghazra/github-readme-stats#2495
… because it is fine now; the question is for how-long.
@Olf0
Copy link
Author

Olf0 commented Feb 6, 2023

When I use your command, I can still not reproduce the errors (see below). 🤔

Your check made me retry: Now I cannot reproduce it either! 😕

Hey, I tried this back and forth two times, before I saved the images as PNGs, which I embedded in the initial post here.
So I returned to my intended setting and will continue to watch it: https://github.com/Olf0/Olf0/blob/master/README.md 👀

Sorry! Puzzled.

@rickstaa
Copy link
Collaborator

rickstaa commented Feb 7, 2023

When I use your command, I can still not reproduce the errors (see below). 🤔

Your check made me retry: Now I cannot reproduce it either! 😕

Hey, I tried this back and forth two times, before I saved the images as PNGs, which I embedded in the initial post here. So I returned to my intended setting and will continue to watch it: https://github.com/Olf0/Olf0/blob/master/README.md 👀

Sorry! Puzzled.

No problem. Thanks for letting us know. The GraphQL and REST APIs are buggy sometimes. It could be that the card cached a temporary error (see #1515).

@rickstaa rickstaa closed this as completed Feb 7, 2023
@Olf0
Copy link
Author

Olf0 commented Feb 7, 2023

@rickstaa, thank you for the explanation, which actually makes sense when looking at the wrong value returned: "2" is very likely then number of private commits I ever did at GitHub.

As your comment in issue #1515 describes and the code nicely shows: If include_all_commits is set true GitHub's REST API returns "0" in the error case; then the number of private commits is added to this value, if count_private is set true.

As I was experimenting with these "live cards", I switched on all possible parameters to play with them and went through some iterations trying different values, then looking at the result. In hindsight this was a good scheme to trigger this bug.

Now I understand what likely happened, thus I appreciate your explanation and pointing to issue #1515 very much!

@rickstaa
Copy link
Collaborator

rickstaa commented Feb 7, 2023

@rickstaa, thank you for the explanation, which actually makes sense when looking at the wrong value returned: "2" is very likely then number of private commits I ever did at GitHub.

As your comment in issue #1515 describes and the code nicely shows: If include_all_commits is set true GitHub's REST API returns "0" in the error case; then the number of private commits is added to this value, if count_private is set true.

As I was experimenting with these "live cards", I switched on all possible parameters to play with them and went through some iterations trying different values, then looking at the result. In hindsight this was a good scheme to trigger this bug.

Now I understand what likely happened, thus I appreciate your explanation and pointing to issue #1515 very much!

Thanks for your detailed investigation report! When I perform tests, I make sure a random string is added to the query (i.e. &random=234234sfds). This will break the cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

3 participants
@Olf0 @rickstaa and others