Open minwoox opened 4 months ago
Hello @minwoox, I would like to take this issue, but still confused. Could you give me an example of what is expected and the current status, so I can try to reproduce it?
Say, there is Git repository A
mirrored to Central Dogma repository B
.
The content of A
and B
should be the same except for mirror_state.json
. If some content is pushed to B
repository, it should be overwritten by the content of A
.
Currently, the changes pushed to B
do not update mirror_state.json
so the head revision comparison can't detect new commits in B
.
We may solve the problem by storing the latest revision of B
mirrored to mirror_state.json
.
Thanks @ikhoon, I will try
When a commit is pushed to a mirrored repository, the expectation is that any changes made by users are overwritten during the next mirroring process. However, this is not happening as expected. The root cause lies in Central Dogma's limited check, which solely examines the stored local revision—unchanged by the user's commit—against the remote head. https://github.com/line/centraldogma/blob/03540a1aee5ac7ee24c4b78ae04336706190ed74/server-mirror-git/src/main/java/com/linecorp/centraldogma/server/internal/mirror/AbstractGitMirror.java#L356