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

push mirror sync_on_commit api call parameter not working #22990

Closed
blob42 opened this issue Feb 19, 2023 · 0 comments · Fixed by #23088
Closed

push mirror sync_on_commit api call parameter not working #22990

blob42 opened this issue Feb 19, 2023 · 0 comments · Fixed by #23088
Assignees
Labels
Milestone

Comments

@blob42
Copy link

blob42 commented Feb 19, 2023

Description

I am trying to add a push mirror using the push_mirrors api endpoint but the sync_on_commit parameter is not taken into account. The reply returns sync_on_commit: false every time.

However manually enabling the option the UI works ! I tested by manually adding a push mirror on the UI then making a commit+push which produces a sync. The problem is only on the Gitea API's side with the json field parameter.

I am sure there is no issue with my query, it's clean json data, the push mirror api endpoint adds the mirrors that I specify but does not want to enable the sync_on_commit parameter. The rest works including the interval one.

I tried dev run mode and debug logging there is no error. The query runs fine.

I don't have time to dig into the code but it looks like the endpoint simply does not handle the json field sync_on_commit

Gitea Version

1.18.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

there is no error in the log just a successful API post query to push mirrors

Screenshots

No response

Git Version

2.36.4, Wire Protocol Version 2 Enabled

Operating System

Linux Debian

How are you running Gitea?

Self hosted at https://git.blob42.xyz

Database

SQLite

@sillyguodong sillyguodong self-assigned this Feb 23, 2023
jolheiser pushed a commit that referenced this issue Feb 23, 2023
Fix: #22990

---
Before, the return value of the api is always false,regrardless of
whether the entry of `sync_on_commit` is true or false.
I have confirmed that the value of `sync_on_commit` dropped into the
database is correct.
So, I think it is enough to make some small changes.
yardenshoham pushed a commit to yardenshoham/gitea that referenced this issue Feb 23, 2023
…#23088)

Fix: go-gitea#22990

---
Before, the return value of the api is always false,regrardless of
whether the entry of `sync_on_commit` is true or false.
I have confirmed that the value of `sync_on_commit` dropped into the
database is correct.
So, I think it is enough to make some small changes.
@lunny lunny added this to the 1.19.0 milestone Feb 24, 2023
lunny added a commit that referenced this issue Feb 24, 2023
…23100)

Backport #23088

Fix: #22990

---
Before, the return value of the api is always false,regrardless of
whether the entry of `sync_on_commit` is true or false.
I have confirmed that the value of `sync_on_commit` dropped into the
database is correct.
So, I think it is enough to make some small changes.

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
@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

Successfully merging a pull request may close this issue.

3 participants