lab132 / buildbot-gitea

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

The arguments builders passed to GiteaStatusPush have been deprecated. Use generators instead #16

Closed lfdmn closed 3 years ago

lfdmn commented 3 years ago

Hi,

I'm trying to add a GiteaStatusPush and bump into this issue

Config:

c['services'].append(
    # Report status back to gitea, verbose flag enables verbose output in logging for debugging
    reporters.GiteaStatusPush(
        'http://127.0.0.1:3000', 
        "secret")
)

Error:

2021-03-09 16:36:03+0200 [-] Starting BuildMaster -- buildbot.version: 2.10.1
2021-03-09 16:36:03+0200 [-] Loading configuration from '/home/damien/ci/master/master.cfg'
2021-03-09 16:36:03+0200 [-] /home/damien/.local/lib/python3.6/site-packages/buildbot/reporters/http.py:53: buildbot.warnings.DeprecatedApiWarning: [2.9.0 and later] The arguments builders passed to GiteaStatusPush have been deprecated. Use generators instead
2021-03-09 16:36:03+0200 [-] Configuration Errors:
2021-03-09 16:36:03+0200 [-]   builders must be a list or None
2021-03-09 16:36:03+0200 [-] Halting master.
2021-03-09 16:36:03+0200 [-] BuildMaster startup failed
2021-03-09 16:36:03+0200 [-] BuildMaster is stopped
2021-03-09 16:36:03+0200 [-] Main loop terminated.
2021-03-09 16:36:03+0200 [-] Server Shut Down.

Does this ring a bell?

Any tips how I could debug this?

Installation from pip, version 1.2.4.

Thanks, -Damien

pampersrocker commented 3 years ago

Might be related to #13

mrstanwell commented 3 years ago

@lfdmn Yeah, buildbot-gitea won't work with buildbot 2.9 or greater without the PR I submitted at #13. And, I'm not even sure it'll work with 2.10... It might, with deprecation warnings, but I haven't tried it yet. I'm running buildbot 2.9.4 with the buildbot-gitea plugin from #13.

lfdmn commented 3 years ago

I'll give it a shot tonight and let you know =)

I just saw a new builbot release from yesterday https://github.com/buildbot/buildbot/releases/tag/v3.0.0

lfdmn commented 3 years ago

OK that helped to suppress the config error.

Now each time I build occurs I get this error:

[HTTP11ClientProtocol,client] Could not send status "success" for damien@localhost:testorg/project1.git at ae0c9f1c63340695913d2b2ef1ecba011072b318: 404 : Not Found

I added some more prints.

The post URL looks correct:

/api/v1/repos/testorg/project1/statuses/ae0c9f1c63340695913d2b2ef1ecba011072b318

And payload too:

{'state': 'success', 'description': 'Build done.', 'target_url': 'http://localhost:8010/#builders/4/builds/16', 'context': 'buildbot/project1-builder'}

Looking at the gitea logs I see the error too

2021/03/09 18:15:49 Started POST /api/v1/repos/testorg/project1/statuses/ae0c9f1c63340695913d2b2ef1ecba011072b318 for 127.0.0.1
2021/03/09 18:15:49 Completed POST /api/v1/repos/testorg/project1/statuses/ae0c9f1c63340695913d2b2ef1ecba011072b318 404 Not Found in 1.240032ms

And I can view the commit at http://localhost:3000/testorg/project1/commit/ae0c9f1c63340695913d2b2ef1ecba011072b318.

I'm set the hook on the organization where I have some test repositories so they all inherit the hook.

Do I understand correctly that the secret in

c['services'] = [
    reporters.GiteaStatusPush(
        'http://127.0.0.1:3000', 
        "blablabla",
        verbose=True
    )
]

is the same than the one defined in the webhooks?

lfdmn commented 3 years ago

Got it finally. I to generate to generate an application token =)

So I can confirm https://github.com/lab132/buildbot-gitea/pull/13 works with 2.10.1

mrstanwell commented 3 years ago

Good to hear!