Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Same commit is pushed more than once on branch merging #1

Closed
ParthBarot-BoTreeConsulting opened this issue Feb 3, 2017 · 1 comment

Comments

@ParthBarot-BoTreeConsulting
Copy link
Collaborator

While merging branches in git, Github sends out the same commit notification again on push. As of now this is creating another comment for the same commit, just the branch name is different.

Steps to reproduce

  1. Create one branch, push small change into it with the message mentioned as per wiki - including the Redmine issue number.
  2. github will send a push notification to the webhook URL, and it should create a comment in the redmine issue.
  3. Now merge this branch into another branch on git, push again.
  4. Step 3 will be executed again, branch name would be different. And this will create another comment on the issue for same commit.

Approach

We have to keep track of the commit id/hash, so that when the same comment comes again from github we can restrict it.

Findings

  1. Journal is comment, it has has_many :journal_details, but storing this hash in this table would require a query which can check if the hash exists in this table, if not then only enter a new comment for the hash.
  2. We need to track the hash at issue level, so before inserting a new comment (journal) we can verify if that issue has already received this comment before?
ParthBarot-BoTreeConsulting added a commit that referenced this issue Feb 3, 2017
…cate) then only track it as a issue comment (Journal entry). This does not need to track anything in the Redmine issue/comment entries, so would not need an extra DB query.
@ParthBarot-BoTreeConsulting
Copy link
Collaborator Author

Has been fixed with the above commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant