Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Guard against possibly stale local git repos #696

Merged
merged 1 commit into from
Jun 1, 2017

Conversation

sdboyer
Copy link
Member

@sdboyer sdboyer commented Jun 1, 2017

Fixes #639, fixes #699, fixes #649 (probably, so we'll gonna close it optimistically on merge).

In all these methods, I'd been relying on sourceGateway.convertToRevision() to update the local repo if the revision wasn't present in it. Problem is, it was checking whether the revision exists in the cache - which, for git, is populated from upstream directly, without necessarily updating the local. So, this adds retry logic that retries each of the version-accepting sourceGateway methods the assumption that what's in sourceGateway.cache is an accurate representation of what's on disk.

However, this does highlight another problem with the generalized FSM sourceGateway uses for underlying source state management. In this case, sourceGateway.cache being out of sync with what's on disk is a byproduct of subtle, incorrect assumptions I made about the relationship between sourceHasLatestLocally and sourceHasLatestVersionList.

We eventually need to move to a system where the source becomes more elaborate, informing the sourceGateway about the right FSM to use for its particular needs.

No tests because this is very tricky to test without a whole apparatus - e.g., #533. TODOs instead 😄

@sdboyer
Copy link
Member Author

sdboyer commented Jun 1, 2017

(gonna give this until tomorrow for an intrepid reviewer, then i'll merge)

@darethas
Copy link

hello, just a question around this functionality -- what is the suggested workflow if you are working on two packages at the same time -- say a server and a client implementation, and you are saving the server as a dependency in the client package? In the godep world, my local changes just get copied straight in when I ran godep update. Is there anything equivalent here, or is it always push to remote and re-download?

@sdboyer
Copy link
Member Author

sdboyer commented Jul 25, 2017

@treehau5 hi! this issue is actually dealing with something entirely different, even though it may seem related from the title. what you're describing turns out to be a knotty problem in the project-and-vendor centric world of dep, and we've not cracked it yet.

that said, https://github.com/GetStream/vg may end up meeting your need.

@darethas
Copy link

Ok, thanks for the reply. I will take a look. Good work on the tool.

@sdboyer
Copy link
Member Author

sdboyer commented Jul 25, 2017

thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants