Setting allow_* options for repo not possible via API #9736

Closed
opened 2025-11-02 08:47:59 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @adamel on GitHub (Oct 25, 2022).

Description

When trying to change any of the allow_* options it does not have any effect. Changing for example external_tracker and has_issues settings work fine.

$ curl -s -X 'PATCH' "https://server/gitea/api/v1/repos/${org}/${repo}?access_token=${token}" \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{ "allow_merge_commits": false, "allow_rebase": false, "allow_rebase_explicit": false, "allow_squash_merge": false }' | jq | grep allow
  "allow_merge_commits": true,
  "allow_rebase": true,
  "allow_rebase_explicit": true,
  "allow_squash_merge": true,
$

Can not try to reproduce on demo site as it does not allow API access.

Gitea Version

1.17.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.31.1-2.el9.2

Operating System

AlmaLinux 9

How are you running Gitea?

Binary distribution, running directly from command line.

Database

MySQL

Originally created by @adamel on GitHub (Oct 25, 2022). ### Description When trying to change any of the allow_* options it does not have any effect. Changing for example `external_tracker` and `has_issues` settings work fine. ``` $ curl -s -X 'PATCH' "https://server/gitea/api/v1/repos/${org}/${repo}?access_token=${token}" \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "allow_merge_commits": false, "allow_rebase": false, "allow_rebase_explicit": false, "allow_squash_merge": false }' | jq | grep allow "allow_merge_commits": true, "allow_rebase": true, "allow_rebase_explicit": true, "allow_squash_merge": true, $ ``` Can not try to reproduce on demo site as it does not allow API access. ### Gitea Version 1.17.3 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version 2.31.1-2.el9.2 ### Operating System AlmaLinux 9 ### How are you running Gitea? Binary distribution, running directly from command line. ### Database MySQL
GiteaMirror added the type/bug label 2025-11-02 08:47:59 -06:00
Author
Owner

@jolheiser commented on GitHub (Oct 25, 2022):

This should be fixed by https://github.com/go-gitea/gitea/pull/21130

Essentially the problem is you still need to specify has_pull_requests or else the related settings are ignored. (prior to the above fix, which will be in 1.18+

@jolheiser commented on GitHub (Oct 25, 2022): This should be fixed by https://github.com/go-gitea/gitea/pull/21130 Essentially the problem is you still need to specify `has_pull_requests` or else the related settings are ignored. (prior to the above fix, which will be in `1.18+`
Author
Owner

@adamel commented on GitHub (Oct 25, 2022):

Yes, setting "has_pull_requests": true in the request works fine as a workaround in 1.17.3, thanks!

@adamel commented on GitHub (Oct 25, 2022): Yes, setting `"has_pull_requests": true` in the request works fine as a workaround in 1.17.3, thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9736