Skip to content

Commit 23bf01b

Browse files
authored
Merge branch 'main' into gitpod
2 parents 9cc14c8 + 04e97b8 commit 23bf01b

File tree

951 files changed

+14500
-5914
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

951 files changed

+14500
-5914
lines changed

.drone.yml

+97-3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ steps:
3939
- make lint-frontend
4040
depends_on: [deps-frontend]
4141

42+
- name: security-check
43+
image: golang:1.19
44+
pull: always
45+
commands:
46+
- make security-check
47+
depends_on: [deps-backend]
48+
volumes:
49+
- name: deps
50+
path: /go
51+
4252
- name: lint-backend
4353
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
4454
pull: always
@@ -102,11 +112,16 @@ steps:
102112
- make test-frontend
103113
depends_on: [lint-frontend]
104114

115+
- name: generate-frontend
116+
image: golang:1.19
117+
commands:
118+
- make generate-frontend
119+
105120
- name: build-frontend
106121
image: node:18
107122
commands:
108123
- make frontend
109-
depends_on: [test-frontend]
124+
depends_on: [deps-frontend, generate-frontend]
110125

111126
- name: build-backend-no-gcc
112127
image: golang:1.18 # this step is kept as the lowest version of golang that we support
@@ -498,6 +513,83 @@ steps:
498513
- name: deps
499514
path: /go
500515

516+
---
517+
kind: pipeline
518+
type: docker
519+
name: testing-e2e
520+
521+
platform:
522+
os: linux
523+
arch: amd64
524+
525+
depends_on:
526+
- compliance
527+
528+
trigger:
529+
event:
530+
- pull_request
531+
532+
volumes:
533+
- name: deps
534+
temp: {}
535+
536+
services:
537+
- name: pgsql
538+
pull: default
539+
image: postgres:10
540+
environment:
541+
POSTGRES_DB: testgitea-e2e
542+
POSTGRES_PASSWORD: postgres
543+
POSTGRES_INITDB_ARGS: --encoding=UTF8 --lc-collate='en_US.UTF-8' --lc-ctype='en_US.UTF-8'
544+
545+
steps:
546+
- name: deps-frontend
547+
image: node:18
548+
pull: always
549+
commands:
550+
- make deps-frontend
551+
552+
- name: generate-frontend
553+
image: golang:1.18
554+
commands:
555+
- make generate-frontend
556+
557+
- name: build-frontend
558+
image: node:18
559+
commands:
560+
- make frontend
561+
depends_on: [deps-frontend, generate-frontend]
562+
563+
- name: deps-backend
564+
image: golang:1.18
565+
pull: always
566+
commands:
567+
- make deps-backend
568+
volumes:
569+
- name: deps
570+
path: /go
571+
572+
# TODO: We should probably build all dependencies into a test image
573+
- name: test-e2e
574+
image: mcr.microsoft.com/playwright:v1.24.0-focal
575+
commands:
576+
- curl -sLO https://go.dev/dl/go1.18.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.18.linux-amd64.tar.gz
577+
- groupadd --gid 1001 gitea && useradd -m --gid 1001 --uid 1001 gitea
578+
- apt-get -qq update && apt-get -qqy install build-essential
579+
- export TEST_PGSQL_SCHEMA=''
580+
- ./build/test-env-prepare.sh
581+
- su gitea bash -c "export PATH=$PATH:/usr/local/go/bin && timeout -s ABRT 40m make test-e2e-pgsql"
582+
environment:
583+
GOPROXY: https://goproxy.io
584+
GOSUMDB: sum.golang.org
585+
USE_REPO_TEST_DIR: 1
586+
TEST_PGSQL_DBNAME: 'testgitea-e2e'
587+
DEBIAN_FRONTEND: noninteractive
588+
depends_on: [build-frontend, deps-backend]
589+
volumes:
590+
- name: deps
591+
path: /go
592+
501593
---
502594
kind: pipeline
503595
name: update_translations
@@ -653,12 +745,13 @@ steps:
653745
pull: always
654746
commands:
655747
# Upgrade to node 18 once https://github.com/techknowlogick/xgo/issues/163 is resolved
656-
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
748+
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get -qqy install nodejs
657749
- export PATH=$PATH:$GOPATH/bin
658750
- make release
659751
environment:
660752
GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
661753
TAGS: bindata sqlite sqlite_unlock_notify
754+
DEBIAN_FRONTEND: noninteractive
662755
volumes:
663756
- name: deps
664757
path: /go
@@ -773,12 +866,13 @@ steps:
773866
pull: always
774867
commands:
775868
# Upgrade to node 18 once https://github.com/techknowlogick/xgo/issues/163 is resolved
776-
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
869+
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get -qqy install nodejs
777870
- export PATH=$PATH:$GOPATH/bin
778871
- make release
779872
environment:
780873
GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
781874
TAGS: bindata sqlite sqlite_unlock_notify
875+
DEBIAN_FRONTEND: noninteractive
782876
depends_on: [fetch-tags]
783877
volumes:
784878
- name: deps

.eslintrc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ rules:
4646
accessor-pairs: [2]
4747
array-bracket-newline: [0]
4848
array-bracket-spacing: [2, never]
49-
array-callback-return: [0]
49+
array-callback-return: [2, {checkForEach: true}]
5050
array-element-newline: [0]
5151
arrow-body-style: [0]
5252
arrow-parens: [2, always]

.gitignore

+9-15
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,14 @@ cpu.out
6363
/indexers
6464
/log
6565
/public/img/avatar
66-
/integrations/gitea-integration-mysql
67-
/integrations/gitea-integration-mysql8
68-
/integrations/gitea-integration-pgsql
69-
/integrations/gitea-integration-sqlite
70-
/integrations/gitea-integration-mssql
71-
/integrations/indexers-mysql
72-
/integrations/indexers-mysql8
73-
/integrations/indexers-pgsql
74-
/integrations/indexers-sqlite
75-
/integrations/indexers-mssql
76-
/integrations/sqlite.ini
77-
/integrations/mysql.ini
78-
/integrations/mysql8.ini
79-
/integrations/pgsql.ini
80-
/integrations/mssql.ini
66+
/tests/integration/gitea-integration-*
67+
/tests/integration/indexers-*
68+
/tests/e2e/gitea-e2e-*
69+
/tests/e2e/indexers-*
70+
/tests/e2e/reports
71+
/tests/e2e/test-artifacts
72+
/tests/e2e/test-snapshots
73+
/tests/*.ini
8174
/node_modules
8275
/yarn.lock
8376
/yarn-error.log
@@ -102,6 +95,7 @@ cpu.out
10295
!/web_src/fomantic/build/themes/default/assets/fonts/outline-icons.woff2
10396
/VERSION
10497
/.air
98+
/.go-licenses
10599

106100
# Snapcraft
107101
snap/.snapcraft/

.golangci.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ linters-settings:
4040
stylecheck:
4141
checks: ["all", "-ST1005", "-ST1003"]
4242
nakedret:
43-
max-func-lines: 0
43+
max-func-lines: 0
4444
gocritic:
4545
disabled-checks:
4646
- ifElseChain
@@ -86,6 +86,8 @@ linters-settings:
8686
- github.com/unknwon/com: "use gitea's util and replacements"
8787

8888
issues:
89+
max-issues-per-linter: 0
90+
max-same-issues: 0
8991
exclude-rules:
9092
# Exclude some linters from running on tests files.
9193
- path: _test\.go

CONTRIBUTING.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@ Here's how to run the test suite:
8686
| | |
8787
| :------------------------------------- | :----------------------------------------------- |
8888
|``make test[\#TestSpecificName]`` | run unit test |
89-
|``make test-sqlite[\#TestSpecificName]``| run [integration](integrations) test for SQLite |
90-
|[More details about integrations](integrations/README.md) |
89+
|``make test-sqlite[\#TestSpecificName]``| run [integration](tests/integration) test for SQLite |
90+
|[More details about integration tests](tests/integration/README.md) |
91+
|``make test-e2e-sqlite[\#TestSpecificFileName]``| run [end-to-end](tests/e2e) test for SQLite |
92+
|[More details about e2e tests](tests/e2e/README.md) |
9193

9294
## Vendoring
9395

@@ -168,7 +170,7 @@ import (
168170

169171
To maintain understandable code and avoid circular dependencies it is important to have a good structure of the code. The Gitea code is divided into the following parts:
170172

171-
- **integration:** Integrations tests
173+
- **integration:** Integration tests
172174
- **models:** Contains the data structures used by xorm to construct database tables. It also contains supporting functions to query and update the database. Dependencies to other code in Gitea should be avoided although some modules might be needed (for example for logging).
173175
- **models/fixtures:** Sample model data used in integration tests.
174176
- **models/migrations:** Handling of database migrations between versions. PRs that changes a database structure shall also have a migration step.

MAINTAINERS

+1
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ Gusted <[email protected]) (@Gusted)
4848
silentcode <[email protected]> (@silentcodeg)
4949
Wim <[email protected]> (@42wim)
5050
xinyu <[email protected]> (@penlinux)
51+
Jason Song <[email protected]> (@wolfogre)

0 commit comments

Comments
 (0)