Skip to content

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

@adamel

Description

@adamel

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

Activity

jolheiser

jolheiser commented on Oct 25, 2022

@jolheiser
Member

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

adamel commented on Oct 25, 2022

@adamel
Author

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

locked and limited conversation to collaborators on May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @adamel@jolheiser

        Issue actions

          Setting allow_* options for repo not possible via API · Issue #21591 · go-gitea/gitea