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

Add commits to site.github #94

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/jekyll-github-metadata/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Client
releases
list_repos
organization_public_members
commits
))

def initialize(options = nil)
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-github-metadata/metadata_drop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def build_revision
def_delegator :repository, :baseurl, :baseurl
def_delegator :repository, :contributors, :contributors
def_delegator :repository, :releases, :releases

def_delegator :repository, :commits, :commits
private
attr_reader :site

Expand Down
4 changes: 4 additions & 0 deletions lib/jekyll-github-metadata/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ def releases
memoize_value :@releases, Value.new(proc { |c| c.releases(nwo) })
end

def commits
memoize_value :@commits, Value.new(proc { |c| c.commits(nwo) })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern here is that we limit this to something reasonable like 50 or 100. I believe we may have auto_paginate on which would mean if you have 200,000 commits, we'd try to grab all of them. 😳

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeaaa... 200,000 commits are definitely not needed. Are you able to set auto_paginate to false for a specific endpoint?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd have to turn it off for the client while this call is made. Something like: octokit/octokit.rb#554 (comment)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I see what'll need to happen, but unfortunately I'm not proficient in Ruby. How would I go about implementing this?

end

def git_ref
if repo_pages_info["source"]
repo_pages_info["source"]["branch"]
Expand Down