You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
forgejo/modules
Lunny Xiao 6e19484f4d
Sync branches into databases (#22743)
Related #14180
Related #25233 
Related #22639
Close #19786
Related #12763 

This PR will change all the branches retrieve method from reading git
data to read database to reduce git read operations.

- [x] Sync git branches information into database when push git data
- [x] Create a new table `Branch`, merge some columns of `DeletedBranch`
into `Branch` table and drop the table `DeletedBranch`.
- [x] Read `Branch` table when visit `code` -> `branch` page
- [x] Read `Branch` table when list branch names in `code` page dropdown
- [x] Read `Branch` table when list git ref compare page
- [x] Provide a button in admin page to manually sync all branches.
- [x] Sync branches if repository is not empty but database branches are
empty when visiting pages with branches list
- [x] Use `commit_time desc` as the default FindBranch order by to keep
consistent as before and deleted branches will be always at the end.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
1 year ago
..
actions Support downloading raw task logs (#24451) 1 year ago
activitypub Add Chef package registry (#22554) 1 year ago
analyze Implement FSFE REUSE for golang files (#21840) 2 years ago
assetfs Use a general approach to access custom/static/builtin assets (#24022) 1 year ago
auth Use a general approach to access custom/static/builtin assets (#24022) 1 year ago
avatar Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653) 1 year ago
base Update octicons and use `octicon-file-directory-symlink` (#25453) 1 year ago
cache Update redis library to support redis v7 (#24114) 1 year ago
charset Update go tool dependencies, restructure lint targets (#24239) 1 year ago
container Implement FSFE REUSE for golang files (#21840) 2 years ago
context Sync branches into databases (#22743) 1 year ago
csv Refactor locale number (#24134) 1 year ago
doctor Refactor path & config system (#25330) 1 year ago
emoji Fix unstable emoji sort (#22346) 2 years ago
eventsource Move `convert` package to services (#22264) 2 years ago
generate Implement FSFE REUSE for golang files (#21840) 2 years ago
git Fix index generation parallelly failure (#25235) 1 year ago
gitgraph Add context cache as a request level cache (#22294) 1 year ago
graceful Improve queue and logger context (#24924) 1 year ago
hcaptcha Consume hcaptcha and pwn deps (#22610) 2 years ago
highlight test_env: hardcode major go version in use (#23464) 1 year ago
hostmatcher Implement FSFE REUSE for golang files (#21840) 2 years ago
html Implement FSFE REUSE for golang files (#21840) 2 years ago
httpcache Use standard HTTP library to serve files (#24693) 1 year ago
httplib Use fetch to send requests to create issues/comments (#25258) 1 year ago
indexer Fix `Init` of db indexer (#25470) 1 year ago
issue/template Allow issue templates to not render title (#22589) 2 years ago
json Update gitea-vet to check FSFE REUSE (#22004) 2 years ago
label Make label templates have consistent behavior and priority (#23749) 1 year ago
lfs Rewrite logger system (#24726) 1 year ago
log Fix sub-command log level (#25537) 1 year ago
markup Refactor path & config system (#25330) 1 year ago
mcaptcha Implement FSFE REUSE for golang files (#21840) 2 years ago
metrics Use a separate admin page to show global stats, remove `actions` stat (#25062) 1 year ago
migration Scoped labels (#22585) 1 year ago
mirror Improve queue and logger context (#24924) 1 year ago
nosql Update redis library to support redis v7 (#24114) 1 year ago
notification Add Adopt repository event and handler (#25497) 1 year ago
options Use a general approach to access custom/static/builtin assets (#24022) 1 year ago
packages Add CRAN package registry (#22331) 1 year ago
paginator Use more specific test methods (#24265) 1 year ago
pprof Implement FSFE REUSE for golang files (#21840) 2 years ago
private Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634) 1 year ago
process Do not output "Trace" level logs from process manager by default (#24952) 1 year ago
proxy Use proxy for pull mirror (#22771) 1 year ago
proxyprotocol Implement FSFE REUSE for golang files (#21840) 2 years ago
public Use standard HTTP library to serve files (#24693) 1 year ago
queue Help to recover from corrupted levelqueue (#24912) 1 year ago
recaptcha Implement FSFE REUSE for golang files (#21840) 2 years ago
references Use correct captured group range when parsing cross-reference (#22672) 1 year ago
regexplru Implement FSFE REUSE for golang files (#21840) 2 years ago
repository Sync branches into databases (#22743) 1 year ago
secret Improve decryption failure message (#24573) 1 year ago
session Update redis library to support redis v7 (#24114) 1 year ago
setting Do not prepare oauth2 config if it is not enabled, do not write config in some sub-commands (#25567) 1 year ago
sitemap Fix sitemap (#22272) 2 years ago
ssh Refactor path & config system (#25330) 1 year ago
storage Fix all possible setting error related storages and added some tests (#23911) 1 year ago
structs Fix `Permission` in API returned repository struct (#25388) 1 year ago
svg Use inline SVG for built-in OAuth providers (#25171) 1 year ago
sync Implement FSFE REUSE for golang files (#21840) 2 years ago
system Implement FSFE REUSE for golang files (#21840) 2 years ago
templates Fix missing commit message body when the message has leading newlines (#25418) 1 year ago
test Refactor web package and context package (#25298) 1 year ago
testlogger Refactor path & config system (#25330) 1 year ago
timeutil Fix incorrect webhook time and use relative-time to display it (#24477) 1 year ago
translation Refactor INI package (first step) (#25024) 1 year ago
turnstile Add new captcha: cloudflare turnstile (#22369) 1 year ago
typesniffer Do not recognize text files as audio (#23355) 1 year ago
updatechecker Implement FSFE REUSE for golang files (#21840) 2 years ago
upload Implement FSFE REUSE for golang files (#21840) 2 years ago
uri Implement FSFE REUSE for golang files (#21840) 2 years ago
user Implement FSFE REUSE for golang files (#21840) 2 years ago
util Store and use seconds for timeline time comments (#25392) 1 year ago
validation Map OIDC groups to Orgs/Teams (#21441) 1 year ago
web Refactor web package and context package (#25298) 1 year ago
webhook New webhook trigger for receiving Pull Request review requests (#24481) 1 year ago