Beyond coding. We forge. https://forgejo.org
Find a file
Gergely Nagy 0d029ebe6d
Fix git_model.FindBranchesByRepoAndBranchName
When a logged in user with no repositories visits their dashboard, it will
display a search box that lists their own repositories.

This is served by the `repo.SearchRepos` handler, which in turn calls
`commitstatus_service.FindReposLastestCommitStatuses()` with an empty
repo list.

That, in turn, will call `git_model.FindBranchesByRepoAndBranchName()`,
with an empty map. With no map, `FindBranchesByRepoAndBranchName()` ends
up querying the entire `branch` table, because no conditions were set
up.

Armed with a gazillion repo & commit shas, we return to
`FindReposLastestCommitStatuses`, and promptly call
`git_model.GetLatestCommitStatusForPairs`, which constructs a monstrous
query with so many placeholders that the database tells us to go
somewhere else, and flips us off. At least on instances the size of
Codeberg. On smaller instances, it will eventually return, and throw
away all the data, and return an empty set, having performed all this
for naught.

We fix this by short-circuiting `FindBranchesByRepoAndBranchName`, and
returning fast if our inputs are empty.

A test case is included.

Fixes #3521.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-01 00:34:39 +02:00
.devcontainer
.forgejo Update ghcr.io/visualon/renovate Docker tag to v37.323.3 2024-04-26 04:02:40 +00:00
.gitea
assets chore(licenses): github.com/minio/sha256-simd is no longer in use 2024-04-27 10:43:27 +02:00
build s/Gitea/Forgejo in various log messages and comments 2024-04-21 21:26:15 +05:00
cmd Enable more revive linter rules (#30608) 2024-04-28 15:39:00 +02:00
contrib
custom/conf Limit database max connections by default 2024-04-23 00:47:50 +02:00
docker fix(Dockerfile.rootless): revert to default path for app.ini 2024-04-26 21:30:10 +02:00
models Fix git_model.FindBranchesByRepoAndBranchName 2024-05-01 00:34:39 +02:00
modules Fix user mention processing 2024-04-30 12:51:30 +02:00
options Merge pull request 'Cumulative English locale improvements' (#3266) from 0ko/forgejo:i18n-20240416 into forgejo 2024-04-30 14:49:48 +00:00
public
release-notes/8.0.0 Fix git_model.FindBranchesByRepoAndBranchName 2024-05-01 00:34:39 +02:00
releases/images
routers Merge pull request '[gitea] week 2024-18 cherry pick (gitea-github/main -> forgejo)' (#3513) from earl-warren/wcp/2024-18 into forgejo 2024-04-30 06:42:26 +00:00
services Merge pull request 'Add inline attachments to comments and prevent double handling of mails' (#3504) from Beowulf/forgejo:mail-inline-attachments-not-added-to-comment into forgejo 2024-04-30 12:19:42 +00:00
templates Merge pull request '[gitea] week 2024-18 cherry pick (gitea-github/main -> forgejo)' (#3513) from earl-warren/wcp/2024-18 into forgejo 2024-04-30 06:42:26 +00:00
tests Merge pull request '[gitea] week 2024-18 cherry pick (gitea-github/main -> forgejo)' (#3513) from earl-warren/wcp/2024-18 into forgejo 2024-04-30 06:42:26 +00:00
tools
web_src Merge pull request '[gitea] week 2024-18 cherry pick (gitea-github/main -> forgejo)' (#3513) from earl-warren/wcp/2024-18 into forgejo 2024-04-30 06:42:26 +00:00
.air.toml Kill all gitea processes before air build (#30477) 2024-04-21 11:38:58 +02:00
.changelog.yml
.deadcode-out [DEADCODE] update 2024-04-21 16:40:43 +02:00
.dockerignore Add /public/assets/img/webpack to ignore files again (#30451) 2024-04-15 20:01:36 +02:00
.editorconfig
.eslintrc.yaml Enable jquery-related eslint rules that have no violations (#30632) 2024-04-28 15:39:00 +02:00
.gitattributes Add interface{} to any replacement to make fmt, exclude *.pb.go (#30461) 2024-04-15 20:01:36 +02:00
.gitignore Add /public/assets/img/webpack to ignore files again (#30451) 2024-04-15 20:01:36 +02:00
.gitmodules cleanup(tests): remove manual testing submodule 2024-04-21 10:13:51 +02:00
.gitpod.yml
.golangci.yml Enable more revive linter rules (#30608) 2024-04-28 15:39:00 +02:00
.ignore Add /options/license and /options/gitignore to .ignore (#30219) 2024-04-07 15:40:31 +02:00
.markdownlint.yaml
.npmrc
.spectral.yaml
.yamllint.yaml
BSDmakefile
build.go
CODEOWNERS I feel responsible … (Codeowners) 2024-04-27 02:22:05 +02:00
CONTRIBUTING.md docs: contributing: avoid information duplication (#3454) 2024-04-25 19:10:43 +00:00
DCO
Dockerfile fix(release): add missing ARG RELEASE_VERSION 2024-04-17 17:16:53 +02:00
Dockerfile.rootless fix(Dockerfile.rootless): revert to default path for app.ini 2024-04-26 21:30:10 +02:00
go.mod Merge pull request 'Update module connectrpc.com/connect to v1.16.1' (#3491) from renovate/connectrpc.com-connect-1.x into forgejo 2024-04-30 07:10:13 +00:00
go.sum Merge pull request 'Update module connectrpc.com/connect to v1.16.1' (#3491) from renovate/connectrpc.com-connect-1.x into forgejo 2024-04-30 07:10:13 +00:00
LICENSE
main.go
Makefile Suppress browserslist warning in webpack target (#30571) 2024-04-28 15:39:01 +02:00
package-lock.json Merge pull request 'Update dependency @stylistic/stylelint-plugin to v2.1.2' (#3544) from renovate/stylistic-stylelint-plugin-2.x into forgejo 2024-04-30 07:04:10 +00:00
package.json Merge pull request 'Update dependency @stylistic/stylelint-plugin to v2.1.2' (#3544) from renovate/stylistic-stylelint-plugin-2.x into forgejo 2024-04-30 07:04:10 +00:00
playwright.config.js
poetry.lock
poetry.toml
pyproject.toml
README.md
RELEASE-NOTES.md RELEASE Version Link 2024-04-27 20:17:33 +02:00
renovate.json feat(renovate): github.com/urfave/cli/v2 is good at managing patches 2024-04-28 16:01:28 +02:00
stylelint.config.js
tailwind.config.js
updates.config.js
vitest.config.js
webpack.config.js

Welcome to Forgejo

Hi there! Tired of big platforms playing monopoly? Providing Git hosting for your project, friends, company or community? Forgejo (/for'd͡ʒe.jo/ inspired by forĝejo the Esperanto word for forge) has you covered with its intuitive interface, light and easy hosting and a lot of builtin functionality.

Forgejo was created in 2022 because we think that the project should be owned by an independent community. If you second that, then Forgejo is for you! Our promise: Independent Free/Libre Software forever!

What does Forgejo offer?

If you like any of the following, Forgejo is literally meant for you:

  • Lightweight: Forgejo can easily be hosted on nearly every machine. Running on a Raspberry? Small cloud instance? No problem!
  • Project management: Besides Git hosting, Forgejo offers issues, pull requests, wikis, kanban boards and much more to coordinate with your team.
  • Publishing: Have something to share? Use releases to host your software for download, or use the package registry to publish it for docker, npm and many other package managers.
  • Customizable: Want to change your look? Change some settings? There are many config switches to make Forgejo work exactly like you want.
  • Powerful: Organizations & team permissions, CI integration, Code Search, LDAP, OAuth and much more. If you have advanced needs, Forgejo has you covered.
  • Privacy: From update checker to default settings: Forgejo is built to be privacy first for you and your crew.
  • Federation: (WIP) We are actively working to connect software forges with each other through ActivityPub, and create a collaborative network of personal instances.

Learn more

Dive into the documentation, subscribe to releases and blog post on our website, find us on the Fediverse or hop into our Matrix room if you have any questions or want to get involved.

Get involved

If you are interested in making Forgejo better, either by reporting a bug or by changing the governance, please take a look at the contribution guide.