forgejo/models
Mathieu Fenniak 28e0af25b4 perf: remove redundant & incorrect filters on 'SearchRepoOptions.OwnerID' (#11729)
Improves the performance of the `/repo/search?uid=N` API call, which is used on the user's dashboard to load a repo list.  More detailed notes are in https://codeberg.org/forgejo/forgejo/issues/11702.

Removes a redundant query condition (that a user was part of a team in an organization which could see a repo), and a condition that seems incorrect (that a repo could be seen just by being public within a private org, which is incorrect because that doesn't mean the user is a collaborator on the repo).

Covered by over 30 test cases in `repo_list_test.go` which did not fail from these changes.  Mutation testing (removing the remaining "2." condition) verified that the codepath is covered as tests did fail.

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests for Go changes

- I added test coverage for Go changes...
  - [ ] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I ran...
  - [x] `make pr-go` before pushing

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] This change will be noticed by a Forgejo user or admin (feature, bug fix, performance, etc.). I suggest to include a release note for this change.
- [x] This change is not visible to a Forgejo user or admin (refactor, dependency upgrade, etc.). I think there is no need to add a release note for this change.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/11729
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2026-03-18 17:01:44 +01:00
..
actions feat: make it possible to search runners by UUID (#11671) 2026-03-14 04:12:00 +01:00
activities chore: move all test blank imports in a single package (#10662) 2026-01-02 05:32:32 +01:00
admin feat: cache derived keys for faster keying (#10114) 2025-11-16 14:29:14 +01:00
asymkey chore: fix typos throughout the codebase (#10753) 2026-01-26 22:57:33 +01:00
auth feat: read, create, & delete repo-specific access tokens via API (#11504) 2026-03-07 21:55:08 +01:00
avatars feat(perf): remove unused size url parameter for local avatars (#10932) 2026-01-20 04:59:15 +01:00
db chore: support Option[T] as a type on database schema structs (#11553) 2026-03-08 03:36:32 +01:00
dbfs fix: garbage collect lingering actions logs (#10009) 2025-11-18 18:59:01 +01:00
fixtures feat: add more filters to actions run and tasks api (#11584) 2026-03-10 01:20:00 +01:00
forgefed log instrumentation & test package (#10371) 2025-12-09 15:37:50 +01:00
forgejo/semver chore: move all test blank imports in a single package (#10662) 2026-01-02 05:32:32 +01:00
forgejo_migrations chore: add comment for ap migration (#11144) 2026-03-09 17:09:07 +01:00
forgejo_migrations_legacy fix: normalize secrets consistently, display accurate help (#11052) 2026-02-09 17:02:18 +01:00
git refactor: replace Value() from Option[T] with Get() & ValueOrZeroValue() (#11218) 2026-02-10 16:41:21 +01:00
gitea_migrations ci: detect and prevent empty case statements in Go code (#11593) 2026-03-10 02:50:28 +01:00
issues fix: check that attachments belong to correct resource 2026-03-06 11:21:07 -07:00
moderation feat: render a link to poster profile next to the ID within shadow copy details (#10194) 2025-12-09 15:19:10 +01:00
organization fix: add missing deleting beans for organizations (#11699) 2026-03-17 09:11:52 +01:00
packages ci: detect and prevent empty case statements in Go code (#11593) 2026-03-10 02:50:28 +01:00
perm feat: add GetUserRepoPermissionWithReducer 2026-02-27 17:17:29 +01:00
project chore: add unit tests 2026-03-06 11:21:07 -07:00
pull fix: do not ignore automerge while a PR is checking for conflicts (#8189) 2025-06-17 10:58:07 +02:00
quota chore: move all test blank imports in a single package (#10662) 2026-01-02 05:32:32 +01:00
repo perf: remove redundant & incorrect filters on 'SearchRepoOptions.OwnerID' (#11729) 2026-03-18 17:01:44 +01:00
secret fix: normalize secrets consistently, display accurate help (#11052) 2026-02-09 17:02:18 +01:00
shared/types chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
system chore: move all test blank imports in a single package (#10662) 2026-01-02 05:32:32 +01:00
unit chore: do not leak global repository unit defaults (#11470) 2026-03-07 02:03:22 +01:00
unittest fix: prevent panic on gitlab import (releases/issues) (#11282) 2026-03-03 21:36:14 +01:00
user fix: UserTypeRemoteUser is an eligible organization member (#11326) 2026-02-17 02:39:46 +01:00
webhook refactor: replace Value() from Option[T] with Get() & ValueOrZeroValue() (#11218) 2026-02-10 16:41:21 +01:00
error.go fix: don't allow credentials in migrate/push mirror URL 2025-08-30 08:07:23 +02:00
main_test.go chore: move all test blank imports in a single package (#10662) 2026-01-02 05:32:32 +01:00
org.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
org_team.go chore: split AddRepository and AddTeamMember to return the inserted value (#11342) 2026-03-11 03:40:32 +01:00
org_team_test.go chore: split AddRepository and AddTeamMember to return the inserted value (#11342) 2026-03-11 03:40:32 +01:00
org_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
repo.go fix: possible cause of invalid issue counts; cache invalidation occurs before a active transaction is committed (#10130) 2025-11-17 01:07:29 +01:00
repo_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
repo_transfer.go chore: fix typos throughout the codebase (#10753) 2026-01-26 22:57:33 +01:00
repo_transfer_test.go chore: fix typos throughout the codebase (#10753) 2026-01-26 22:57:33 +01:00