Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
adamel opened this issue Oct 25, 2022 · 2 comments
Closed

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

adamel opened this issue Oct 25, 2022 · 2 comments
Labels

Comments

@adamel
Copy link

adamel commented 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

@jolheiser
Copy link
Member

jolheiser commented Oct 25, 2022

This should be fixed by #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+

@adamel
Copy link
Author

adamel commented Oct 25, 2022

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

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants