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

[SourcesManager] Ignore repos with unreachable sources on update #1595

Merged
merged 4 commits into from Nov 16, 2013
Merged

[SourcesManager] Ignore repos with unreachable sources on update #1595

merged 4 commits into from Nov 16, 2013

Conversation

joshkalpin
Copy link
Member

Fixes #1571. We now will ignore all repo's that have unreachable remotes when updating repos.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 8123182 on Kapin:unreachable-repo-fix into 9f03ab9 on CocoaPods:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 8123182 on Kapin:unreachable-repo-fix into 9f03ab9 on CocoaPods:master.

#
def git_remote_reachable?(dir)
Dir.chdir(dir) { `git ls-remote` }
$?.exitstatus.zero?
Copy link
Member

Choose a reason for hiding this comment

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

Not sure why the method below was using backticks, but this method and the one below should preferably be using the git! method, which also raises a proper error message if the command does not exist.

Finally, but just an FYI, for the exit status you can also use $?.success?.

Copy link
Member

Choose a reason for hiding this comment

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

$?.success?Ah I didn't know about this one!

Copy link
Member Author

Choose a reason for hiding this comment

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

@alloy I'll convert all of them over then. Also good to know about the $?.success? thing

Copy link
Member Author

Choose a reason for hiding this comment

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

So it turns out using git! will not throw a fatal with ls-remote if there is no source. Using backticks lets this filter through to the console and not explode. Similarly, using git! for the lower command doesn't seem to work.

Copy link
Member

Choose a reason for hiding this comment

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

FYI: The executable module implements some logic about this:

  • git! raises if the exit code is not 0 (it is intended to abort on unexpected failures for subprocesses).
  • git doesn't raise (intended to be used in cases where we are checking for a failure).

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahhh that makes a ton more sense. I'll try that again.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 0feb5f1 on Kapin:unreachable-repo-fix into f09bb13 on CocoaPods:master.

@fabiopelosin
Copy link
Member

That failure sometimes happens on Travis and I'm still not able to understand the cause. I have restarted the build which usually is enough to fix it.

@fabiopelosin
Copy link
Member

The patch looks ace!

@Lascorbe you might be interested in this implementation and taking parts of it. @kapin approach is cleaner that the one that I suggested to check for git repos.

joshkalpin pushed a commit that referenced this pull request Nov 16, 2013
[SourcesManager] Ignore repos with unreachable sources on update
@joshkalpin joshkalpin merged commit 9e71add into CocoaPods:master Nov 16, 2013
Lascorbe referenced this pull request in Lascorbe/CocoaPods Nov 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pod Install Fails if Internal Pod Repo Unavailable (even if unused)
6 participants