maubot/gitlab

Pushing a rebase yields very large messages

Closed this issue · 3 comments

Hi!

I've been using this bot for a free software project (Whisperfish) for a while now. An annoyance I have, is when I rebase a branch against master, and then force-push. It yields messages like this

image

... where in fact only the last commit is "relevant" for the merge request, all the other commits are on master branch. It would be nice if somehow the GitLab bot notes that it's a force push with existing commits, and writes its notice like the GitHub bot does it:

image

FWIW, the bot should be receiving merge request events, but I don't think it currently handles them.

tulir commented

The GitHub bot's synchronize message actually just means some commits were pushed (not necessarily a rebase), but it's a different repo/fork, so github didn't tell anything about those commits, and the bot doesn't download the pull request to find out.

There's a separate thing where the github bot ignores commits that already exist in the same repo, but that comes directly from the webhook data (distinct boolean in the commit data). I'm not sure if gitlab webhooks have a similar feature

Is this something we should escalate to GitLab then? I did a quick Google, but didn't find something (in the 5 seconds I searched) related to "distinct" and "webhook" in their 35k issues.

Gitlab has a separate "merge request" webhook that would probably cover my own use case; I don't think it's handled at all in this bot though. I would alter Push Events to only work on master and use merge requests separately.

tulir commented

The new version will only show 5 last commits which should solve this. It's not possible to solve properly like GitHub because GitLab doesn't include any flag similar to distinct (https://gitlab.com/gitlab-org/gitlab/-/issues/30914 is the issue for that I think). Merge request webhooks should work already, but it's basically the same as issue webhooks.