8000 API calls for each and every repository? #2 · Issue #242 · jekyll/github-metadata · GitHub
[go: up one dir, main page]

Skip to content

API calls for each and every repository? #2 #242

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

Closed
egor-tensin opened this issue Oct 15, 2022 · 9 comments
Closed

API calls for each and every repository? #2 #242

egor-tensin opened this issue Oct 15, 2022 · 9 comments

Comments

@egor-tensin
Copy link
egor-tensin commented Oct 15, 2022

I couldn't find a button to re-open issue #237, so I'm creating a new one. I finally moved to Jekyll 4, upgraded jekyll-github-metadata to 2.15.0, and was happy for a bit, until I actually started working on my Jekyll projects. When I run bundle exec jekyll serve --verbose on repository https://github.com/egor-tensin/egor-tensin.github.io, it makes a single API call, as expected:

         Rendering: index.html
  Pre-Render Hooks: index.html
  Rendering Liquid: index.html
   GitHub Metadata: Generating for egor-tensin/egor-tensin.github.io
  Rendering Markup: index.html
Post-Convert Hooks: index.html
  Rendering Layout: index.html
   GitHub Metadata: Calling @client.repository("egor-tensin/egor-tensin.github.io", {:accept=>"application/vnd.github.drax-preview+json"})
           Writing: /home/egor/workspace/personal/egor-tensin.github.io/_site/index.html
                    done in 1.518 seconds.
         Requiring: jekyll-watch

However, when I modify something (while Jekyll is serving), it again starts making API calls for every repository (+ extra 7 unneeded API calls):

[2022-10-15 22:18:15] DEBUG Jekyll::Commands::Serve::Servlet is invoked.
      Regenerating: 1 file(s) changed at 2022-10-15 22:18:25
                    index.html
   GitHub Metadata: Calling @client.pages("egor-tensin/egor-tensin.github.io", {})
   GitHub Metadata: Calling @client.contributors("egor-tensin/egor-tensin.github.io")
   GitHub Metadata: Calling @client.latest_release("egor-tensin/egor-tensin.github.io")
   GitHub Metadata: Calling @client.organization("egor-tensin")
   GitHub Metadata: Calling @client.organization("egor-tensin")
   GitHub Metadata: Calling @client.user("egor-tensin")
   GitHub Metadata: Calling @client.list_repos("egor-tensin", {:type=>"public", :accept=>"application/vnd.github.mercy-preview+json"})
   GitHub Metadata: Calling @client.releases("egor-tensin/aes-tools")
   GitHub Metadata: Calling @client.contributors("egor-tensin/aes-tools")
   GitHub Metadata: Calling @client.releases("egor-tensin/blog")
   GitHub Metadata: Calling @client.contributors("egor-tensin/blog")
   GitHub Metadata: Calling @client.releases("egor-tensin/build-boost")
   GitHub Metadata: Calling @client.contributors("egor-tensin/build-boost")
   GitHub Metadata: Calling @client.releases("egor-tensin/cgitize")
   GitHub Metadata: Calling @client.contributors("egor-tensin/cgitize")
   GitHub Metadata: Calling @client.releases("egor-tensin/cgitize-test-repository")
   GitHub Metadata: Calling @client.contributors("egor-tensin/cgitize-test-repository")
   GitHub Metadata: Calling @client.releases("egor-tensin/chess-games")
   GitHub Metadata: Calling @client.contributors("egor-tensin/chess-games")
   GitHub Metadata: Calling @client.releases("egor-tensin/chruby")

Would you please help me? Thanks.

@egor-tensin
Copy link
Author

I just nuked my rbenv installation and reinstalled everything just in case, the issue is still there.

@egor-tensin
Copy link
Author

I see that my previous issue #237 is almost the last one, even though it was opened in May. Does nobody else use Jekyll and/or this gem anymore? I'd be happy to hear about alternative gems, if anyone has any ideas.

@ashmaroli
Copy link
Member

Hello @egor-tensin, didn't this get patched?
Hmmm.. so the previous patch just served as band-aid instead of an actual cure? Or is this a symptom of another issue? Will have to investigate.

@egor-tensin
Copy link
Author
egor-tensin commented Oct 17, 2022

didn't this get patched

It did, but only for startup. When I change a file, still a lot of extra API calls are made, as described.

@egor-tensin
Copy link
Author

I'm actually more curious about what other people use, because, to be frank, it's clear that nobody uses this gem, at least not with Jekyll 4. Has everybody migrated to Hugo already? I really am too lazy to do it...

@egor-tensin
Copy link
Author
egor-tensin commented Oct 17, 2022

Steps to reproduce:

git clone https://github.com/egor-tensin/egor-tensin.github.io.git
cd egor-tensin.github.io
git checkout reproduce
docker run -it --rm --network host -v "$( pwd ):/site" ruby:2.7.6-alpine sh
# In the container:
apk add g++ openssl-dev make git
cd /site
bundle install
bundle exec jekyll serve --verbose
# The above will only trigger one API call initially, as expected.

Now change one file on the host (e.g. index.html); a lot of API calls will be made, as described above.

Expected result: only one API call max.
Actual result: a few extra API calls + a couple of calls for every repository, as the --verbose log clearly shows.

@ashmaroli
Copy link
Member
ashmaroli commented Oct 17, 2022

On investigation, the current set of API calls is originating from a different location than what was patched in the prior commit / solution.
This is a bigger issue as a result of Jekyll 4 optimization.

@egor-tensin
Copy link
Author

Any plans to fix this or none at all?

egor-tensin added a commit to egor-tensin/jekyll-theme that referenced this issue Oct 22, 2022
egor-tensin added a commit to egor-tensin/egor-tensin.github.io that referenced this issue Oct 22, 2022
egor-tensin added a commit to egor-tensin/blog that referenced this issue Oct 22, 2022
egor-tensin added a commit to egor-tensin/sorting-algorithms that referenced this issue Oct 22, 2022
egor-tensin added a commit to egor-tensin/wireguard-config that referenced this issue Oct 22, 2022
@jekyllbot
Copy link
Contributor

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master/main branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

@jekyllbot jekyllbot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 20, 2023
@jekyll jekyll locked and limited conversation to collaborators Feb 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants
0