Updating existing merge request with push options
Proposal
Creating merge requests with push options is great, but generates warnings when updating existing merge requests.
Consider common workflows such as dependency update merge requests, generated automatically. Once the repository is updated with the appropriate dependency changes (pom.xml, requirements.txt, etc.) generating a merge request can be done via the API or more simply with a
git add pom.xml
git commit -m ':arrow_up: Automated Maven dependencies upgrade'
git push -o merge_request.create \
-o merge_request.remove_source_branch \
-o merge_request.title=':arrow_up: Automated Maven dependencies upgrade' \
-o merge_request.label='dependency-management' \
-o merge_request.assign="$DUPDATE_MR_ASSIGNEE" \
--force origin HEAD:"refs/heads/$DUPDATE_BRANCH_NAME"
This works the very first time (when creating a branch) but after this will merely push to the branch (which still is the appropriate thing!) while emitting a warning:
remote: ========================================================================
remote:
remote: WARNINGS: Error encountered with push options
remote: 'merge_request.create' 'merge_request.remove_source_branch'
remote: 'merge_request.title=:arrow_up: Automated Maven dependencies
remote: upgrade' 'merge_request.label=dependency-management'
remote: 'merge_request.assign=150': An unknown error occurred
remote:
remote: ========================================================================
Different push options could lead to other, better behaviors, e.g. -o merge_request.update
could at least silence the warning, or hopefully find the merge request if possible (same source and target branch) and update it with the new settings (label, assignee, ...).