smarkets / marge-bot

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

not unassigning itself if MR author #203

Closed micheelengronne closed 5 years ago

micheelengronne commented 5 years ago

Marge-bot will not unassign/reassign itself if it is the author.

Trying to solve https://github.com/smarkets/marge-bot/issues/189 and https://github.com/smarkets/marge-bot/issues/202

aschmolck commented 5 years ago

Looking at the code, it doesn't seem to me that this changes existing behavior, since the only place these functions should be called for is unassign_from_mr which looks as follows:

marge/job.py-    def unassign_from_mr(self, merge_request):
marge/job.py-        log.info('Unassigning from MR !%s', merge_request.iid)
marge/job.py-        author_id = merge_request.author_id
marge/job.py-        if author_id != self._user.id:
marge/job.py:            merge_request.assign_to(author_id)
marge/job.py-        else:
marge/job.py-            merge_request.unassign()

This also means I don't understand why the reassign spam is actually happening in the first place. Did I overlook something?

micheelengronne commented 5 years ago

The current patch does not seem to work. I am investigating.

micheelengronne commented 5 years ago

The problem is not assign/unassign but the fact that marge-bot does not check if a comment was already made for this build and this status. It should check that instead.

micheelengronne commented 5 years ago

I will write another PR.