mmueller / supybot-git

A Git plugin for Supybot (a Python IRC bot)
45 stars 24 forks source link

Sometimes goes haywire #10

Open CiaranG opened 11 years ago

CiaranG commented 11 years ago

Sometimes the bot goes haywire and repeatedly (each update cycle) posts the same commit. This has never happened to me before, but it occurred yesterday, and then again today.

I don't have any more info as yet (tips on exactly what would be useful to diagnose this would be welcome) but it seems to be related to merges.

Yesterday, deleting the local copy of the repo to force a full re-clone didn't help it just carried on repeating after that.

mmueller commented 11 years ago

I've seen this once before (only once) and yeah, it sounds branch-related. Do you have any information you can provide about the last few commits when the problem occurred? I just tried a simple branch & merge and didn't reproduce it, so it's more subtle than just that.

mmueller commented 11 years ago

It might also help to know your GitPython version. Thanks!

leamas commented 11 years ago

I think I can reproduce this, sort of. Basically, if the bot writes a log message and user quotes that line in yet another message, the bot repeats that message for some reason. An example:

[09:59:33] <al-bot-test> Alec Leamas pushed 1 commit(s) to origin/master at git-test2
[09:59:34] <al-bot-test>     0d6323d: Updating README #4
[09:59:35] <al-bot-test>     View: https://github.com/leamas/FedoraReview/commit/0d6323d
[10:00:10] <leamas|laptop> 0d6323d: Updating README #4
[10:00:10] <al-bot-test> Alec Leamas pushed 1 commit(s) to origin/master at git-test2
[10:00:11] <al-bot-test>     0d6323d: Updating README #4
[10:00:12] <al-bot-test>     View: https://github.com/leamas/FedoraReview/commit/0d6323d

Here, I pushed a test commit which the bot reported as expected in the first three lines (I have patched it to include a header). Then I copy-paste the commit line in a message. When doing so, the bot repeats the complete commit message, really unexpected. However, for me it stops here and does not enter any loop. This is using a test directory with just a 'master' branch. Versions:

$ rpm -q supybot
supybot-0.83.4.1-10.caa3612.fc18.noarch  # git post-release, more or less current)
 $ python --version
Python 2.7.3
$ rpm -q GitPython
GitPython-0.3.2-0.3.RC1.fc18.noarch

EDIT: It seems that it's mentioning the hash which triggers the bot:

10:31:23] <leamas|laptop> foobar
[10:31:34] <leamas|laptop> Updating README #4
[10:31:46] <leamas|laptop> 0d6323d
[10:31:46] <al-bot-test> Alec Leamas pushed 1 commit(s) to origin/master at git-test2
[10:31:47] <al-bot-test>     0d6323d: Updating README #4
[10:31:48] <al-bot-test>     View: https://github.com/leamas/FedoraReview/commit/0d6323d
CiaranG commented 11 years ago

The above doesn't sound like the same issue. When this happens to me, it a) requires no user interaction in the channel, and b) repeats forever, until a new commit is made (even if the bot is stopped and restarted).

I haven't managed to much more useful info as yet, but I can say it's always when there's a merge commit at the top (but not all merge commits, it's more subtle than that), and also that there are no branches (other than master) in the repo.

Forgot to add before - using gitpython from debian stable repo... ii python-git 0.1.6-1 Python library to interact with Git repositories

leamas commented 11 years ago

Perhaps it should have been a separate issue, agreed. let me know if I should start a new issue instead of commenting here.

mmueller commented 11 years ago

leamas: That's actually a feature, heh. If you say a SHA (minimum 6 characters of it) in the channel, the bot will post the commit you were talking about. It was recently pointed out to me that this is confusing (see #12) and there's currently no way to disable it (but there probably should be).

mmueller commented 11 years ago

Mentioned wrong issue in that commit message. This bug is still open and waiting for someone to discover how to reproduce it.