Skip to content

Add option to create MR in secpick

Albert requested to merge alberts-auto-create-backport-mr-in-secpick into master

What does this MR do and why?

Add option to create merge request in bin/secpick using option -mr to save time doing repetitive tasks.

Example: bin/secpick -v 15.6 --mr

This will automatically create the backport merge request targeting the right stable branch 15-6-stable-ee and setting the right milestone 15.6.

Screenshots or screen recordings

Screenshot_2023-01-04_at_3.12.07_PM

Dry run output:

❱ bin/secpick -d -v 15.7 --mr

Git commands:
git fetch security 15-7-stable-ee
git checkout -B security-alberts-auto-create-backport-mr-in-secpick-15-7 security/15-7-stable-ee --no-track
git cherry-pick 3c3d86390749a4bf8f06b3297961acb2299b4b52
git push security security-alberts-auto-create-backport-mr-in-secpick-15-7 --no-verify -o mr.create -o mr.target='15-7-stable-ee' -o mr.description='Please apply Security Release template. /milestone %15.7'
git checkout alberts-auto-create-backport-mr-in-secpick

Merge request params:
{:issuable_template=>"Security Release",
 :merge_request=>
  {:source_branch=>"security-alberts-auto-create-backport-mr-in-secpick-15-7",
   :target_branch=>"15-7-stable-ee"}}

❱ bin/secpick -d -v 15.7 

Git commands:
git fetch security 15-7-stable-ee
git checkout -B security-alberts-auto-create-backport-mr-in-secpick-15-7 security/15-7-stable-ee --no-track
git cherry-pick 3c3d86390749a4bf8f06b3297961acb2299b4b52
git push security security-alberts-auto-create-backport-mr-in-secpick-15-7 --no-verify
git checkout alberts-auto-create-backport-mr-in-secpick

Merge request URL:
https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/new

Merge request params:
{:issuable_template=>"Security Release",
 :merge_request=>
  {:source_branch=>"security-alberts-auto-create-backport-mr-in-secpick-15-7",
   :target_branch=>"15-7-stable-ee"}}
❱ bin/secpick -h
Usage: bin/secpick [options]
    -v, --version 10.0               Version
    -b, --branch security-fix-branch Original branch name (optional, defaults to current)
    -s, --sha abcd                   SHA or SHA range to cherry pick (optional, defaults to current)
    -r, --remote dev                 Git remote name of security repo (optional, defaults to `security`)
        --mr, --merge-request        Create relevant security Merge Request targeting the stable branch
    -d, --dry-run                    Only show Git commands, without calling them
    -h, --help                       Displays Help

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Lin Jen-Shin

Merge request reports