From aef5cc266a54e9438b883248cb4cf1c60c7712b2 Mon Sep 17 00:00:00 2001 From: Reuben Pereira <2967854-rpereira2@users.noreply.gitlab.com> Date: Tue, 1 Mar 2022 13:49:37 +0000 Subject: [PATCH] Manually merge MR when syncing security with canonical When we need to manually sync security with canonical, don't merge an MR into security master, since MRs on security are forced to have squash commits turned on. Squashing commits hides commits in the history. We want all canonical commits to be visible in security master. --- .../how_to_sync_security_with_canonical.md | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/general/security/how_to_sync_security_with_canonical.md b/general/security/how_to_sync_security_with_canonical.md index b3946a00..5cae3adc 100644 --- a/general/security/how_to_sync_security_with_canonical.md +++ b/general/security/how_to_sync_security_with_canonical.md @@ -22,44 +22,53 @@ Use this option in case of a merge-train failure due to conflicts. 1. Clone the GitLab repository: -```ssh +```shell git clone git@gitlab.com:gitlab-org/gitlab.git # This may take some time ``` 2. Add the security remote: -```ssh +```shell git add remote security git@gitlab.com:gitlab-org/security/gitlab.git ``` 3. Fetch the content from both remotes: -```ssh +```shell git fetch origin git fetch security ``` 4. Create a branch from `security/master` -```ssh +```shell git checkout master --track security/master git checkout -b sync-security-with-canonical ``` 5. Merge `origin/master` into your branch, at this point conflicts will need to be resolved -```ssh -git merge origin/master` +```shell +git merge origin/master ``` 6. Push the changes into `security` (**be careful of not pushing the changes to Canonical**) -```ssh +```shell git push security sync-security-with-canonical ``` -7. Create a merge request and assign it to your release manager counterpart for approval, then set MWPS. +7. Create a merge request and assign it to your release manager counterpart for approval. + +8. Merge the MR manually into _security_ master. We merge manually since MRs on `gitlab-org/security/gitlab` +are forced to have squash commits turned on, and this hides the commit history that we are merging into security master. +We want all canonical commits to be visible on security master. +```shell +git checkout master +git merge security/sync-security-with-canonical +git push security master +``` After these steps, upcoming merge train jobs shouldn't fail anymore. -- GitLab