Guard against possibly stale local git repos#696
Conversation
|
(gonna give this until tomorrow for an intrepid reviewer, then i'll merge) |
|
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? |
|
@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. |
|
Ok, thanks for the reply. I will take a look. Good work on the tool. |
|
thanks! |
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-acceptingsourceGatewaymethods the assumption that what's insourceGateway.cacheis an accurate representation of what's on disk.However, this does highlight another problem with the generalized FSM
sourceGatewayuses for underlyingsourcestate management. In this case,sourceGateway.cachebeing out of sync with what's on disk is a byproduct of subtle, incorrect assumptions I made about the relationship betweensourceHasLatestLocallyandsourceHasLatestVersionList.We eventually need to move to a system where the
sourcebecomes more elaborate, informing thesourceGatewayabout 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 😄