1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-10-15 06:04:32 -04:00
gitea/modules
Lunny Xiao 534917d576
Don't remove all mirror repository's releases when mirroring (#28817)
Fix #22066

# Purpose

This PR fix the releases will be deleted when mirror repository sync the
tags.

# The problem

In the previous implementation of #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.
2024-01-26 06:18:19 +00:00
..
actions Fix schedule tasks bugs (#28691) 2024-01-12 21:50:38 +00:00
activitypub Upgrade to golangci-lint@v1.55.0 (#27756) 2023-10-24 02:54:59 +00:00
analyze
assetfs
auth
avatar
base Refactor some legacy code and remove unused code (#28622) 2023-12-28 09:38:59 +00:00
cache Always enable caches (#28527) 2023-12-19 09:29:05 +00:00
charset Add option to disable ambiguous unicode characters detection (#28454) 2023-12-17 14:38:54 +00:00
container
context Prevent anonymous container access if RequireSignInView is enabled (#28877) 2024-01-21 16:31:29 +00:00
contexttest
csv
emoji
eventsource
generate
git Check for sha256 support to use --object-format flag (#28928) 2024-01-25 13:04:50 -05:00
gitgraph
graceful Suggest to use Type=simple for systemd service (#28717) 2024-01-07 15:18:04 +00:00
hcaptcha
highlight Add option to disable ambiguous unicode characters detection (#28454) 2023-12-17 14:38:54 +00:00
hostmatcher
html
httpcache
httplib
indexer Fix sort bug on repository issues list (#28897) 2024-01-23 09:17:42 +08:00
issue/template
json
label
lfs Do not set Accept header twice (#28598) 2023-12-28 03:59:00 +00:00
log
markup Respect branch info for relative links (#28909) 2024-01-25 09:54:44 +01:00
mcaptcha
metrics
migration
nosql
options
packages Use new RPM constants (#28931) 2024-01-25 21:40:24 +00:00
paginator
pprof
private Return responseText instead of string in some functions (#28836) 2024-01-19 10:45:23 +08:00
process
proxy
proxyprotocol
public Refactor CORS handler (#28587) 2023-12-25 20:13:18 +08:00
queue
recaptcha
references Add support for sha256 repositories (#23894) 2024-01-19 17:05:02 +01:00
regexplru
repository Don't remove all mirror repository's releases when mirroring (#28817) 2024-01-26 06:18:19 +00:00
secret
session
setting Fix incorrect PostgreSQL connection string for Unix sockets (#28865) 2024-01-20 16:04:47 +00:00
sitemap
ssh Remove SSH workaround (#27893) 2023-11-03 15:21:05 +00:00
storage
structs Add support for sha256 repositories (#23894) 2024-01-19 17:05:02 +01:00
svg
sync
system
templates Add support for sha256 repositories (#23894) 2024-01-19 17:05:02 +01:00
test
testlogger
timeutil Make template DateTime show proper tooltip (#28677) 2024-01-02 20:09:18 +01:00
translation
turnstile
typesniffer
updatechecker
upload
uri
user
util Fix some RPM registry flaws (#28782) 2024-01-19 11:37:10 +00:00
validation
web Refactor CORS handler (#28587) 2023-12-25 20:13:18 +08:00
webhook Fix schedule tasks bugs (#28691) 2024-01-12 21:50:38 +00:00