Skip to content

pkg-merge-upstream-to-downstreams: Ensure the target branch exist

When pulling an update for a stable branch it should target a -updates or -security branch. However there's no guarantee that they exist, so the creaton of the merge may fail:

remote:              WARNINGS: Error encountered with push options
remote:       'merge_request.create' 'merge_request.remove_source_branch'
remote:              'merge_request.target=apertis/v2021-security'
remote:       'merge_request.title=Update from debian/buster-security for
remote:     apertis/v2021-security': Branch apertis/v2021-security does not
remote:                                  exist

To avoid that, ensure to push the target branch before creating the MR.

Unfortunately we can't simply use git push as the creation of protected branches is restricted to the Web UI and the API, so let's use the latter, even if it requires a bit of juggling.

Merge request reports