Push Mirror sync_on_commit is not properly set in the database #9641

Closed
opened 2025-11-02 08:45:12 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @Elara6331 on GitHub (Oct 1, 2022).

Description

I was testing the sync on commit feature implemented in #19411, and noticed that it was acting strangely.

I tried to add a mirror and checked the new "Sync when commits are pushed" checkbox. The mirror was added, and was able to synchronize when I pressed the "Synchronize Now" button. However, when I pushed a commit, it didn't synchronize.

This prompted me to look in the database and see if the sync_on_commit field was properly set. I noticed that it was in fact set to false, despite me checking the checkbox. I tried adding mirrors with the box checked and unchecked. In both cases, sync_on_commit was set to false. The mirror only started syncing on commit when I manually set the field to true.

Another issue I noticed is that all existing push mirrors that were there before switching to the dev version had sync_on_commit set to true. This is a problem because not everyone wants to sync their mirrors on commit.


try.gitea.io repos used to reproduce this:

https://try.gitea.io/Arsen6331/Test

mirrored to:

https://try.gitea.io/Arsen6331/Test2

Gitea Version

1.18.0+dev-478-g08609d439

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Gitea is run by the Nomad orchestrator using Docker with the gitea/gitea:dev container. It is running behind a Traefik reverse proxy.

Database

SQLite

Originally created by @Elara6331 on GitHub (Oct 1, 2022). ### Description I was testing the sync on commit feature implemented in #19411, and noticed that it was acting strangely. I tried to add a mirror and checked the new "Sync when commits are pushed" checkbox. The mirror was added, and was able to synchronize when I pressed the "Synchronize Now" button. However, when I pushed a commit, it didn't synchronize. This prompted me to look in the database and see if the `sync_on_commit` field was properly set. I noticed that it was in fact set to `false`, despite me checking the checkbox. I tried adding mirrors with the box checked and unchecked. In both cases, `sync_on_commit` was set to `false`. The mirror only started syncing on commit when I manually set the field to `true`. Another issue I noticed is that all existing push mirrors that were there before switching to the dev version had `sync_on_commit` set to `true`. This is a problem because not everyone wants to sync their mirrors on commit. --- try.gitea.io repos used to reproduce this: https://try.gitea.io/Arsen6331/Test mirrored to: https://try.gitea.io/Arsen6331/Test2 ### Gitea Version 1.18.0+dev-478-g08609d439 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Gitea is run by the Nomad orchestrator using Docker with the `gitea/gitea:dev` container. It is running behind a Traefik reverse proxy. ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 08:45:12 -06:00
Author
Owner

@harryzcy commented on GitHub (Oct 1, 2022):

For the second issue, it was discussed here that we set sync_on_commit by default for all prior push mirrors, because it won't have much negative performance impacts.

@harryzcy commented on GitHub (Oct 1, 2022): For the second issue, it was discussed [here](https://github.com/go-gitea/gitea/pull/19411#discussion_r914238588) that we set `sync_on_commit` by default for all prior push mirrors, because it won't have much negative performance impacts.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9641