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

Move mirror_state.json under meta repository #860

Open
ikhoon opened this issue Jul 26, 2023 · 5 comments
Open

Move mirror_state.json under meta repository #860

ikhoon opened this issue Jul 26, 2023 · 5 comments
Labels

Comments

@ikhoon
Copy link
Contributor

ikhoon commented Jul 26, 2023

mirror_state.json is automatically created for Git mirror repositories and updated when new commits are found in the upstream repository while running mirroring tasks.

There is no problem when mirroring the entire repository, but if a specific path of a repository is mirrored, mirror_state.json can be updated by the changes not included in the path. As there is no change in the corresponding path, the new commit history would be unnecessary from users' point of view.

I propose to move mirror_state.json under the internal meta repository to keep users' repository clean when there are no changes in the actual content.

@ikhoon ikhoon added the defect label Jul 26, 2023
@ikhoon
Copy link
Contributor Author

ikhoon commented Jul 26, 2023

@ghkim3221 suggested an idea that filters out mirror_state.json from Watcher to mitigate the problem:

The issue might be hard to apply because many users already have their mirror_state.json in each repository. It may be a huge break.
As a simple workaround, how about not notifying Watchers if mirror_state.json is changed? More generally, we can introduce a filter to Watcher excluding files that trigger the notification.

@ikhoon ikhoon added this to the 0.61.6 milestone Jul 26, 2023
@minwoox
Copy link
Member

minwoox commented Jul 26, 2023

FYI:
One of the reasons that we store mirror_state.json in the repository is to guarantee atomicity in a simple way.

@0x1306e6d
Copy link
Contributor

Thank you!!!
May I try to send a PR?

@ikhoon
Copy link
Contributor Author

ikhoon commented Jul 26, 2023

May I try to send a PR?

There is a dependency on this feature. If mirror_state.json is migrated to meta, the file name of mirror_state.json should be changed to <mirror_id>_mirror_state.json to avoid conflicts with other mirrors. As mirror_id is an optional value, we need to fill mirror_id for all mirror configurations first.

I was implementing #838 (review) but haven't finished yet.

@ghkim3221 suggested an idea that filters out mirror_state.json from Watcher to mitigate the problem:

What do you think of sending a PR for this first? Otherwise, would you wait until #838 is merged?

@0x1306e6d
Copy link
Contributor

Oh, I was being ambiguous.

What do you think of sending a PR for this first?

This is what I also intended. Let me prepare!

@jrhee17 jrhee17 removed this from the 0.62.0 milestone Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants