forgejo/models/migrations/v1_22
Gusted 138942c09e
[CHORE] Move test related function to own package
- Go's deadcode eliminator is quite simple, if you put a public function
in a package `aa/bb` that is used only by tests, it would still be built
if package `aa/bb` was imported. This means that if such functions use
libraries relevant only to tests that those libraries would still be
be built and increase the binary size of a Go binary.
- This is also the case with Forgejo, `models/migrations/base/tests.go`
contained functions exclusively used by tests which (skipping some steps
here) imports https://github.com/ClickHouse/clickhouse-go, which is
2MiB. The `code.gitea.io/gitea/models/migrations/base` package is
imported by `cmd/doctor` and thus the code of the clickhouse library is
also built and included in the Forgejo binary, although entirely unused
and not reachable.
- This patch moves the test-related functions to their own package, so
Go's deadcode eliminator knows not to build the test-related functions
and thus reduces the size of the Forgejo binary.
- It is not possible to move this to a `_test.go` file because Go does
not allow importing functions from such files, so any test helper
function must be in a non-test package and file.
- Reduction of size (built with `TAGS="sqlite sqlite_unlock_notify" make
build`):
  - Before: 95912040 bytes (92M)
  - After: 92306888 bytes (89M)
2024-07-14 17:00:49 +02:00
..
main_test.go [CHORE] Move test related function to own package 2024-07-14 17:00:49 +02:00
v280.go Rename the default themes to gitea-light, gitea-dark, gitea-auto (#27419) 2023-10-06 09:46:36 +02:00
v281.go Enhanced auth token / remember me (#27606) 2023-10-14 00:56:41 +00:00
v282.go Add Index to pull_auto_merge.doer_id (#27811) 2023-10-30 08:39:29 +00:00
v283.go [CHORE] Remove Microsoft SQL Server Support 2024-04-05 23:37:36 +02:00
v283_test.go [CHORE] Move test related function to own package 2024-07-14 17:00:49 +02:00
v284.go Add branch protection setting for ignoring stale approvals (#28498) 2024-01-15 07:20:01 +00:00
v285.go Fix incorrect action duration time when rerun the job before executed once (#28364) 2024-01-19 14:05:49 +00:00
v286.go Fix the possible migration failure on 286 with postgres 16 (#31209) 2024-06-02 16:26:54 +02:00
v286_test.go [CHORE] Move test related function to own package 2024-07-14 17:00:49 +02:00
v287.go Add admin API route for managing user's badges (#23106) (database migration ony) 2024-03-11 23:36:59 +07:00
v288.go Add user blocking (#29028) (database migration ony) 2024-03-11 23:36:59 +07:00
v289.go Make wiki default branch name changable (#29603) (database migration ony) 2024-03-11 23:36:59 +07:00
v290.go add test for webhook migration 2024-03-11 23:37:00 +07:00
v290_test.go [CHORE] Move test related function to own package 2024-07-14 17:00:49 +02:00
v291.go Do some performance optimize for issues list and view issue/pull (#29515) (migration only) 2024-03-30 07:17:31 +01:00
v292.go Fix migration v292 (#30153) 2024-03-30 07:17:32 +01:00
v293.go Fix migration v292 (#30153) 2024-03-30 07:17:32 +01:00
v293_test.go [CHORE] Move test related function to own package 2024-07-14 17:00:49 +02:00
v294.go Rename migration package name for 1.22-rc1 (#30730) 2024-04-28 15:39:01 +02:00
v294_test.go [CHORE] Move test related function to own package 2024-07-14 17:00:49 +02:00
v295.go Rename migration package name for 1.22-rc1 (#30730) 2024-04-28 15:39:01 +02:00
v296.go Rename migration package name for 1.22-rc1 (#30730) 2024-04-28 15:39:01 +02:00
v298.go Rename migration package name for 1.22-rc1 (#30730) 2024-04-28 15:39:01 +02:00