0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-25 06:04:50 +01:00
gitea/modules
Giteabot 2048363f9e
Don't remove all mirror repository's releases when mirroring (#28817) (#28939)
Backport #28817 by @lunny

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.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2024-01-31 04:23:26 +00:00
..
actions Fix schedule tasks bugs (#28691) (#28780) 2024-01-14 23:54:22 +01:00
activitypub
analyze
assetfs
auth
avatar
base
cache
charset Preserve BOM in web editor (#28935) (#28959) 2024-01-27 23:23:31 +01:00
container
context Prevent anonymous container access if RequireSignInView is enabled (#28877) (#28882) 2024-01-22 01:44:38 +08:00
contexttest
csv
doctor Initalize stroage for orphaned repository doctor (#28487) (#28490) 2023-12-16 22:06:37 +08:00
emoji
eventsource More db.DefaultContext refactor (#27265) (#27347) 2023-09-29 13:35:01 +00:00
generate
git Update go dependencies and fix go-git (#28893) (#28934) 2024-01-26 15:08:43 +08:00
gitgraph More db.DefaultContext refactor (#27265) (#27347) 2023-09-29 13:35:01 +00:00
graceful
hcaptcha
highlight Add option to disable ambiguous unicode characters detection (#28454) (#28499) 2023-12-18 12:20:37 +08:00
hostmatcher Support allowed hosts for webhook to work with proxy (#27655) (#27675) 2023-10-18 15:07:52 +02:00
html
httpcache
httplib
indexer Preserve BOM in web editor (#28935) (#28959) 2024-01-27 23:23:31 +01:00
issue/template
json
label
lfs Refactor lfs requests (#26783) 2023-09-18 08:40:50 +00:00
log
markup Strip / from relative links (#28932) (#28952) 2024-01-27 15:14:36 +00:00
mcaptcha
metrics
migration
nosql
options
packages Close all hashed buffers (#27787) (#27790) 2023-10-25 22:24:25 +02:00
paginator
pprof
private Use correct has error check for internal responses (#28796) (#28798) 2024-01-15 13:13:35 +01:00
process
proxy
proxyprotocol
public Refactor CORS handler (#28587) (#28611) 2023-12-25 21:01:24 +08:00
queue Increase queue length (#27555) (#27562) 2023-10-10 20:22:26 +08:00
recaptcha
references
regexplru
repository Don't remove all mirror repository's releases when mirroring (#28817) (#28939) 2024-01-31 04:23:26 +00:00
secret
session
setting Fix incorrect PostgreSQL connection string for Unix sockets (#28865) (#28870) 2024-01-21 16:06:34 +00:00
sitemap
ssh
storage
structs chore(api): support ignore password if login source type is LDAP for creating user API (#28491) (#28525) 2023-12-19 11:14:06 +08:00
svg
sync
system
templates Rework markup link rendering (#26745) (#28803) 2024-01-16 02:13:29 +00:00
test
testlogger
timeutil Make template DateTime show proper tooltip (#28677) (#28683) 2024-01-03 18:41:03 +08:00
translation
turnstile
typesniffer
updatechecker
upload
uri
user
util Add option to disable ambiguous unicode characters detection (#28454) (#28499) 2023-12-18 12:20:37 +08:00
validation
web Refactor CORS handler (#28587) (#28611) 2023-12-25 21:01:24 +08:00
webhook Fix schedule tasks bugs (#28691) (#28780) 2024-01-14 23:54:22 +01:00