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

Clone as fallback is not working if fetch fails on non-first-clone jobs #8

Open
rassie opened this issue Oct 18, 2017 · 2 comments
Open

Comments

@rassie
Copy link
Contributor

rassie commented Oct 18, 2017

If I'm reading the code correctly, there is an assumption that git fetch can only fail if the target directory is missing, i.e. this is first-clone time. However, should fetch fail for whatever reason while the target directory exists (e.g. wrong credentials), it is not deleted to make room for a clone.

@rassie rassie changed the title Clone as fallback is not working if fetch failed Clone as fallback is not working if fetch fails on non-first-clone jobs Oct 18, 2017
@jonasmalacofilho
Copy link
Owner

That's true. Though I'm not sure if the cache (target) directory should be deleted.

I think such a failure should be reported to the end user, as it's probably a network error or other non-recoverable problem (authentication has already succeeded for control flow to reach this point).

Does this make sense?

@rassie
Copy link
Contributor Author

rassie commented Oct 18, 2017

Yes, report it to the user and abort the request. The authentication problem has been two-fold until now: you have been authenticating to upstream with the credentials you've got via the request, but actually fetched newest revisions with the credentials saved in .git/config. This shouldn't be the case anymore with my patch for #7, but there might be some edge cases which are not covered.

Either way: error message and abort should be good enough.

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

No branches or pull requests

2 participants