smarkets / marge-bot

A merge-bot for GitLab
BSD 3-Clause "New" or "Revised" License
700 stars 136 forks source link

Improve marge comment on push failure #234

Open bagage opened 5 years ago

bagage commented 5 years ago

When marge has not enough write access to a repository, she fails and had a comment I couldn't merge this branch: Failed to push rebased changes, check my logs!.

In the logs, one can see:

marge_1 | 2019-10-14 11:51:52,294 INFO Running git -C /tmpd22x27wg/tmpo0jqkj2e push --force source feat/new-option-button:feat/new-option-button marge_1 | 2019-10-14 11:51:52,593 WARNING git returned 128 marge_1 | 2019-10-14 11:51:52,593 WARNING stdout: b'' marge_1 | 2019-10-14 11:51:52,593 WARNING stderr: b'> GitLab: You are not allowed to push code to this project.\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n'

Could the message be improved to hint about permission issue?

alatiera commented 4 years ago

I wonder if this could also be turned into a check for the 'Allow maintainers to push to this MR' checkbox feature, since its off by default and its required in order to rebase an MR. Would it make sense? and where would I need to look if so.