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
Conversation
# | ||
def git_remote_reachable?(dir) | ||
Dir.chdir(dir) { `git ls-remote` } | ||
$?.exitstatus.zero? |
There was a problem hiding this comment.
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?
.
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
Conflicts: CHANGELOG.md
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. |
[SourcesManager] Ignore repos with unreachable sources on update
Fixes #1571. We now will ignore all repo's that have unreachable remotes when updating repos.