API responds with 201 before the created resource is ready #13522

Closed
opened 2025-11-02 10:45:01 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @semyonf on GitHub (Sep 23, 2024).

Description

I'm creating and merging Pull Requests using Gitea's REST API, and sometimes it responds with HTTP 405 unless I include a delay between the API calls. Can you please make it respond with 201 only after the created resource is actually ready?

Gitea Version

1.22.1

Can you reproduce the bug on the Gitea demo site?

No, my network is slow and it acts like a delay by itself

How are you running Gitea?

Locally, in Docker

Database

MySQL/MariaDB

Originally created by @semyonf on GitHub (Sep 23, 2024). ### Description I'm creating and merging Pull Requests using Gitea's REST API, and sometimes it responds with HTTP 405 unless I include a delay between the API calls. Can you please make it respond with 201 only after the created resource is actually ready? ### Gitea Version 1.22.1 ### Can you reproduce the bug on the Gitea demo site? No, my network is slow and it acts like a delay by itself ### How are you running Gitea? Locally, in Docker ### Database MySQL/MariaDB
GiteaMirror added the topic/apitype/bug labels 2025-11-02 10:45:01 -06:00
Author
Owner

@yp05327 commented on GitHub (Sep 24, 2024):

What is the description of 405? I guess it maybe something like PR not in mergeable state, Please try again later.
For each PR, a mergeable test will be run automatically, and this is a backend queue task.
So I guess the issue you met is: the PR is created but mergeable test is still running, so you can not merge it immediately until the test is finished.

@yp05327 commented on GitHub (Sep 24, 2024): What is the description of 405? I guess it maybe something like `PR not in mergeable state`, `Please try again later`. For each PR, a mergeable test will be run automatically, and this is a backend queue task. So I guess the issue you met is: the PR is created but mergeable test is still running, so you can not merge it immediately until the test is finished.
Author
Owner

@semyonf commented on GitHub (Sep 24, 2024):

Yes it does say to try later, I guess it makes sense that the test has to run asynchronously, PRs can be quite large after all...

@semyonf commented on GitHub (Sep 24, 2024): Yes it does say to try later, I guess it makes sense that the test has to run asynchronously, PRs can be quite large after all...
Author
Owner

@yp05327 commented on GitHub (Sep 24, 2024):

Do you have any more questions?
I think this issue can be closed, as the delay is necessary.

@yp05327 commented on GitHub (Sep 24, 2024): Do you have any more questions? I think this issue can be closed, as the delay is necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13522