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

Editing Repositories via API ignores default_merge_style #18773

Closed
ghost opened this issue Feb 15, 2022 · 2 comments · Fixed by #21130
Closed

Editing Repositories via API ignores default_merge_style #18773

ghost opened this issue Feb 15, 2022 · 2 comments · Fixed by #21130
Labels
modifies/api This PR adds API routes or modifies them type/bug

Comments

@ghost
Copy link

ghost commented Feb 15, 2022

Gitea Version

1.16.1

Git Version

No response

Operating System

No response

How are you running Gitea?

Using the Linux x64 binaries from the releases page.

Database

No response

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Description

When editing repos via the API, the value of default_merge_style is ignored.

Querying the API with curl/jq before the change:

$ export GITEA_ACCESS_TOKEN=[...]
$ curl -s -H "Authorization: token $GITEA_ACCESS_TOKEN" https://try.gitea.io/api/v1/repos/7CLfteiIYWtD/test | jq .default_merge_style
"merge"

Trying to change the setting via the API:

$ curl -s -H "Authorization: token $GITEA_ACCESS_TOKEN" -X PATCH -H 'Content-Type: application/json' -d '{"default_merge_style": "rebase"}' https://try.gitea.io/api/v1/repos/7CLfteiIYWtD/test | jq .default_merge_style
"merge"

This should have returned "rebase".

After changing the default merge style through the UI:

$ curl -s -H "Authorization: token $GITEA_ACCESS_TOKEN" https://try.gitea.io/api/v1/repos/7CLfteiIYWtD/test | jq .default_merge_style
"rebase"

Screenshots

No response

@noerw noerw added type/bug modifies/api This PR adds API routes or modifies them labels Mar 12, 2022
@noerw
Copy link
Member

noerw commented Mar 22, 2022

I'm pretty sure has the same cause as described in #19069 (comment)

@jolheiser
Copy link
Member

Parent issue #13622

6543 added a commit that referenced this issue Sep 27, 2022
This PR would presumably
Fix #20522
Fix #18773
Fix #19069
Fix #21077

Fix #13622

-----

1. Check whether unit type is currently enabled
2. Check if it _will_ be enabled via opt
3. Allow modification as necessary


Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
@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
modifies/api This PR adds API routes or modifies them type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants