feat(Git Sync): Support for multiple files on the same repository #7843
+132
−70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Highlights:
Blockers:
Logic for Git Sync:
The structure of Insomnia files in the git repository is stored inside a folder named
📁 .insomnia
.For example a Collection with a Request will be stored in a repository like this:
In Insomnia when we clone a repository:
📁 .insomnia
folder is mapped to NeDB📁 .git
folder is mapped to a folder for that workspace inside version control named📁 git
📁 other
Currently if we add another Collection to the repository will create a structure like this:
Requirements:
This is so that when someone is working on a specific branch on a specific Workspace it doesn't affect other Workspaces of the same repo that are cloned locally.
Limitations from the approaches that have been tried:
Use the filesystem routing to only map related records of a single Workspace to NeDB:
This means that anything that requires walking the tree to check if a Request belongs to a specific Workspace is not reliable.
e.g. we can't know for sure if the Request
req_8b75cc5c6d804e2a8eeb990634cbac62
belongs to Workspacewrk_c9eee6d3eff145e9a83f83c1a91ebd7d
orwrk_7611b6018dcd4867ba928fcf060d0139
.Map all Workspaces and all their records to NeDB:
Other approaches:
Store workspaces in the
📁 .insomnia
folder to separate the data per workspace:The above example would look like this:
➕ Pros:
➖ Cons:
Closes INS-4277