loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: https://github.com/go-gitea/gitea/issues/25657

Ref: https://endoflife.date/mysql
Ref: https://endoflife.date/postgresql
Ref: https://endoflife.date/mssqlserver

## :warning: BREAKING :warning:

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 <techknowlogick@gitea.com>

authored by

silverwind
techknowlogick
and committed by
GitHub
e94f9fca 1c9990c1

+21 -210
+6 -36
.github/workflows/pull-db-tests.yml
··· 17 17 runs-on: ubuntu-latest 18 18 services: 19 19 pgsql: 20 - image: postgres:15 20 + image: postgres:16 21 21 env: 22 22 POSTGRES_DB: test 23 23 POSTGRES_PASSWORD: postgres ··· 86 86 runs-on: ubuntu-latest 87 87 services: 88 88 mysql: 89 - image: mysql:5.7 89 + image: mysql:8.1 90 90 env: 91 91 MYSQL_ALLOW_EMPTY_PASSWORD: true 92 92 MYSQL_DATABASE: test ··· 152 152 RACE_ENABLED: true 153 153 GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }} 154 154 155 - test-mysql5: 155 + test-mysql: 156 156 if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' 157 157 needs: files-changed 158 158 runs-on: ubuntu-latest 159 159 services: 160 160 mysql: 161 - image: mysql:5.7 161 + image: mysql:8.1 162 162 env: 163 163 MYSQL_ALLOW_EMPTY_PASSWORD: true 164 - MYSQL_DATABASE: test 164 + MYSQL_DATABASE: testgitea 165 165 ports: 166 166 - "3306:3306" 167 167 elasticsearch: ··· 197 197 USE_REPO_TEST_DIR: 1 198 198 TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200" 199 199 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 - 230 200 test-mssql: 231 201 if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' 232 202 needs: files-changed 233 203 runs-on: ubuntu-latest 234 204 services: 235 205 mssql: 236 - image: mcr.microsoft.com/mssql/server:latest 206 + image: mcr.microsoft.com/mssql/server:2022-latest 237 207 env: 238 208 ACCEPT_EULA: Y 239 209 MSSQL_PID: Standard
+7 -57
Makefile
··· 167 167 TEST_MYSQL_DBNAME ?= testgitea 168 168 TEST_MYSQL_USERNAME ?= root 169 169 TEST_MYSQL_PASSWORD ?= 170 - TEST_MYSQL8_HOST ?= mysql8:3306 171 - TEST_MYSQL8_DBNAME ?= testgitea 172 - TEST_MYSQL8_USERNAME ?= root 173 - TEST_MYSQL8_PASSWORD ?= 174 170 TEST_PGSQL_HOST ?= pgsql:5432 175 171 TEST_PGSQL_DBNAME ?= testgitea 176 172 TEST_PGSQL_USERNAME ?= postgres ··· 282 278 rm -rf $(EXECUTABLE) $(DIST) $(BINDATA_DEST) $(BINDATA_HASH) \ 283 279 integrations*.test \ 284 280 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/ 291 287 292 288 .PHONY: fmt 293 289 fmt: ··· 551 547 .PHONY: test-mysql-migration 552 548 test-mysql-migration: migrations.mysql.test migrations.individual.mysql.test 553 549 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 - 575 550 generate-ini-pgsql: 576 551 sed -e 's|{{TEST_PGSQL_HOST}}|${TEST_PGSQL_HOST}|g' \ 577 552 -e 's|{{TEST_PGSQL_DBNAME}}|${TEST_PGSQL_DBNAME}|g' \ ··· 644 619 test-e2e-mysql\#%: playwright e2e.mysql.test generate-ini-mysql 645 620 GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./e2e.mysql.test -test.run TestE2e/$* 646 621 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 - 655 622 .PHONY: test-e2e-pgsql 656 623 test-e2e-pgsql: playwright e2e.pgsql.test generate-ini-pgsql 657 624 GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./e2e.pgsql.test ··· 694 661 695 662 integrations.mysql.test: git-check $(GO_SOURCES) 696 663 $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mysql.test 697 - 698 - integrations.mysql8.test: git-check $(GO_SOURCES) 699 - $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mysql8.test 700 664 701 665 integrations.pgsql.test: git-check $(GO_SOURCES) 702 666 $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.pgsql.test ··· 718 682 $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mysql.test 719 683 GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./migrations.mysql.test 720 684 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 - 726 685 .PHONY: migrations.pgsql.test 727 686 migrations.pgsql.test: $(GO_SOURCES) generate-ini-pgsql 728 687 $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.pgsql.test ··· 744 703 GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \ 745 704 done 746 705 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\#% 754 707 migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite 755 708 GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$* 756 709 ··· 787 740 788 741 e2e.mysql.test: $(GO_SOURCES) 789 742 $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.mysql.test 790 - 791 - e2e.mysql8.test: $(GO_SOURCES) 792 - $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.mysql8.test 793 743 794 744 e2e.pgsql.test: $(GO_SOURCES) 795 745 $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.pgsql.test
+3 -1
docs/content/installation/database-preparation.en-us.md
··· 17 17 18 18 # Database Preparation 19 19 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. 21 23 22 24 Database instance can be on same machine as Gitea (local database setup), or on different machine (remote database). 23 25
+1 -1
docs/content/installation/database-preparation.zh-cn.md
··· 17 17 18 18 # 数据库准备 19 19 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,则可以忽略本章内容。 21 21 22 22 数据库实例可以与 Gitea 实例在相同机器上(本地数据库),也可以与 Gitea 实例在不同机器上(远程数据库)。 23 23
+2 -3
tests/e2e/README.md
··· 7 7 make test-sqlite 8 8 make test-pgsql 9 9 make test-mysql 10 - make test-mysql8 11 10 make test-mssql 12 11 ``` 13 12 ··· 76 75 make test-e2e-sqlite#example 77 76 ``` 78 77 79 - For other databases(replace `mssql` to `mysql`, `mysql8` or `pgsql`): 78 + For other databases(replace `mssql` to `mysql` or `pgsql`): 80 79 81 80 ``` 82 81 TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-e2e-mssql#example ··· 90 89 91 90 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. 92 91 93 - ACCEPT_VISUAL=1 will overwrite the snapshot images with new images. 92 + ACCEPT_VISUAL=1 will overwrite the snapshot images with new images.
+1 -2
tests/integration/README.md
··· 6 6 make test-sqlite 7 7 make test-pgsql 8 8 make test-mysql 9 - make test-mysql8 10 9 make test-mssql 11 10 ``` 12 11 ··· 84 83 make test-sqlite#GPG 85 84 ``` 86 85 87 - For other databases(replace `mssql` to `mysql`, `mysql8` or `pgsql`): 86 + For other databases(replace `mssql` to `mysql`, or `pgsql`): 88 87 89 88 ``` 90 89 TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-mssql#GPG
+1 -1
tests/integration/README_ZH.md
··· 79 79 make test-sqlite#GPG 80 80 ``` 81 81 82 - 其它数据库(把 MSSQL 替换为 MYSQL, MYSQL8, PGSQL): 82 + 其它数据库(把 MSSQL 替换为 MYSQL, PGSQL): 83 83 84 84 ``` 85 85 TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-mssql#GPG
-109
tests/mysql8.ini.tmpl
··· 1 - APP_NAME = Gitea: Git with a cup of tea 2 - RUN_MODE = prod 3 - 4 - [database] 5 - DB_TYPE = mysql 6 - HOST = {{TEST_MYSQL8_HOST}} 7 - NAME = {{TEST_MYSQL8_DBNAME}} 8 - USER = {{TEST_MYSQL8_USERNAME}} 9 - PASSWD = {{TEST_MYSQL8_PASSWORD}} 10 - SSL_MODE = disable 11 - 12 - [indexer] 13 - REPO_INDEXER_ENABLED = true 14 - REPO_INDEXER_PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mysql8/indexers/repos.bleve 15 - 16 - [queue.issue_indexer] 17 - TYPE = level 18 - DATADIR = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mysql8/indexers/issues.queue 19 - 20 - [queue] 21 - TYPE = immediate 22 - 23 - [queue.code_indexer] 24 - TYPE = immediate 25 - 26 - [queue.push_update] 27 - TYPE = immediate 28 - 29 - [repository] 30 - ROOT = {{REPO_TEST_DIR}}tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mysql8/gitea-repositories 31 - 32 - [repository.local] 33 - LOCAL_COPY_PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mysql8/tmp/local-repo 34 - 35 - [repository.upload] 36 - TEMP_PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mysql8/tmp/uploads 37 - 38 - [repository.signing] 39 - SIGNING_KEY = none 40 - 41 - [server] 42 - SSH_DOMAIN = localhost 43 - HTTP_PORT = 3004 44 - ROOT_URL = http://localhost:3004/ 45 - DISABLE_SSH = false 46 - SSH_LISTEN_HOST = localhost 47 - SSH_PORT = 2204 48 - START_SSH_SERVER = true 49 - LFS_START_SERVER = true 50 - OFFLINE_MODE = false 51 - LFS_JWT_SECRET = Tv_MjmZuHqpIY6GFl12ebgkRAMt4RlWt0v4EHKSXO0w 52 - APP_DATA_PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mysql8/data 53 - BUILTIN_SSH_SERVER_USER = git 54 - SSH_TRUSTED_USER_CA_KEYS = ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCb4DC1dMFnJ6pXWo7GMxTchtzmJHYzfN6sZ9FAPFR4ijMLfGki+olvOMO5Fql1/yGnGfbELQa1S6y4shSvj/5K+zUFScmEXYf3Gcr87RqilLkyk16RS+cHNB1u87xTHbETaa3nyCJeGQRpd4IQ4NKob745mwDZ7jQBH8AZEng50Oh8y8fi8skBBBzaYp1ilgvzG740L7uex6fHV62myq0SXeCa+oJUjq326FU8y+Vsa32H8A3e7tOgXZPdt2TVNltx2S9H2WO8RMi7LfaSwARNfy1zu+bfR50r6ef8Yx5YKCMz4wWb1SHU1GS800mjOjlInLQORYRNMlSwR1+vLlVDciOqFapDSbj+YOVOawR0R1aqlSKpZkt33DuOBPx9qe6CVnIi7Z+Px/KqM+OLCzlLY/RS+LbxQpDWcfTVRiP+S5qRTcE3M3UioN/e0BE/1+MpX90IGpvVkA63ILYbKEa4bM3ASL7ChTCr6xN5XT+GpVJveFKK1cfNx9ExHI4rzYE= 55 - 56 - [attachment] 57 - PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mysql8/data/attachments 58 - 59 - [mailer] 60 - ENABLED = false 61 - 62 - [service] 63 - REGISTER_EMAIL_CONFIRM = false 64 - REGISTER_MANUAL_CONFIRM = false 65 - ENABLE_NOTIFY_MAIL = false 66 - DISABLE_REGISTRATION = false 67 - ENABLE_CAPTCHA = false 68 - REQUIRE_SIGNIN_VIEW = false 69 - DEFAULT_KEEP_EMAIL_PRIVATE = false 70 - DEFAULT_ALLOW_CREATE_ORGANIZATION = true 71 - NO_REPLY_ADDRESS = noreply.example.org 72 - 73 - [picture] 74 - DISABLE_GRAVATAR = false 75 - ENABLE_FEDERATED_AVATAR = false 76 - AVATAR_UPLOAD_PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mysql8/data/avatars 77 - REPOSITORY_AVATAR_UPLOAD_PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mysql8/data/repo-avatars 78 - 79 - [session] 80 - PROVIDER = file 81 - PROVIDER_CONFIG = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mysql8/data/sessions 82 - 83 - [log] 84 - MODE = {{TEST_LOGGER}} 85 - ROOT_PATH = {{REPO_TEST_DIR}}mysql8-log 86 - ENABLE_SSH_LOG = true 87 - logger.xorm.MODE = file 88 - 89 - [log.test] 90 - LEVEL = Info 91 - COLORIZE = true 92 - 93 - [log.file] 94 - LEVEL = Debug 95 - 96 - [security] 97 - DISABLE_GIT_HOOKS = false 98 - INSTALL_LOCK = true 99 - SECRET_KEY = 9pCviYTWSb 100 - INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE0OTU1NTE2MTh9.hhSVGOANkaKk3vfCd2jDOIww4pUk0xtg9JRde5UogyQ 101 - 102 - [lfs] 103 - PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mysql8/data/lfs 104 - 105 - [packages] 106 - ENABLED = true 107 - 108 - [actions] 109 - ENABLED = true