400 error when merge proposal already registered
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
git-ubuntu |
Triaged
|
Medium
|
Unassigned |
Bug Description
Steps to reproduce:
1. File an MP via the submit subcommand, e.g.:
git ubuntu submit \
--reviewer canonical-server \
--reviewer canonical-
--reviewer canonical-
--reviewer canonical-
2. Repeat same command as in step #1
3. Full HTTP 400 error response is printed:
05/09/2023 00:17:20 - ERROR:Unable to create merge proposal: HTTP Error 400: Bad Request
Response headers:
---
-content-encoding: gzip
connection: close
content-length: 177
content-
content-type: text/plain;
date: Tue, 09 May 2023 07:17:20 GMT
server: gunicorn
status: 400
strict-
vary: Accept,
x-content-
x-frame-options: SAMEORIGIN
x-launchpad-
x-lazr-
x-powered-by: Zope (www.zope.org), Python (www.python.org)
x-request-id: 6b878a91-
x-vcs-revision: 90e2150bef31b41
x-xss-protection: 1; mode=block
---
Response body:
---
b'There is already a branch merge proposal registered for branch ~bryce/
---
4. Try again with the --force option, but it just prints the same.
I'm guessing this is failing in the createMergeProp
# create MP
try:
mp = source_
except BadRequest as e:
return 1
This looks to me like it *should* handle the 400 error exception and only print the error message itself.
An obvious improvement would be to have it suggest using --force to overwrite the old MP, and then when --force is specified, to detect and remove any existing MP before creating this one.
tags: | added: submit |
Changed in git-ubuntu: | |
status: | New → Triaged |
importance: | Undecided → Medium |