trac-hacks / trac-github

Trac - GitHub integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple notifications of the same commit

aaugustin opened this issue · comments

Under some circumstances, GitHub will repeatedly include the same commit in the webhook payload. This results in duplicate notifications in Trac. For instance, I've seen some tickets end up with 10 or more identical comments.

I think this might be trigged by merging a branch A into a branch B, then B back in A, then A in B, etc.

GitHub's docs say that each payload contains "the push and the commits it contained". It seems to me that a commit with a given hash can never be included in more than one push. But the same hash obviously shows up in several payloads.

As far as I can tell, this is a case of garbage in, garbage out. It's hard to qualify this as a bug in trac-github.

However, if someone understands how GitHub builds its webhook payloads, I'm all ears, and I'll try to work around this problem in trac-github.

Following this conversation: https://twitter.com/GitHubHelp/status/257211031074508801
I've set up a test repository and sent a (long) email to GitHub's support.

GitHub decided to close this issue and create a new one with the pull request. Oh well. See #3.

I got a (short) answer by GitHub's support.

They won't tell me what "distinct" does but they suggest I use it.