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

Don't remove all mirror repository's releases when mirroring (#28817) #28939

Merged
merged 3 commits into from
Jan 31, 2024

Commits on Jan 26, 2024

  1. Don't remove all mirror repository's releases when mirroring (go-gite…

    …a#28817)
    
    Fix go-gitea#22066
    
    # Purpose
    
    This PR fix the releases will be deleted when mirror repository sync the
    tags.
    
    # The problem
    
    In the previous implementation of go-gitea#19125. All releases record in
    databases of one mirror repository will be deleted before sync.
    Ref:
    https://github.com/go-gitea/gitea/pull/19125/files#diff-2aa04998a791c30e5a02b49a97c07fcd93d50e8b31640ce2ddb1afeebf605d02R481
    
    # The Pros
    
    This PR introduced a new method which will load all releases from
    databases and all tags on git data into memory. And detect which tags
    needs to be inserted, which tags need to be updated or deleted. Only
    tags releases(IsTag=true) which are not included in git data will be
    deleted, only tags which sha1 changed will be updated. So it will not
    delete any real releases include drafts.
    
    # The Cons
    
    The drawback is the memory usage will be higher than before if there are
    many tags on this repository. This PR defined a special release struct
    to reduce columns loaded from database to memory.
    lunny authored and GiteaBot committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    18bd591 View commit details
    Browse the repository at this point in the history
  2. Fix lint

    lunny committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    06a11de View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2024

  1. Configuration menu
    Copy the full SHA
    8f9b090 View commit details
    Browse the repository at this point in the history