Think of a way to automatize CE->EE merges
See https://gitlab.com/gitlab-org/gitlab-ce/issues/25870#note_20340033.
We could start simple with a little script run as a CRON each day that would:
- Check if a
CE upstream
MR is already open, do nothing in this case git fetch ee master
git checkout -b ce_upstream ee/master
git fetch ce master
git merge --no-ff ce/master
-
git status
-> save for the merge request description - Find the latest modifiers of the conflicting files
git add .
git commit
git push
- Open a MR with the output of
git status
in the description, assigned to one of the developers identified in step 7. (or a random developer) - (optional) Open a new issue to track conflicting files in order to refactor them.
Notes:
- Mapping of committer to GitLab usernames could be done using
team.yml
from thewww-gitlab
project...
Bonus points
- We could save each conflicting files in a DB and use this data with Redash (show the most conflicting files sorted by last conflict date)
- We could generate the CE/EE diff after each
CE Upstream
MR is merged using a webhook and the script I wrote at https://gitlab.com/rymai-gitlab/ce_ee_diffs_generator/blob/master/diff_generator
References
A snip of git help status
:
Short Format
In the short-format, the status of each path is shown as
XY PATH1 -> PATH2
where PATH1 is the path in the HEAD, and the " -> PATH2" part is shown only when PATH1 corresponds to a
different path in the index/worktree (i.e. the file is renamed). The XY is a two-letter status code.
The fields (including the ->) are separated from each other by a single space. If a filename contains
whitespace or other nonprintable characters, that field will be quoted in the manner of a C string literal:
surrounded by ASCII double quote (34) characters, and with interior special characters backslash-escaped.
For paths with merge conflicts, X and Y show the modification states of each side of the merge. For paths
that do not have merge conflicts, X shows the status of the index, and Y shows the status of the work tree.
For untracked paths, XY are ??. Other status codes can be interpreted as follows:
o ' ' = unmodified
o M = modified
o A = added
o D = deleted
o R = renamed
o C = copied
o U = updated but unmerged
Ignored files are not listed, unless --ignored option is in effect, in which case XY are !!.
X Y Meaning
-------------------------------------------------
[MD] not updated
M [ MD] updated in index
A [ MD] added to index
D [ M] deleted from index
R [ MD] renamed in index
C [ MD] copied in index
[MARC] index and work tree matches
[ MARC] M work tree changed since index
[ MARC] D deleted in work tree
-------------------------------------------------
D D unmerged, both deleted
A U unmerged, added by us
U D unmerged, deleted by them
U A unmerged, added by them
D U unmerged, deleted by us
A A unmerged, both added
U U unmerged, both modified
-------------------------------------------------
? ? untracked
! ! ignored
-------------------------------------------------