Skip to content

Commit e94f9fc

Browse files
Require MySQL 8.0, PostgreSQL 12, MSSQL 2012 (#27337)
- MySQL 5.7 support and testing is dropped - MySQL tests now execute against 8.1, up from 5.7 and 8.0 - PostgreSQL 10 and 11 support ist dropped - PostgreSQL tests now execute against 16, up from 15 - MSSQL 2008 support is dropped - MSSQL tests now run against locked 2022 version Fixes: #25657 Ref: https://endoflife.date/mysql Ref: https://endoflife.date/postgresql Ref: https://endoflife.date/mssqlserver ## ⚠️ BREAKING ⚠️ Support for MySQL 5.7, PostgreSQL 10 and 11, and MSSQL 2008 is dropped. You are encouraged to upgrade to supported versions. --------- Co-authored-by: techknowlogick <[email protected]>
1 parent 1c9990c commit e94f9fc

File tree

8 files changed

+21
-210
lines changed

8 files changed

+21
-210
lines changed

.github/workflows/pull-db-tests.yml

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
services:
1919
pgsql:
20-
image: postgres:15
20+
image: postgres:16
2121
env:
2222
POSTGRES_DB: test
2323
POSTGRES_PASSWORD: postgres
@@ -86,7 +86,7 @@ jobs:
8686
runs-on: ubuntu-latest
8787
services:
8888
mysql:
89-
image: mysql:5.7
89+
image: mysql:8.1
9090
env:
9191
MYSQL_ALLOW_EMPTY_PASSWORD: true
9292
MYSQL_DATABASE: test
@@ -152,16 +152,16 @@ jobs:
152152
RACE_ENABLED: true
153153
GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }}
154154

155-
test-mysql5:
155+
test-mysql:
156156
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
157157
needs: files-changed
158158
runs-on: ubuntu-latest
159159
services:
160160
mysql:
161-
image: mysql:5.7
161+
image: mysql:8.1
162162
env:
163163
MYSQL_ALLOW_EMPTY_PASSWORD: true
164-
MYSQL_DATABASE: test
164+
MYSQL_DATABASE: testgitea
165165
ports:
166166
- "3306:3306"
167167
elasticsearch:
@@ -197,43 +197,13 @@ jobs:
197197
USE_REPO_TEST_DIR: 1
198198
TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200"
199199

200-
test-mysql8:
201-
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
202-
needs: files-changed
203-
runs-on: ubuntu-latest
204-
services:
205-
mysql8:
206-
image: mysql:8
207-
env:
208-
MYSQL_ALLOW_EMPTY_PASSWORD: true
209-
MYSQL_DATABASE: testgitea
210-
ports:
211-
- "3306:3306"
212-
steps:
213-
- uses: actions/checkout@v4
214-
- uses: actions/setup-go@v4
215-
with:
216-
go-version: "~1.21"
217-
check-latest: true
218-
- name: Add hosts to /etc/hosts
219-
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql8" | sudo tee -a /etc/hosts'
220-
- run: make deps-backend
221-
- run: make backend
222-
env:
223-
TAGS: bindata
224-
- run: make test-mysql8-migration test-mysql8
225-
timeout-minutes: 50
226-
env:
227-
TAGS: bindata
228-
USE_REPO_TEST_DIR: 1
229-
230200
test-mssql:
231201
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
232202
needs: files-changed
233203
runs-on: ubuntu-latest
234204
services:
235205
mssql:
236-
image: mcr.microsoft.com/mssql/server:latest
206+
image: mcr.microsoft.com/mssql/server:2022-latest
237207
env:
238208
ACCEPT_EULA: Y
239209
MSSQL_PID: Standard

Makefile

Lines changed: 7 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,6 @@ TEST_MYSQL_HOST ?= mysql:3306
167167
TEST_MYSQL_DBNAME ?= testgitea
168168
TEST_MYSQL_USERNAME ?= root
169169
TEST_MYSQL_PASSWORD ?=
170-
TEST_MYSQL8_HOST ?= mysql8:3306
171-
TEST_MYSQL8_DBNAME ?= testgitea
172-
TEST_MYSQL8_USERNAME ?= root
173-
TEST_MYSQL8_PASSWORD ?=
174170
TEST_PGSQL_HOST ?= pgsql:5432
175171
TEST_PGSQL_DBNAME ?= testgitea
176172
TEST_PGSQL_USERNAME ?= postgres
@@ -282,12 +278,12 @@ clean:
282278
rm -rf $(EXECUTABLE) $(DIST) $(BINDATA_DEST) $(BINDATA_HASH) \
283279
integrations*.test \
284280
e2e*.test \
285-
tests/integration/gitea-integration-pgsql/ tests/integration/gitea-integration-mysql/ tests/integration/gitea-integration-mysql8/ tests/integration/gitea-integration-sqlite/ \
286-
tests/integration/gitea-integration-mssql/ tests/integration/indexers-mysql/ tests/integration/indexers-mysql8/ tests/integration/indexers-pgsql tests/integration/indexers-sqlite \
287-
tests/integration/indexers-mssql tests/mysql.ini tests/mysql8.ini tests/pgsql.ini tests/mssql.ini man/ \
288-
tests/e2e/gitea-e2e-pgsql/ tests/e2e/gitea-e2e-mysql/ tests/e2e/gitea-e2e-mysql8/ tests/e2e/gitea-e2e-sqlite/ \
289-
tests/e2e/gitea-e2e-mssql/ tests/e2e/indexers-mysql/ tests/e2e/indexers-mysql8/ tests/e2e/indexers-pgsql/ tests/e2e/indexers-sqlite/ \
290-
tests/e2e/indexers-mssql/ tests/e2e/reports/ tests/e2e/test-artifacts/ tests/e2e/test-snapshots/
281+
tests/integration/gitea-integration-* \
282+
tests/integration/indexers-* \
283+
tests/mysql.ini tests/pgsql.ini tests/mssql.ini man/ \
284+
tests/e2e/gitea-e2e-*/ \
285+
tests/e2e/indexers-*/ \
286+
tests/e2e/reports/ tests/e2e/test-artifacts/ tests/e2e/test-snapshots/
291287

292288
.PHONY: fmt
293289
fmt:
@@ -551,27 +547,6 @@ test-mysql\#%: integrations.mysql.test generate-ini-mysql
551547
.PHONY: test-mysql-migration
552548
test-mysql-migration: migrations.mysql.test migrations.individual.mysql.test
553549

554-
generate-ini-mysql8:
555-
sed -e 's|{{TEST_MYSQL8_HOST}}|${TEST_MYSQL8_HOST}|g' \
556-
-e 's|{{TEST_MYSQL8_DBNAME}}|${TEST_MYSQL8_DBNAME}|g' \
557-
-e 's|{{TEST_MYSQL8_USERNAME}}|${TEST_MYSQL8_USERNAME}|g' \
558-
-e 's|{{TEST_MYSQL8_PASSWORD}}|${TEST_MYSQL8_PASSWORD}|g' \
559-
-e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \
560-
-e 's|{{TEST_LOGGER}}|$(or $(TEST_LOGGER),test$(COMMA)file)|g' \
561-
-e 's|{{TEST_TYPE}}|$(or $(TEST_TYPE),integration)|g' \
562-
tests/mysql8.ini.tmpl > tests/mysql8.ini
563-
564-
.PHONY: test-mysql8
565-
test-mysql8: integrations.mysql8.test generate-ini-mysql8
566-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql8.ini ./integrations.mysql8.test
567-
568-
.PHONY: test-mysql8\#%
569-
test-mysql8\#%: integrations.mysql8.test generate-ini-mysql8
570-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql8.ini ./integrations.mysql8.test -test.run $(subst .,/,$*)
571-
572-
.PHONY: test-mysql8-migration
573-
test-mysql8-migration: migrations.mysql8.test migrations.individual.mysql8.test
574-
575550
generate-ini-pgsql:
576551
sed -e 's|{{TEST_PGSQL_HOST}}|${TEST_PGSQL_HOST}|g' \
577552
-e 's|{{TEST_PGSQL_DBNAME}}|${TEST_PGSQL_DBNAME}|g' \
@@ -644,14 +619,6 @@ test-e2e-mysql: playwright e2e.mysql.test generate-ini-mysql
644619
test-e2e-mysql\#%: playwright e2e.mysql.test generate-ini-mysql
645620
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./e2e.mysql.test -test.run TestE2e/$*
646621

647-
.PHONY: test-e2e-mysql8
648-
test-e2e-mysql8: playwright e2e.mysql8.test generate-ini-mysql8
649-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql8.ini ./e2e.mysql8.test
650-
651-
.PHONY: test-e2e-mysql8\#%
652-
test-e2e-mysql8\#%: playwright e2e.mysql8.test generate-ini-mysql8
653-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql8.ini ./e2e.mysql8.test -test.run TestE2e/$*
654-
655622
.PHONY: test-e2e-pgsql
656623
test-e2e-pgsql: playwright e2e.pgsql.test generate-ini-pgsql
657624
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./e2e.pgsql.test
@@ -695,9 +662,6 @@ integration-test-coverage-sqlite: integrations.cover.sqlite.test generate-ini-sq
695662
integrations.mysql.test: git-check $(GO_SOURCES)
696663
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mysql.test
697664

698-
integrations.mysql8.test: git-check $(GO_SOURCES)
699-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mysql8.test
700-
701665
integrations.pgsql.test: git-check $(GO_SOURCES)
702666
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.pgsql.test
703667

@@ -718,11 +682,6 @@ migrations.mysql.test: $(GO_SOURCES) generate-ini-mysql
718682
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mysql.test
719683
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./migrations.mysql.test
720684

721-
.PHONY: migrations.mysql8.test
722-
migrations.mysql8.test: $(GO_SOURCES) generate-ini-mysql8
723-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mysql8.test
724-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql8.ini ./migrations.mysql8.test
725-
726685
.PHONY: migrations.pgsql.test
727686
migrations.pgsql.test: $(GO_SOURCES) generate-ini-pgsql
728687
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.pgsql.test
@@ -744,13 +703,7 @@ migrations.individual.mysql.test: $(GO_SOURCES)
744703
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
745704
done
746705

747-
.PHONY: migrations.individual.mysql8.test
748-
migrations.individual.mysql8.test: $(GO_SOURCES)
749-
for pkg in $(shell $(GO) list code.gitea.io/gitea/models/migrations/...); do \
750-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql8.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
751-
done
752-
753-
.PHONY: migrations.individual.mysql8.test\#%
706+
.PHONY: migrations.individual.sqlite.test\#%
754707
migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
755708
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
756709

@@ -788,9 +741,6 @@ migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
788741
e2e.mysql.test: $(GO_SOURCES)
789742
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.mysql.test
790743

791-
e2e.mysql8.test: $(GO_SOURCES)
792-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.mysql8.test
793-
794744
e2e.pgsql.test: $(GO_SOURCES)
795745
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.pgsql.test
796746

docs/content/installation/database-preparation.en-us.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ menu:
1717

1818
# Database Preparation
1919

20-
You need a database to use Gitea. Gitea supports PostgreSQL (>=10), MySQL (>=5.7), MariaDB, SQLite, and MSSQL (>=2008R2 SP3). This page will guide into preparing database. Only PostgreSQL and MySQL will be covered here since those database engines are widely-used in production. If you plan to use SQLite, you can ignore this chapter.
20+
You need a database to use Gitea. Gitea supports PostgreSQL (>= 12), MySQL (>= 8.0), MariaDB, SQLite, and MSSQL (>= 2012 SP4). This page will guide into preparing database. Only PostgreSQL and MySQL will be covered here since those database engines are widely-used in production. If you plan to use SQLite, you can ignore this chapter.
21+
22+
If you use an unsupported database version, please [get in touch](/help/support) with us for information on our Extended Support Contracts. We can provide testing and support for older databases and integrate those fixes into the Gitea codebase.
2123

2224
Database instance can be on same machine as Gitea (local database setup), or on different machine (remote database).
2325

docs/content/installation/database-preparation.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ menu:
1717

1818
# 数据库准备
1919

20-
在使用 Gitea 前,您需要准备一个数据库。Gitea 支持 PostgreSQL(>=10)、MySQL(>=5.7)、SQLite 和 MSSQL(>=2008R2 SP3)这几种数据库。本页将指导您准备数据库。由于 PostgreSQL 和 MySQL 在生产环境中被广泛使用,因此本文档将仅涵盖这两种数据库。如果您计划使用 SQLite,则可以忽略本章内容。
20+
在使用 Gitea 前,您需要准备一个数据库。Gitea 支持 PostgreSQL(>= 12)、MySQL(>= 8.0)、SQLite 和 MSSQL(>= 2012 SP4)这几种数据库。本页将指导您准备数据库。由于 PostgreSQL 和 MySQL 在生产环境中被广泛使用,因此本文档将仅涵盖这两种数据库。如果您计划使用 SQLite,则可以忽略本章内容。
2121

2222
数据库实例可以与 Gitea 实例在相同机器上(本地数据库),也可以与 Gitea 实例在不同机器上(远程数据库)。
2323

tests/e2e/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ They can be run with make commands for the appropriate backends, namely:
77
make test-sqlite
88
make test-pgsql
99
make test-mysql
10-
make test-mysql8
1110
make test-mssql
1211
```
1312

@@ -76,7 +75,7 @@ For SQLite:
7675
make test-e2e-sqlite#example
7776
```
7877

79-
For other databases(replace `mssql` to `mysql`, `mysql8` or `pgsql`):
78+
For other databases(replace `mssql` to `mysql` or `pgsql`):
8079

8180
```
8281
TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-e2e-mssql#example
@@ -90,4 +89,4 @@ Although the main goal of e2e is assertion testing, we have added a framework fo
9089

9190
VISUAL_TEST=1 will create screenshots in tests/e2e/test-snapshots. The test will fail the first time this is enabled (until we get visual test image persistence figured out), because it will be testing against an empty screenshot folder.
9291

93-
ACCEPT_VISUAL=1 will overwrite the snapshot images with new images.
92+
ACCEPT_VISUAL=1 will overwrite the snapshot images with new images.

tests/integration/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ appropriate backends, namely:
66
make test-sqlite
77
make test-pgsql
88
make test-mysql
9-
make test-mysql8
109
make test-mssql
1110
```
1211

@@ -84,7 +83,7 @@ For SQLite:
8483
make test-sqlite#GPG
8584
```
8685

87-
For other databases(replace `mssql` to `mysql`, `mysql8` or `pgsql`):
86+
For other databases(replace `mssql` to `mysql`, or `pgsql`):
8887

8988
```
9089
TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-mssql#GPG

tests/integration/README_ZH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ sqlite 数据库:
7979
make test-sqlite#GPG
8080
```
8181

82-
其它数据库(把 MSSQL 替换为 MYSQL, MYSQL8, PGSQL):
82+
其它数据库(把 MSSQL 替换为 MYSQL, PGSQL):
8383

8484
```
8585
TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-mssql#GPG

tests/mysql8.ini.tmpl

Lines changed: 0 additions & 109 deletions
This file was deleted.

0 commit comments

Comments
 (0)