-
Notifications
You must be signed in to change notification settings - Fork 21
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
branch
attribute of change incorrectly set to base branch and not head branch
#43
Comments
I think we are experiencing a similar problem in our own case at the moment, as a PR request also triggers a build on the main branch on our own setup. |
I'll open a PR with the changes that fixed it for me, can you test if it helps you too? but also we have # build all pull requests
schedulers.SingleBranchScheduler(
name=f"{project.project_id}-prs",
change_filter=util.ChangeFilter(
repository=project.url,
category="pull",
),
builderNames=[f"{project.name}/nix-eval"],
),
schedulers.SingleBranchScheduler(
name=f"{project.project_id}-default-branch",
change_filter=util.ChangeFilter(
repository=project.url,
filter_fn=lambda c: c.branch == project.default_branch,
),
builderNames=[f"{project.name}/nix-eval"],
treeStableTimer=5,
), we did not experience duplicate build, Gitea sends two webhooks for each PR push, so I think that's discarding one of them. We were only seeing the one incorrectly attributed to |
There has been some discussion on this on this PR: #21 it's been some time, but the in-between fork stuff etc is a bit and gitea is also a bit different than github in that regard (at least it was, not sure if that has changed in the meantime) |
For us it works mostly, except for the branch property being incorrect, which is why I didn't notice. But our code is a bit ❇️ special ❇️ |
While working on https://github.com/nix-community/buildbot-nix I've noticed that al PR changes are considered as changes to master branch, which differs from what the upstream GitHub upstream webhook handler does, see the attached screenshots:
I think the problem is here, because the
branch
attribute of the change is set tobase["branch"]
when I think it should behead["branch"]
.https://github.com/lab132/buildbot-gitea/blob/master/buildbot_gitea/webhook.py#L102
The text was updated successfully, but these errors were encountered: