Add support for configuring --target-branch in gitlab-housekeeper
What does this MR do and why?
The gitlab-housekeeper
is a tool for automatically creating merge requests for common housekeeping tasks.
This MR adds the ability to pass --target-branch
to gitlab-housekeeper
. This allows the gitlab-housekeeper
to create MRs in projects which don't use master
as the default branch. When we first implemented this we were only using it in gitlab-org/gitlab
so we hardcoded master
but now we make it configurable so it can be used elsewhere.
How to test
- Create a new branch from
master
calledsome-branch
- Create a commit with anything in the
some-branch
- Checkout this MR branch
- Add a new keep using the example in the README https://gitlab.com/gitlab-org/gitlab/-/tree/master/gems/gitlab-housekeeper#how-to-implement-a-keep
- Run the keep like:
bundle exec gitlab-housekeeper -k Keeps::PrettyUselessKeep -d --target-branch some-branch
- Checkout the branch it created
git checkout pretty-useless-keep-new_file1
- Confirm that it did indeed branch from
some-branch
by looking for your commit in the logsgit log -n 2
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.