lab132 / buildbot-gitea

Buildbot plugin for integration with gitea.
MIT License
62 stars 21 forks source link

Could not send status, build has no repository_name property for Gitea. #19

Closed wzzrd closed 3 years ago

wzzrd commented 3 years ago

I'm getting this in my log file

Could not send status, build has no repository_name property for Gitea.

I'm struggling a bit as to where this property is supposed to be set.

Any chance I can get a pointer to a config snippet here?

pampersrocker commented 3 years ago

You probably need to setup a codebase generator to be able to identify the codebase: See http://docs.buildbot.net/latest/manual/configuration/global.html#cfg-codebaseGenerator

Note for gitea you need to use the ssh URLs for this to work: e.g.

all_repositories = {
    u'ssh://git@git.example.com/test/TestRepo.git': 'TestRepo',
}

def codebaseGenerator(chdict):
    return all_repositories.get(chdict['repository'])

c['codebaseGenerator'] = codebaseGenerator
wzzrd commented 3 years ago

Ah, that was very helpful. Thank you!

Changes through gitpoller are now tested and reported on back to gitea correctly. Took some effort to set that up.

My final struggle is with pull requests and pushes: they are pushed by gitea, and registered by buildbot, and then put into the database, but are not acted upon until gitpoller notices them. I'm not sure if this has even to do anything with buildbot-gitea, but feel free to nudge me in the right direction, if you have any ideas. Buildbot configuration is a tough thing to master...

pampersrocker commented 3 years ago

I've never used the gitpoller to detect changes. Instead I've used the webhook present in this project to get changes from gitea and trigger builds from those.

The pushed changes should be picked up by a Single or Any branch scheduler: http://docs.buildbot.net/2.9.3/manual/configuration/schedulers.html#scheduler-types

wzzrd commented 3 years ago

Man, you a proper bb guru!

Ok, took the gitpollers out. That, and some other changes in the change_filter make my buildbot setup build for pushes now. Almost there!

Single remaining issues (one more to go, I lied earlier ;)), is the bit where buildbot now tries to builds for pull requests, but fails. When I push to MYFORK/MYBRANCH, buildbot wants to build ORIGIN/MYBRANCH, which doesn't seem to exist.

You seem to know your way around buildbot, how do you handle that? Do you have a special change_filter, or a branch_fn that handles this? Or a separate scheduler? Or am I overthinking this? :)

pampersrocker commented 3 years ago

The PR build stuff was never fully tested by me, as it was no longer required by the time. It might be that there are issues with this, when creating a PR from forks and not a branch from the same repository.

I am a game developer, so forking is not something we do here (well, have fun forking a 100GB repo).

Does this issue happen as well when creating a PR from the same repository?

Can you post the git steps that are performed?

wzzrd commented 3 years ago

Quickly checked: a PR from a branch in the same repo does get built, so the problem seems to be with PRs from forks.

Does Gitea even allow pulling from pull requests from forks?

Anyway, I'll report on the steps tonight or tomorrow.

pampersrocker commented 3 years ago

In general, this seems to be a problem of the underlying git command, as all i'm doing is adding a different remote, setting it's url, fetch it and merge the branch. So, in theory this should work. The implementation is not complex as seen here: https://github.com/lab132/buildbot-gitea/blob/master/buildbot_gitea/step_source.py

mrstanwell commented 3 years ago

A fork is in reality a different repo altogether, and thus a different codebase. So I should think you either need different schedulers for different codebases, or some kind of ChangeFilter on an AnyBranchScheduler that would allow you to distinguish between branches on different forks... Maybe using a regex to filter repos (repository_re), or even codebases.

pampersrocker commented 3 years ago

A fork is in reality a different repo altogether, and thus a different codebase. So I should think you either need different schedulers for different codebases, or some kind of ChangeFilter on an AnyBranchScheduler that would allow you to distinguish between branches on different forks... Maybe using a regex to filter repos (repository_re)...

In theory it should be already supported when using the Gitea step_source as mentioned above, since this adds the fork repo as the pr_source remote. There should be no need for a different scheduler. This is about creating a PR into the repo we are building.

wzzrd commented 3 years ago

Ok, long logs to follow, hence in multiple comments.

First of all, my steps are really simple in this example:

testing_buildbot_factory= util.BuildFactory()
with testing_buildbot_factory.withSecrets(secret_list):
    testing_buildbot_factory.addStep(steps.Gitea(repourl='gitea@giteahost.example.com:prod/testing_buildbot.git', mode='full',
                                      codebase='testing_buildbot',
                                      sshPrivateKey=util.Secret("ssh_key"),
                                      sshKnownHosts=util.Secret("known_hosts")))
    testing_buildbot_factory.addStep(steps.ShellCommand(command=["bash", "./test.sh"],
                                               name="Run build script"))

Scheduler:

c['schedulers'].append(schedulers.SingleBranchScheduler(
                            name="testing_buildbot",
                            change_filter=util.ChangeFilter(branch_re=".*"),
                            codebases={'testing_buildbot': {}},
                            builderNames=["testing_buildbot_workers"]))

I'm quite new to buildbot, feel free to tell me I'm doing it wrong ;)

wzzrd commented 3 years ago

This is a pr from a feature branch in same repo, resulting in a success, using mode=full Two build because my config is currently building the pushed branch as well.


2021-03-28 23:17:45+0200 [-] Loading buildbot.tac...
2021-03-28 23:17:47+0200 [-] Loaded.
2021-03-28 23:17:47+0200 [-] twistd 21.2.0 (/opt/buildbot_master/venv/bin/python 3.9.2) starting up.
2021-03-28 23:17:47+0200 [-] reactor class: twisted.internet.epollreactor.EPollReactor.
2021-03-28 23:17:47+0200 [-] Starting BuildMaster -- buildbot.version: 3.0.2
2021-03-28 23:17:47+0200 [-] Loading configuration from '/var/lib/buildbot/master/cloudberry/master.cfg'
2021-03-28 23:17:48+0200 [-] Setting up database with URL 'postgresql://buildbot:xxxx@banana.localnet.lan:5432/buildbot'
2021-03-28 23:17:48+0200 [-] adding 1 new secretsProviders, removing 0
2021-03-28 23:17:48+0200 [-] adding 2 new services, removing 0
2021-03-28 23:17:48+0200 [-] adding 7 new builders, removing 0
2021-03-28 23:17:49+0200 [-] adding 5 new schedulers, removing 0
2021-03-28 23:17:49+0200 [-] initializing www plugin 'waterfall_view'
2021-03-28 23:17:49+0200 [-] initializing www plugin 'console_view'
2021-03-28 23:17:49+0200 [-] initializing www plugin 'grid_view'
2021-03-28 23:17:49+0200 [-] NOTE: www plugin 'badges' is installed but not configured
2021-03-28 23:17:49+0200 [-] initializing www plugin 'waterfall_view'
2021-03-28 23:17:49+0200 [-] initializing www plugin 'console_view'
2021-03-28 23:17:49+0200 [-] initializing www plugin 'grid_view'
2021-03-28 23:17:49+0200 [-] NOTE: www plugin 'badges' is installed but not configured
2021-03-28 23:17:49+0200 [-] BuildbotSite starting on 8010
2021-03-28 23:17:49+0200 [-] Starting factory <buildbot.www.service.BuildbotSite object at 0xffff9de6ca30>
2021-03-28 23:17:49+0200 [-] adding 4 new workers, removing 0
2021-03-28 23:17:49+0200 [-] PBServerFactory starting on 9989
2021-03-28 23:17:49+0200 [-] Starting factory <twisted.spread.pb.PBServerFactory object at 0xffff9de883a0>
2021-03-28 23:17:50+0200 [-] BuildMaster is running
2021-03-28 23:17:51+0200 [Broker,0,192.168.178.52] worker 'cloudberry' attaching from IPv4Address(type='TCP', host='192.168.178.52', port=41106)
2021-03-28 23:17:51+0200 [Broker,0,192.168.178.52] Got workerinfo from 'cloudberry'
2021-03-28 23:17:51+0200 [-] bot attached
2021-03-28 23:17:51+0200 [Broker,0,192.168.178.52] Worker cloudberry attached to testing_buildbot_workers
2021-03-28 23:17:51+0200 [Broker,0,192.168.178.52] Worker cloudberry attached to rust_workers_fedora_aarch64
2021-03-28 23:17:51+0200 [Broker,0,192.168.178.52] Worker cloudberry attached to buildbottest_workers
2021-03-28 23:17:51+0200 [Broker,0,192.168.178.52] Worker cloudberry attached to ansible_workers
2021-03-28 23:18:21+0200 [_GenericHTTPChannelProtocol,0,127.0.0.1] Received event 'push' from gitea
2021-03-28 23:18:21+0200 [-] change contains codebase testing_buildbot that is not processed by scheduler pbin
2021-03-28 23:18:21+0200 [-] change contains codebase testing_buildbot that is not processed by scheduler ansible_berries
2021-03-28 23:18:21+0200 [-] change contains codebase testing_buildbot that is not processed by scheduler buildbottest
2021-03-28 23:18:21+0200 [-] added change with revision cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6 to database
2021-03-28 23:18:21+0200 [-] injected change 121
2021-03-28 23:18:22+0200 [-] added buildset 56 to database
2021-03-28 23:18:22+0200 [-] starting build <Build testing_buildbot_workers number:None results:success> using worker <WorkerForBuilder builder='testing_buildbot_workers' worker='cloudberry' state=AVAILABLE>
2021-03-28 23:18:22+0200 [-] <Build testing_buildbot_workers number:None results:success>.startBuild
2021-03-28 23:18:22+0200 [-] acquireLocks(worker <Worker 'cloudberry'>, locks [])
2021-03-28 23:18:22+0200 [-] starting build <Build testing_buildbot_workers number:11 results:success>.. pinging the worker <WorkerForBuilder builder='testing_buildbot_workers' worker='cloudberry' state=BUILDING>
2021-03-28 23:18:22+0200 [-] sending ping
2021-03-28 23:18:22+0200 [Broker,0,192.168.178.52] ping finished: success
2021-03-28 23:18:22+0200 [-] <RemoteCommand 'downloadFile' at 281473305662080>: RemoteCommand.run [0]
2021-03-28 23:18:22+0200 [Broker,0,192.168.178.52] <RemoteCommand 'downloadFile' at 281473305662080> rc=0
2021-03-28 23:18:22+0200 [-] <RemoteCommand 'downloadFile' at 281473304988688>: RemoteCommand.run [1]
2021-03-28 23:18:23+0200 [Broker,0,192.168.178.52] <RemoteCommand 'downloadFile' at 281473304988688> rc=0
2021-03-28 23:18:23+0200 [-] releaseLocks(DownloadSecretsToWorker([('/var/lib/buildbot/worker/vault_pw.txt', Interpolate('%(secret:vault_pw)s')), ('/var/lib/buildbot/worker/nexus_pw.txt', Interpolate('%(secret:nexus_pw)s'))])): []
2021-03-28 23:18:23+0200 [-]  step 'generic' complete: success (None)
2021-03-28 23:18:23+0200 [-] Status "pending" sent for gitea@giteahost.example.com:prod/testing_buildbot.git at cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6.
2021-03-28 23:18:23+0200 [-] <RemoteShellCommand '['git', '--version']'>: RemoteCommand.run [2]
2021-03-28 23:18:23+0200 [-] command '['git', '--version']' in dir 'build'
2021-03-28 23:18:23+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', '--version']'> rc=0
2021-03-28 23:18:23+0200 [-] <RemoteCommand 'stat' at 281473305190208>: RemoteCommand.run [3]
2021-03-28 23:18:23+0200 [Broker,0,192.168.178.52] <RemoteCommand 'stat' at 281473305190208> rc=2
2021-03-28 23:18:23+0200 [-] <RemoteCommand 'mkdir' at 281473331069712>: RemoteCommand.run [4]
2021-03-28 23:18:23+0200 [Broker,0,192.168.178.52] <RemoteCommand 'mkdir' at 281473331069712> rc=0
2021-03-28 23:18:23+0200 [-] <RemoteCommand 'downloadFile' at 281473331011440>: RemoteCommand.run [5]
2021-03-28 23:18:23+0200 [Broker,0,192.168.178.52] <RemoteCommand 'downloadFile' at 281473331011440> rc=0
2021-03-28 23:18:23+0200 [-] <RemoteCommand 'downloadFile' at 281473305418528>: RemoteCommand.run [6]
2021-03-28 23:18:23+0200 [Broker,0,192.168.178.52] <RemoteCommand 'downloadFile' at 281473305418528> rc=0
2021-03-28 23:18:23+0200 [-] <RemoteCommand 'listdir' at 281473304719712>: RemoteCommand.run [7]
2021-03-28 23:18:23+0200 [Broker,0,192.168.178.52] <RemoteCommand 'listdir' at 281473304719712> rc=0
2021-03-28 23:18:23+0200 [-] <RemoteShellCommand '['git', 'clean', '-f', '-f', '-d', '-x']'>: RemoteCommand.run [8]
2021-03-28 23:18:23+0200 [-] command '['git', 'clean', '-f', '-f', '-d', '-x']' in dir 'build'
2021-03-28 23:18:23+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', 'clean', '-f', '-f', '-d', '-x']'> rc=0
2021-03-28 23:18:23+0200 [-] <RemoteShellCommand '['git', 'cat-file', '-e', 'cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6']'>: RemoteCommand.run [9]
2021-03-28 23:18:23+0200 [-] command '['git', 'cat-file', '-e', 'cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6']' in dir 'build'
2021-03-28 23:18:23+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', 'cat-file', '-e', 'cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6']'> rc=1
2021-03-28 23:18:23+0200 [-] <RemoteShellCommand '['git', '-c', 'core.sshCommand=ssh -o "BatchMode=yes" -i "/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-key" -o "UserKnownHostsFile=/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-known-hosts"', 'fetch', '-f', '-t', 'gitea@giteahost.example.com:prod/testing_buildbot.git', 'pr_from_branch_in_same_repo', '--progress']'>: RemoteCommand.run [10]
2021-03-28 23:18:23+0200 [-] command '['git', '-c', 'core.sshCommand=ssh -o "BatchMode=yes" -i "/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-key" -o "UserKnownHostsFile=/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-known-hosts"', 'fetch', '-f', '-t', 'gitea@giteahost.example.com:prod/testing_buildbot.git', 'pr_from_branch_in_same_repo', '--progress']' in dir 'build'
2021-03-28 23:18:25+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', '-c', 'core.sshCommand=ssh -o "BatchMode=yes" -i "/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-key" -o "UserKnownHostsFile=/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-known-hosts"', 'fetch', '-f', '-t', 'gitea@giteahost.example.com:prod/testing_buildbot.git', 'pr_from_branch_in_same_repo', '--progress']'> rc=0
2021-03-28 23:18:25+0200 [-] <RemoteShellCommand '['git', 'reset', '--hard', 'cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6', '--']'>: RemoteCommand.run [11]
2021-03-28 23:18:25+0200 [-] command '['git', 'reset', '--hard', 'cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6', '--']' in dir 'build'
2021-03-28 23:18:25+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', 'reset', '--hard', 'cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6', '--']'> rc=0
2021-03-28 23:18:25+0200 [-] <RemoteShellCommand '['git', 'checkout', '-B', 'pr_from_branch_in_same_repo']'>: RemoteCommand.run [12]
2021-03-28 23:18:25+0200 [-] command '['git', 'checkout', '-B', 'pr_from_branch_in_same_repo']' in dir 'build'
2021-03-28 23:18:25+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', 'checkout', '-B', 'pr_from_branch_in_same_repo']'> rc=0
2021-03-28 23:18:25+0200 [-] <RemoteShellCommand '['git', 'rev-parse', 'HEAD']'>: RemoteCommand.run [13]
2021-03-28 23:18:25+0200 [-] command '['git', 'rev-parse', 'HEAD']' in dir 'build'
2021-03-28 23:18:25+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', 'rev-parse', 'HEAD']'> rc=0
2021-03-28 23:18:25+0200 [-] Got Git revision cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6
2021-03-28 23:18:25+0200 [-] <RemoteCommand 'rmdir' at 281473304762544>: RemoteCommand.run [14]
2021-03-28 23:18:25+0200 [Broker,0,192.168.178.52] <RemoteCommand 'rmdir' at 281473304762544> rc=0
2021-03-28 23:18:25+0200 [-] releaseLocks(Gitea(repourl='gitea@giteahost.example.com:prod/testing_buildbot.git', mode='full', codebase='testing_buildbot', sshPrivateKey=Secret(ssh_key), sshKnownHosts=Secret(known_hosts))): []
2021-03-28 23:18:25+0200 [-]  step 'git-testing_buildbot' complete: success (None)
2021-03-28 23:18:26+0200 [-] <RemoteShellCommand '['bash', './test.sh']'>: RemoteCommand.run [15]
2021-03-28 23:18:26+0200 [-] command '['bash', './test.sh']' in dir 'build'
2021-03-28 23:18:26+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['bash', './test.sh']'> rc=0
2021-03-28 23:18:26+0200 [-] releaseLocks(ShellCommand(command=['bash', './test.sh'], name='Run build script')): []
2021-03-28 23:18:26+0200 [-]  step 'Run build script' complete: success (None)
2021-03-28 23:18:26+0200 [-] <RemoteCommand 'rmfile' at 281473304801968>: RemoteCommand.run [16]
2021-03-28 23:18:26+0200 [Broker,0,192.168.178.52] <RemoteCommand 'rmfile' at 281473304801968> rc=0
2021-03-28 23:18:26+0200 [-] <RemoteCommand 'rmfile' at 281473304791072>: RemoteCommand.run [17]
2021-03-28 23:18:26+0200 [Broker,0,192.168.178.52] <RemoteCommand 'rmfile' at 281473304791072> rc=0
2021-03-28 23:18:26+0200 [-] releaseLocks(RemoveWorkerFileSecret([('/var/lib/buildbot/worker/vault_pw.txt', Interpolate('%(secret:vault_pw)s')), ('/var/lib/buildbot/worker/nexus_pw.txt', Interpolate('%(secret:nexus_pw)s'))])): []
2021-03-28 23:18:26+0200 [-]  step 'generic_1' complete: success (None)
2021-03-28 23:18:26+0200 [-]  <Build testing_buildbot_workers number:11 results:success>: build finished
2021-03-28 23:18:26+0200 [-] releaseLocks(<Worker 'cloudberry'>): []
2021-03-28 23:18:27+0200 [-] sending mail (708 bytes) to ['prod@wzzrd.com', 'Maxim Burgerhout <maxim@wzzrd.com>']
2021-03-28 23:18:27+0200 [-] Starting factory <twisted.mail.smtp.ESMTPSenderFactory object at 0xffff9c53ae20>
2021-03-28 23:18:27+0200 [-] Stopping factory <twisted.mail.smtp.ESMTPSenderFactory object at 0xffff9c53ae20>
2021-03-28 23:18:27+0200 [-] Status "success" sent for gitea@giteahost.example.com:prod/testing_buildbot.git at cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6.
 2021-03-28 23:19:02+0200 [_GenericHTTPChannelProtocol,1,127.0.0.1] Received event 'pull_request' from gitea
2021-03-28 23:19:02+0200 [-] change contains codebase testing_buildbot that is not processed by scheduler pbin
2021-03-28 23:19:02+0200 [-] change contains codebase testing_buildbot that is not processed by scheduler ansible_berries
2021-03-28 23:19:02+0200 [-] change contains codebase testing_buildbot that is not processed by scheduler buildbottest
2021-03-28 23:19:02+0200 [-] added change with revision cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6 to database
2021-03-28 23:19:02+0200 [-] injected change 122
2021-03-28 23:19:02+0200 [-] added buildset 57 to database
2021-03-28 23:19:02+0200 [-] starting build <Build testing_buildbot_workers number:None results:success> using worker <WorkerForBuilder builder='testing_buildbot_workers' worker='cloudberry' state=AVAILABLE>
2021-03-28 23:19:02+0200 [-] <Build testing_buildbot_workers number:None results:success>.startBuild
2021-03-28 23:19:03+0200 [-] acquireLocks(worker <Worker 'cloudberry'>, locks [])
2021-03-28 23:19:03+0200 [-] starting build <Build testing_buildbot_workers number:12 results:success>.. pinging the worker <WorkerForBuilder builder='testing_buildbot_workers' worker='cloudberry' state=BUILDING>
2021-03-28 23:19:03+0200 [-] sending ping
2021-03-28 23:19:03+0200 [Broker,0,192.168.178.52] ping finished: success
2021-03-28 23:19:03+0200 [-] <RemoteCommand 'downloadFile' at 281473331086432>: RemoteCommand.run [18]
2021-03-28 23:19:03+0200 [Broker,0,192.168.178.52] <RemoteCommand 'downloadFile' at 281473331086432> rc=0
2021-03-28 23:19:03+0200 [-] <RemoteCommand 'downloadFile' at 281473305566608>: RemoteCommand.run [19]
2021-03-28 23:19:03+0200 [Broker,0,192.168.178.52] <RemoteCommand 'downloadFile' at 281473305566608> rc=0
2021-03-28 23:19:04+0200 [-] releaseLocks(DownloadSecretsToWorker([('/var/lib/buildbot/worker/vault_pw.txt', Interpolate('%(secret:vault_pw)s')), ('/var/lib/buildbot/worker/nexus_pw.txt', Interpolate('%(secret:nexus_pw)s'))])): []
2021-03-28 23:19:04+0200 [-] Status "pending" sent for gitea@giteahost.example.com:prod/testing_buildbot.git at cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6.
2021-03-28 23:19:04+0200 [-]  step 'generic' complete: success (None)
2021-03-28 23:19:04+0200 [-] <RemoteShellCommand '['git', '--version']'>: RemoteCommand.run [20]
2021-03-28 23:19:04+0200 [-] command '['git', '--version']' in dir 'build'
2021-03-28 23:19:04+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', '--version']'> rc=0
2021-03-28 23:19:04+0200 [-] <RemoteCommand 'stat' at 281473304947008>: RemoteCommand.run [21]
2021-03-28 23:19:04+0200 [Broker,0,192.168.178.52] <RemoteCommand 'stat' at 281473304947008> rc=2
2021-03-28 23:19:04+0200 [-] <RemoteCommand 'mkdir' at 281473305565360>: RemoteCommand.run [22]
2021-03-28 23:19:04+0200 [Broker,0,192.168.178.52] <RemoteCommand 'mkdir' at 281473305565360> rc=0
2021-03-28 23:19:04+0200 [-] <RemoteCommand 'downloadFile' at 281473339700800>: RemoteCommand.run [23]
2021-03-28 23:19:04+0200 [Broker,0,192.168.178.52] <RemoteCommand 'downloadFile' at 281473339700800> rc=0
2021-03-28 23:19:04+0200 [-] <RemoteCommand 'downloadFile' at 281473305665440>: RemoteCommand.run [24]
2021-03-28 23:19:04+0200 [Broker,0,192.168.178.52] <RemoteCommand 'downloadFile' at 281473305665440> rc=0
2021-03-28 23:19:04+0200 [-] <RemoteCommand 'listdir' at 281473331073232>: RemoteCommand.run [25]
2021-03-28 23:19:04+0200 [Broker,0,192.168.178.52] <RemoteCommand 'listdir' at 281473331073232> rc=0
2021-03-28 23:19:04+0200 [-] <RemoteShellCommand '['git', 'clean', '-f', '-f', '-d', '-x']'>: RemoteCommand.run [26]
2021-03-28 23:19:04+0200 [-] command '['git', 'clean', '-f', '-f', '-d', '-x']' in dir 'build'
2021-03-28 23:19:04+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', 'clean', '-f', '-f', '-d', '-x']'> rc=0
2021-03-28 23:19:04+0200 [-] <RemoteShellCommand '['git', 'cat-file', '-e', 'cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6']'>: RemoteCommand.run [27]
2021-03-28 23:19:04+0200 [-] command '['git', 'cat-file', '-e', 'cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6']' in dir 'build'
2021-03-28 23:19:04+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', 'cat-file', '-e', 'cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6']'> rc=0
2021-03-28 23:19:04+0200 [-] <RemoteShellCommand '['git', 'reset', '--hard', 'cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6', '--']'>: RemoteCommand.run [28]
2021-03-28 23:19:04+0200 [-] command '['git', 'reset', '--hard', 'cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6', '--']' in dir 'build'
2021-03-28 23:19:04+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', 'reset', '--hard', 'cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6', '--']'> rc=0
2021-03-28 23:19:04+0200 [-] <RemoteShellCommand '['git', 'checkout', '-B', 'pr_from_branch_in_same_repo']'>: RemoteCommand.run [29]
2021-03-28 23:19:04+0200 [-] command '['git', 'checkout', '-B', 'pr_from_branch_in_same_repo']' in dir 'build'
2021-03-28 23:19:04+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', 'checkout', '-B', 'pr_from_branch_in_same_repo']'> rc=0
2021-03-28 23:19:04+0200 [-] <RemoteShellCommand '['git', 'config', 'remote.pr_source.url']'>: RemoteCommand.run [30]
2021-03-28 23:19:04+0200 [-] command '['git', 'config', 'remote.pr_source.url']' in dir 'build'
2021-03-28 23:19:04+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', 'config', 'remote.pr_source.url']'> rc=0
2021-03-28 23:19:04+0200 [-] <RemoteShellCommand '['git', 'remote', 'set-url', 'pr_source', 'gitea@giteahost.example.com:prod/testing_buildbot.git']'>: RemoteCommand.run [31]
2021-03-28 23:19:04+0200 [-] command '['git', 'remote', 'set-url', 'pr_source', 'gitea@giteahost.example.com:prod/testing_buildbot.git']' in dir 'build'
2021-03-28 23:19:04+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', 'remote', 'set-url', 'pr_source', 'gitea@giteahost.example.com:prod/testing_buildbot.git']'> rc=0
2021-03-28 23:19:04+0200 [-] <RemoteShellCommand '['git', '-c', 'core.sshCommand=ssh -o "BatchMode=yes" -i "/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-key" -o "UserKnownHostsFile=/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-known-hosts"', 'fetch', 'pr_source']'>: RemoteCommand.run [32]
2021-03-28 23:19:04+0200 [-] command '['git', '-c', 'core.sshCommand=ssh -o "BatchMode=yes" -i "/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-key" -o "UserKnownHostsFile=/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-known-hosts"', 'fetch', 'pr_source']' in dir 'build'
2021-03-28 23:19:14+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', '-c', 'core.sshCommand=ssh -o "BatchMode=yes" -i "/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-key" -o "UserKnownHostsFile=/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-known-hosts"', 'fetch', 'pr_source']'> rc=0
2021-03-28 23:19:14+0200 [-] <RemoteShellCommand '['git', 'merge', 'cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6']'>: RemoteCommand.run [33]
2021-03-28 23:19:14+0200 [-] command '['git', 'merge', 'cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6']' in dir 'build'
2021-03-28 23:19:14+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', 'merge', 'cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6']'> rc=0
2021-03-28 23:19:14+0200 [-] <RemoteShellCommand '['git', 'rev-parse', 'HEAD']'>: RemoteCommand.run [34]
2021-03-28 23:19:14+0200 [-] command '['git', 'rev-parse', 'HEAD']' in dir 'build'
2021-03-28 23:19:14+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', 'rev-parse', 'HEAD']'> rc=0
2021-03-28 23:19:14+0200 [-] Got Git revision cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6
2021-03-28 23:19:14+0200 [-] <RemoteCommand 'rmdir' at 281473304803264>: RemoteCommand.run [35]
2021-03-28 23:19:14+0200 [Broker,0,192.168.178.52] <RemoteCommand 'rmdir' at 281473304803264> rc=0
2021-03-28 23:19:15+0200 [-] releaseLocks(Gitea(repourl='gitea@giteahost.example.com:prod/testing_buildbot.git', mode='full', codebase='testing_buildbot', sshPrivateKey=Secret(ssh_key), sshKnownHosts=Secret(known_hosts))): []
2021-03-28 23:19:15+0200 [-]  step 'git-testing_buildbot' complete: success (None)
2021-03-28 23:19:15+0200 [-] <RemoteShellCommand '['bash', './test.sh']'>: RemoteCommand.run [36]
2021-03-28 23:19:15+0200 [-] command '['bash', './test.sh']' in dir 'build'
2021-03-28 23:19:15+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['bash', './test.sh']'> rc=0
2021-03-28 23:19:15+0200 [-] releaseLocks(ShellCommand(command=['bash', './test.sh'], name='Run build script')): []
2021-03-28 23:19:15+0200 [-]  step 'Run build script' complete: success (None)
2021-03-28 23:19:15+0200 [-] <RemoteCommand 'rmfile' at 281473331006528>: RemoteCommand.run [37]
2021-03-28 23:19:15+0200 [Broker,0,192.168.178.52] <RemoteCommand 'rmfile' at 281473331006528> rc=0
2021-03-28 23:19:15+0200 [-] <RemoteCommand 'rmfile' at 281473339707200>: RemoteCommand.run [38]
2021-03-28 23:19:15+0200 [Broker,0,192.168.178.52] <RemoteCommand 'rmfile' at 281473339707200> rc=0
2021-03-28 23:19:15+0200 [-] releaseLocks(RemoveWorkerFileSecret([('/var/lib/buildbot/worker/vault_pw.txt', Interpolate('%(secret:vault_pw)s')), ('/var/lib/buildbot/worker/nexus_pw.txt', Interpolate('%(secret:nexus_pw)s'))])): []
2021-03-28 23:19:15+0200 [-]  step 'generic_1' complete: success (None)
2021-03-28 23:19:15+0200 [-]  <Build testing_buildbot_workers number:12 results:success>: build finished
2021-03-28 23:19:15+0200 [-] releaseLocks(<Worker 'cloudberry'>): []
2021-03-28 23:19:16+0200 [-] sending mail (708 bytes) to ['prod@wzzrd.com', 'Maxim Burgerhout <maxim@wzzrd.com>']
2021-03-28 23:19:16+0200 [-] Starting factory <twisted.mail.smtp.ESMTPSenderFactory object at 0xffff9c4e8400>
2021-03-28 23:19:16+0200 [-] Stopping factory <twisted.mail.smtp.ESMTPSenderFactory object at 0xffff9c4e8400>
2021-03-28 23:19:16+0200 [-] Status "success" sent for gitea@giteahost.example.com:prod/testing_buildbot.git at cd46a607863c8ef7715ef5fb7f9c7f4d97be82c6.
wzzrd commented 3 years ago

This is a pr from a feature branch in a fork, resulting in a failure, using mode=full

2021-03-28 23:15:28+0200 [-] Loading buildbot.tac...
2021-03-28 23:15:31+0200 [-] Loaded.
2021-03-28 23:15:31+0200 [-] twistd 21.2.0 (/opt/buildbot_master/venv/bin/python 3.9.2) starting up.
2021-03-28 23:15:31+0200 [-] reactor class: twisted.internet.epollreactor.EPollReactor.
2021-03-28 23:15:31+0200 [-] Starting BuildMaster -- buildbot.version: 3.0.2
2021-03-28 23:15:31+0200 [-] Loading configuration from '/var/lib/buildbot/master/cloudberry/master.cfg'
2021-03-28 23:15:32+0200 [-] Setting up database with URL 'postgresql://buildbot:xxxx@banana.localnet.lan:5432/buildbot'
2021-03-28 23:15:32+0200 [-] adding 1 new secretsProviders, removing 0
2021-03-28 23:15:32+0200 [-] adding 2 new services, removing 0
2021-03-28 23:15:32+0200 [-] adding 7 new builders, removing 0
2021-03-28 23:15:33+0200 [-] adding 5 new schedulers, removing 0
2021-03-28 23:15:33+0200 [-] initializing www plugin 'waterfall_view'
2021-03-28 23:15:33+0200 [-] initializing www plugin 'console_view'
2021-03-28 23:15:33+0200 [-] initializing www plugin 'grid_view'
2021-03-28 23:15:33+0200 [-] NOTE: www plugin 'badges' is installed but not configured
2021-03-28 23:15:33+0200 [-] initializing www plugin 'waterfall_view'
2021-03-28 23:15:33+0200 [-] initializing www plugin 'console_view'
2021-03-28 23:15:33+0200 [-] initializing www plugin 'grid_view'
2021-03-28 23:15:33+0200 [-] NOTE: www plugin 'badges' is installed but not configured
2021-03-28 23:15:33+0200 [-] BuildbotSite starting on 8010
2021-03-28 23:15:33+0200 [-] Starting factory <buildbot.www.service.BuildbotSite object at 0xffffa430f910>
2021-03-28 23:15:33+0200 [-] adding 4 new workers, removing 0
2021-03-28 23:15:33+0200 [-] PBServerFactory starting on 9989
2021-03-28 23:15:33+0200 [-] Starting factory <twisted.spread.pb.PBServerFactory object at 0xffffa42bc8b0>
2021-03-28 23:15:34+0200 [-] BuildMaster is running
2021-03-28 23:15:35+0200 [Broker,0,192.168.178.52] worker 'cloudberry' attaching from IPv4Address(type='TCP', host='192.168.178.52', port=41066)
2021-03-28 23:15:35+0200 [Broker,0,192.168.178.52] Got workerinfo from 'cloudberry'
2021-03-28 23:15:35+0200 [-] bot attached
2021-03-28 23:15:35+0200 [Broker,0,192.168.178.52] Worker cloudberry attached to testing_buildbot_workers
2021-03-28 23:15:35+0200 [Broker,0,192.168.178.52] Worker cloudberry attached to ansible_workers
2021-03-28 23:15:35+0200 [Broker,0,192.168.178.52] Worker cloudberry attached to buildbottest_workers
2021-03-28 23:15:35+0200 [Broker,0,192.168.178.52] Worker cloudberry attached to rust_workers_fedora_aarch64
2021-03-28 23:16:33+0200 [_GenericHTTPChannelProtocol,0,127.0.0.1] Received event 'pull_request' from gitea
2021-03-28 23:16:33+0200 [-] change contains codebase testing_buildbot that is not processed by scheduler ansible_berries
2021-03-28 23:16:33+0200 [-] change contains codebase testing_buildbot that is not processed by scheduler pbin
2021-03-28 23:16:33+0200 [-] change contains codebase testing_buildbot that is not processed by scheduler buildbottest
2021-03-28 23:16:33+0200 [-] added change with revision 33ce9e3f43c358c04464e342ee8596d0dda3e837 to database
2021-03-28 23:16:33+0200 [-] injected change 120
2021-03-28 23:16:34+0200 [-] added buildset 55 to database
2021-03-28 23:16:34+0200 [-] starting build <Build testing_buildbot_workers number:None results:success> using worker <WorkerForBuilder builder='testing_buildbot_workers' worker='cloudberry' state=AVAILABLE>
2021-03-28 23:16:34+0200 [-] <Build testing_buildbot_workers number:None results:success>.startBuild
2021-03-28 23:16:34+0200 [-] acquireLocks(worker <Worker 'cloudberry'>, locks [])
2021-03-28 23:16:34+0200 [-] starting build <Build testing_buildbot_workers number:10 results:success>.. pinging the worker <WorkerForBuilder builder='testing_buildbot_workers' worker='cloudberry' state=BUILDING>
2021-03-28 23:16:34+0200 [-] sending ping
2021-03-28 23:16:34+0200 [Broker,0,192.168.178.52] ping finished: success
2021-03-28 23:16:35+0200 [-] <RemoteCommand 'downloadFile' at 281473436261104>: RemoteCommand.run [0]
2021-03-28 23:16:35+0200 [Broker,0,192.168.178.52] <RemoteCommand 'downloadFile' at 281473436261104> rc=0
2021-03-28 23:16:35+0200 [-] <RemoteCommand 'downloadFile' at 281473436245296>: RemoteCommand.run [1]
2021-03-28 23:16:35+0200 [Broker,0,192.168.178.52] <RemoteCommand 'downloadFile' at 281473436245296> rc=0
2021-03-28 23:16:35+0200 [-] releaseLocks(DownloadSecretsToWorker([('/var/lib/buildbot/worker/vault_pw.txt', Interpolate('%(secret:vault_pw)s')), ('/var/lib/buildbot/worker/nexus_pw.txt', Interpolate('%(secret:nexus_pw)s'))])): []
2021-03-28 23:16:35+0200 [-]  step 'generic' complete: success (None)
2021-03-28 23:16:35+0200 [-] Status "pending" sent for gitea@giteahost.example.com:prod/testing_buildbot.git at 33ce9e3f43c358c04464e342ee8596d0dda3e837.
2021-03-28 23:16:35+0200 [-] <RemoteShellCommand '['git', '--version']'>: RemoteCommand.run [2]
2021-03-28 23:16:35+0200 [-] command '['git', '--version']' in dir 'build'
2021-03-28 23:16:35+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', '--version']'> rc=0
2021-03-28 23:16:35+0200 [-] <RemoteCommand 'stat' at 281473435521952>: RemoteCommand.run [3]
2021-03-28 23:16:35+0200 [Broker,0,192.168.178.52] <RemoteCommand 'stat' at 281473435521952> rc=2
2021-03-28 23:16:35+0200 [-] <RemoteCommand 'mkdir' at 281473436432320>: RemoteCommand.run [4]
2021-03-28 23:16:35+0200 [Broker,0,192.168.178.52] <RemoteCommand 'mkdir' at 281473436432320> rc=0
2021-03-28 23:16:35+0200 [-] <RemoteCommand 'downloadFile' at 281473435560544>: RemoteCommand.run [5]
2021-03-28 23:16:35+0200 [Broker,0,192.168.178.52] <RemoteCommand 'downloadFile' at 281473435560544> rc=0
2021-03-28 23:16:35+0200 [-] <RemoteCommand 'downloadFile' at 281473435561552>: RemoteCommand.run [6]
2021-03-28 23:16:35+0200 [Broker,0,192.168.178.52] <RemoteCommand 'downloadFile' at 281473435561552> rc=0
2021-03-28 23:16:35+0200 [-] <RemoteCommand 'listdir' at 281473436433424>: RemoteCommand.run [7]
2021-03-28 23:16:35+0200 [Broker,0,192.168.178.52] <RemoteCommand 'listdir' at 281473436433424> rc=0
2021-03-28 23:16:35+0200 [-] <RemoteShellCommand '['git', 'clean', '-f', '-f', '-d', '-x']'>: RemoteCommand.run [8]
2021-03-28 23:16:35+0200 [-] command '['git', 'clean', '-f', '-f', '-d', '-x']' in dir 'build'
2021-03-28 23:16:35+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', 'clean', '-f', '-f', '-d', '-x']'> rc=0
2021-03-28 23:16:35+0200 [-] <RemoteShellCommand '['git', 'cat-file', '-e', '33ce9e3f43c358c04464e342ee8596d0dda3e837']'>: RemoteCommand.run [9]
2021-03-28 23:16:35+0200 [-] command '['git', 'cat-file', '-e', '33ce9e3f43c358c04464e342ee8596d0dda3e837']' in dir 'build'
2021-03-28 23:16:35+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', 'cat-file', '-e', '33ce9e3f43c358c04464e342ee8596d0dda3e837']'> rc=1
2021-03-28 23:16:35+0200 [-] <RemoteShellCommand '['git', '-c', 'core.sshCommand=ssh -o "BatchMode=yes" -i "/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-key" -o "UserKnownHostsFile=/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-known-hosts"', 'fetch', '-f', '-t', 'gitea@giteahost.example.com:prod/testing_buildbot.git', 'pr_from_fork_branch', '--progress']'>: RemoteCommand.run [10]
2021-03-28 23:16:36+0200 [-] command '['git', '-c', 'core.sshCommand=ssh -o "BatchMode=yes" -i "/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-key" -o "UserKnownHostsFile=/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-known-hosts"', 'fetch', '-f', '-t', 'gitea@giteahost.example.com:prod/testing_buildbot.git', 'pr_from_fork_branch', '--progress']' in dir 'build'
2021-03-28 23:16:37+0200 [Broker,0,192.168.178.52] <RemoteShellCommand '['git', '-c', 'core.sshCommand=ssh -o "BatchMode=yes" -i "/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-key" -o "UserKnownHostsFile=/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-known-hosts"', 'fetch', '-f', '-t', 'gitea@giteahost.example.com:prod/testing_buildbot.git', 'pr_from_fork_branch', '--progress']'> rc=128
2021-03-28 23:16:37+0200 [-] Source step failed while running command <RemoteShellCommand '['git', '-c', 'core.sshCommand=ssh -o "BatchMode=yes" -i "/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-key" -o "UserKnownHostsFile=/var/lib/buildbot/worker/cloudberry/.testing_buildbot_workers.build.buildbot/ssh-known-hosts"', 'fetch', '-f', '-t', 'gitea@giteahost.example.com:prod/testing_buildbot.git', 'pr_from_fork_branch', '--progress']'>
2021-03-28 23:16:37+0200 [-] <RemoteCommand 'rmdir' at 281473435335024>: RemoteCommand.run [11]
2021-03-28 23:16:37+0200 [Broker,0,192.168.178.52] <RemoteCommand 'rmdir' at 281473435335024> rc=0
2021-03-28 23:16:38+0200 [-] releaseLocks(Gitea(repourl='gitea@giteahost.example.com:prod/testing_buildbot.git', mode='full', codebase='testing_buildbot', sshPrivateKey=Secret(ssh_key), sshKnownHosts=Secret(known_hosts))): []
2021-03-28 23:16:38+0200 [-]  step 'git-testing_buildbot' complete: failure (['update testing_buildbot (failure)'])
2021-03-28 23:16:38+0200 [-]  <Build testing_buildbot_workers number:10 results:failure>: build finished
2021-03-28 23:16:38+0200 [-] releaseLocks(<Worker 'cloudberry'>): []
2021-03-28 23:16:38+0200 [-] sending mail (745 bytes) to ['Maxim Burgerhout <maxim@wzzrd.com>', 'prod@wzzrd.com']
2021-03-28 23:16:38+0200 [-] Starting factory <twisted.mail.smtp.ESMTPSenderFactory object at 0xffffa4282f10>
2021-03-28 23:16:38+0200 [-] Stopping factory <twisted.mail.smtp.ESMTPSenderFactory object at 0xffffa4282f10>
2021-03-28 23:16:38+0200 [-] Status "failure" sent for gitea@giteahost.example.com:prod/testing_buildbot.git at 33ce9e3f43c358c04464e342ee8596d0dda3e837.
wzzrd commented 3 years ago

The changes page for the previous build shows the following properties:

{
  "base_branch": [
    "main",
    "Change"
  ],
  "base_git_ssh_url": [
    "gitea@giteahost.example.com:prod/testing_buildbot.git",
    "Change"
  ],
  "base_repo_id": [
    77,
    "Change"
  ],
  "base_repository": [
    "https://giteahost.example.com/gogs/prod/testing_buildbot.git",
    "Change"
  ],
  "base_sha": [
    "5965a895ced2550cb89a4fa6cdf4baad9a26424e",
    "Change"
  ],
  "event": [
    "pull_request",
    "Change"
  ],
  "head_branch": [
    "pr_from_fork_branch",
    "Change"
  ],
  "head_git_ssh_url": [
    "gitea@giteahost.example.com:wzzrd/testing_buildbot.git",
    "Change"
  ],
  "head_repo_id": [
    78,
    "Change"
  ],
  "head_repository": [
    "https://giteahost.example.com/gogs/wzzrd/testing_buildbot.git",
    "Change"
  ],
  "head_sha": [
    "33ce9e3f43c358c04464e342ee8596d0dda3e837",
    "Change"
  ],
  "owner": [
    "prod",
    "Change"
  ],
  "pr_id": [
    53,
    "Change"
  ],
  "pr_number": [
    5,
    "Change"
  ],
  "repository_name": [
    "testing_buildbot",
    "Change"
  ]
}
pampersrocker commented 3 years ago

Indeed you are correct, the pull request set the pr source branch and revision on the target repository.

I've reproduced this in a unit test and fixed it hopefully. (I currently do not have a buildbot setup with a pull request webhook setup)

Feel free to test v1.5.1 and report back.

See 341f216c2c265e5053d6870fec30decc982cec28 for the changes

wzzrd commented 3 years ago

Progress!! Fantastic!

A pull request from a branch in a fork is now successfully merged and built!

Some things are not quite right yet, though:

I am noticing that the StatusPush now results in a checkmark / yellow ball / red cross for the latest commit on main / master. In other words, the status ends up with the wrong commit.

For example, this is the commit of HEAD on main for my repo,

Status "success" sent for gitea@giteahost.example.com:prod/ansible_berries.git at ffba03d65b4c69ff0907f7bda6400186c02a84dc.

If a status push is sent for that commit, it's going to show up in the wrong place, I think?

What I am also seeing in my git history is:

commit 07143e42e93ec0d4d9296a30bf3bb9f0b54da1c4 (HEAD -> main, pr_source/buildbot_pip)
Merge: 9ecb1af ffba03d
Author: Maxim Burgerhout <maxim@wzzrd.com>
Date:   Mon Mar 29 12:25:03 2021 +0200

    Merge branch 'main' into buildbot_pip

But shouldn't that be the other way around? buildbot_pip merged into main? Not sure if that matters much, but it seems odd.

wzzrd commented 3 years ago

Sorry about that :/

pampersrocker commented 3 years ago

I am noticing that the StatusPush now results in a checkmark / yellow ball / red cross for the latest commit on main / master. In other words, the status ends up with the wrong commit.

I feared as much, buildbot only has a single "change" for such a pull request scenario. In order for it to work in the correct way, I set the base version as the actual change and piggy back the pull request data in the properties of the change. This way around it should be merged in the correct order, aka sitting on the base branch, merging in the pr branch.

I probably can adjust the webhook to recognize this pr commit change and set the status on the correct repo/branch/commit.

But shouldn't that be the other way around? buildbot_pip merged into main? Not sure if that matters much, but it seems odd.

Yeah, that's weird. As described above, it should be the other way around. Is this the commit the buildbot created ? Did you push the commit afterwards?

pampersrocker commented 3 years ago

There's the basic question, since this is a merge commit, that does not exist yet, where should the status be set? On the target branch? the source branch? Both?

pampersrocker commented 3 years ago

There's the basic question, since this is a merge commit, that does not exist yet, where should the status be set? On the target branch? the source branch? Both?

To answer my own question, it needs to be set on the source branch, since this is used by gitea to display a successful check on the PR itself. On the target branch it does not really make sense, since a PR onto a stable branch should not invalidate the existing status.

wzzrd commented 3 years ago

Yeah, I think that is correct. Sending a status on that would make that commit show up as checked, and by extension the PR. I think :)

pampersrocker commented 3 years ago

Sorry for the long delay, the status push for pull requests should be correct now with version v1.6.0