Open strogonoff opened 5 years ago
Pre-requisites:
In Electron’s main
, in background:
origin/master
frequentlymaster
to origin/master
frequently
origin/master
and merge it in local master
In Electron’s renderer
, in GUI:
ipcRenderer
Offline, with repository:
CC @ronaldtse:
I’m considering switching to the mode of collaboration described above. Feel free to ignore some implementation notes, but I hope it’s conceptually clear how it’d work.
Cost 1 is this will create a lot of commits right in the mainline branch, so someone would have to squash and rewrite history every now and then. it’s easier than constantly dealing with PRs, though.
Cost 2 is editors will have a chance of having some of their changes lost while editing, in case someone else changes the same field(s) as in yet-unpushed commits. The amount of changes lost would depend on how frequently the app commits and pushes, and how soon we lock the app if connection to Git repo goes down. Ideally we’d lock it soon, so it’ll be more or less an always-online app, similar to Google Docs.
Cost 3 is push access, which theoretically can create a DoS-like situation if a bad actor gains push access, but since force push will be tightly controlled this should be recoverable.
Cost 4 is performance hit, uncertain how well this would work on slower machines…
On plus side, this would avoid the need for pull request maintenance and make for a very smooth and natural collaboration feel. Curious what you think.
Currently, the app pushes directly to master. It doesn’t yet handle failed merges. If there are conflicting changes upstream, it will fail and will require the user to merge changes locally, inside app’s data repo (requiring Git CLI installation & familiarity with).
We could keep operating on master and help recover from merge errors with some fallback mechanism and good error reporting. E.g., if there is a conflict, we could do one of the following:
In both cases, we should block user’s work until the conflict is resolved, to avoid piling up divergent changes.
We could also minimize the chance of merge conflicts:
Both cases require someone higher up (editor manager?) to handle merges into upstream. This could be a feature, offering a review workflow.
Using private forks
Users would work on private forks, reducing the chance of merge conflicts when user syncs up their changes.
Creating forks and handling merges into upstream could be the responsibility of whoever manages site editors. That person could also limit direct commit access for upstream repository.
In simplest version, the app could simply offer an option to specify repo URL. The app could also allow specifying two URLs, one for read-only upstream and one for private fork. Every editor would configure the app with their private fork.
In a more complex implementation, we could have optional YAML configuration (bundled with the app or fetched from somewhere) that specifies usernames and private fork URLs (supervisor-type role could have access to upstream URL). Depending on username entered by the editor in their app installation, the app would pick fork URL implicitly, providing smoother UX without an extra dialog.