Drone 2.0 - "New Build" button broken

Hi there

Nice work with the new UI.

I was especially delighted to see the “+ NEW BUILD” button. However it seems to be broken on my installation, it just gives me the error message: “Unable to start new build: Not Found”. Apparently the code tries to POST to /api/repos/<repo/path>/builds which returns a 404.

Is this a bug or just not working on my install?

Edit: Restarting a build works just fine.

I just tested the feature and was unable to reproduce. A 404 not found could indicate the named branch was not found, or it could indicate no .drone.yml exists at the specified branch. You might consider checking your drone logs (with debug mode enabled) for more details.

Huh interesting. I just reconfirmed it. Debug logs only show this:

DEBU[0190] api: root access granted                      name=HomeControl-Core namespace=Nicolas request-id=1q0klmMCLXp3Wn2rMgSzJzPcSRY user.admin=true user.login=Nicolas
DEBU[0190] api: root access granted                      name=HomeControl-Core namespace=Nicolas request-id=1q0klmMCLXp3Wn2rMgSzJzPcSRY user.admin=true user.login=Nicolas
DEBU[0190]                                               fields.time="2021-03-20T07:07:27Z" latency=228.356848ms method=POST remote="172.25.0.21:48920" request=/api/repos/Nicolas/HomeControl-Core/builds request-id=1q0klmMCLXp3Wn2rMgSzJzPcSRY

To give more context: I’m running drone with Gitea.

Edit: also tried with manually specifying branch:

DEBU[0500] api: root access granted                      name=HomeControl-Core namespace=Nicolas request-id=1q0lOozRP77LFFmUknLBhX8IvQ6 user.admin=true user.login=Nicolas
DEBU[0500] api: root access granted                      name=HomeControl-Core namespace=Nicolas request-id=1q0lOozRP77LFFmUknLBhX8IvQ6 user.admin=true user.login=Nicolas
DEBU[0501]                                               fields.time="2021-03-20T07:12:38Z" latency=237.453835ms method=POST remote="172.25.0.21:49334" request="/api/repos/Nicolas/HomeControl-Core/builds?branch=master" request-id=1q0lOozRP77LFFmUknLBhX8IvQ6

I did some further debugging. Calling the api with a commit specified works as expected but it doesn’t work without or with specifying a (existing) branch.

So looking a bit at the code, I assume the problem might either lie in this line here: drone/create.go at ef168cd2a4f52639a17333fe5a421bed78b35667 · drone/drone · GitHub or in this method here: drone/commit.go at ef168cd2a4f52639a17333fe5a421bed78b35667 · drone/drone · GitHub