push mirror sync_on_commit api call parameter not working #10299

Closed
opened 2025-11-02 09:03:36 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @blob42 on GitHub (Feb 19, 2023).

Originally assigned to: @sillyguodong on GitHub.

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

Originally created by @blob42 on GitHub (Feb 19, 2023). Originally assigned to: @sillyguodong on GitHub. ### 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
GiteaMirror added the type/bug label 2025-11-02 09:03:36 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10299