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

Check the GitHub API before Fetching the Master Specs repo #313

Merged
merged 5 commits into from Mar 10, 2016

Conversation

Projects
None yet
2 participants
@dantoml
Member

dantoml commented Mar 9, 2016

  • Add MasterSource
  • Refactor Source::Aggregate to be initialised with Array
  • Update CocoaPods/CocoaPods SourcesManager for new Aggregate

As recommended CocoaPods/CocoaPods#4989 (comment)

Supersedes CocoaPods/CocoaPods#5001

CocoaPods/CocoaPods counterpart: CocoaPods/CocoaPods#5014

@dantoml dantoml changed the title from Check the GitHub API before Fetching the Master Specs repo to [WIP] Check the GitHub API before Fetching the Master Specs repo Mar 9, 2016

# @return [Bool] Whether the repository has been updated since the commit.
#
def self.modified_since_commit(url, commit)
if repo_id = normalized_repo_id(url)

This comment has been minimized.

@segiddins

segiddins Mar 9, 2016

Member

return true unless

def requires_update
current_commit_hash = '""'
Dir.chdir(repo) do
current_commit_hash = "\"#{(`git rev-parse HEAD`).strip}\""

This comment has been minimized.

@segiddins

segiddins Mar 9, 2016

Member

this should not be quoted, and getting the current commit hash should be extracted into a new method

This comment has been minimized.

@segiddins

segiddins Mar 9, 2016

Member

actually, just use git_commit_hash, it already exists

#
# @return [Bool] Whether the given source should be updated.
#
def requires_update

This comment has been minimized.

@segiddins

segiddins Mar 9, 2016

Member

requires_update?

current_commit_hash = "\"#{(`git rev-parse HEAD`).strip}\""
end
url = 'https://github.com/cocoapods/specs'

This comment has been minimized.

@segiddins

segiddins Mar 9, 2016

Member

repo_url = 'https://github.com/CocoaPods/Specs'

Accept:
- application/vnd.github.chitauri-preview+sha
If-None-Match:
- '""e8e31ca9304385f57ceeb030a29ddd0398660173""'

This comment has been minimized.

@segiddins

segiddins Mar 9, 2016

Member

this is double-quoted

@segiddins

This comment has been minimized.

Member

segiddins commented Mar 9, 2016

👍 other than comments and a CHANGELOG entry

# @return [Array<String>] changed_spec_paths
# Returns the list of changed spec paths.
#
def update(show_output)

This comment has been minimized.

@segiddins

segiddins Mar 9, 2016

Member

this should override update_git_repo, not update, I guess?

@dantoml dantoml force-pushed the dantoml:dan-github-caching branch from 51b1357 to a8bd707 Mar 9, 2016

@segiddins segiddins force-pushed the dantoml:dan-github-caching branch from a8bd707 to 6cd6e70 Mar 10, 2016

@segiddins segiddins changed the title from [WIP] Check the GitHub API before Fetching the Master Specs repo to Check the GitHub API before Fetching the Master Specs repo Mar 10, 2016

@segiddins segiddins force-pushed the dantoml:dan-github-caching branch from 8d1f775 to e076e26 Mar 10, 2016

segiddins added a commit that referenced this pull request Mar 10, 2016

Merge pull request #313 from DanielTomlinson/dan-github-caching
Check the GitHub API before Fetching the Master Specs repo

@segiddins segiddins merged commit 66c7b3b into CocoaPods:master Mar 10, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@segiddins segiddins deleted the dantoml:dan-github-caching branch Mar 10, 2016

@dantoml dantoml referenced this pull request May 4, 2016

Merged

[draft] Shallow clone post mortem. #129

1 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment