Skip to content

Commit c22b916

Browse files
committed
Merge branch 'master' into benchmark_tests
2 parents b5842ea + 6341130 commit c22b916

File tree

336 files changed

+13127
-6440
lines changed

Some content is hidden

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

336 files changed

+13127
-6440
lines changed

.drone.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,17 @@ steps:
7070
- make checks-backend
7171
depends_on: [lint-backend]
7272

73+
- name: test-frontend
74+
image: node:14
75+
commands:
76+
- make test-frontend
77+
depends_on: [lint-frontend]
78+
7379
- name: build-frontend
7480
image: node:14
7581
commands:
7682
- make frontend
77-
depends_on: [lint-frontend]
83+
depends_on: [test-frontend]
7884

7985
- name: build-backend-no-gcc
8086
pull: always
@@ -570,7 +576,7 @@ steps:
570576
pull: always
571577
image: techknowlogick/xgo:go-1.16.x
572578
commands:
573-
- curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt -y install nodejs bsdtar\|libarchive-tools
579+
- curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs
574580
- export PATH=$PATH:$GOPATH/bin
575581
- make release
576582
environment:
@@ -667,7 +673,7 @@ steps:
667673
pull: always
668674
image: techknowlogick/xgo:go-1.16.x
669675
commands:
670-
- curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs bsdtar\|libarchive-tools
676+
- curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs
671677
- export PATH=$PATH:$GOPATH/bin
672678
- make release
673679
environment:

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ insert_final_newline = true
1212
[*.{go,tmpl,html}]
1313
indent_style = tab
1414

15+
[templates/custom/*.tmpl]
16+
insert_final_newline = false
17+
18+
[templates/swagger/v1_json.tmpl]
19+
indent_style = space
20+
1521
[Makefile]
1622
indent_style = tab
1723

.eslintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ overrides:
5252
rules:
5353
import/no-unresolved: [0]
5454
import/no-extraneous-dependencies: [0]
55+
- files: ["*.test.js"]
56+
env:
57+
jest: true
58+
- files: ["*.config.js"]
59+
rules:
60+
import/no-unused-modules: [0]
5561

5662
rules:
5763
accessor-pairs: [2]

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ cpu.out
8282
/public/fonts
8383
/public/img/webpack
8484
/web_src/fomantic/node_modules
85-
/web_src/fomantic/semantic.json
8685
/web_src/fomantic/build/*
8786
!/web_src/fomantic/build/semantic.js
8887
!/web_src/fomantic/build/semantic.css
@@ -96,7 +95,6 @@ cpu.out
9695
!/web_src/fomantic/build/themes/default/assets/fonts/outline-icons.woff2
9796
/VERSION
9897
/.air
99-
/.npm-cache
10098

10199
# Snapcraft
102100
snap/.snapcraft/

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
audit=false
22
fund=false
3+
update-notifier=false
34
package-lock=true
45
save-exact=true
5-
cache=.npm-cache

CHANGELOG.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ This changelog goes through all the changes that have been made in each release
44
without substantial changes to our git log; to see the highlights of what has
55
been added to each release, please refer to the [blog](https://blog.gitea.io).
66

7-
## [1.14.0-RC1](https://github.com/go-gitea/gitea/releases/tag/v1.14.0-rc1) - 2021-03-19
7+
## [1.14.0](https://github.com/go-gitea/gitea/releases/tag/v1.14.0) - 2021-04-11
88

99
* SECURITY
1010
* Respect approved email domain list for externally validated user registration (#15014)
1111
* Add reverse proxy configuration support for remote IP address detection (#14959)
1212
* Ensure validation occurs on clone addresses too (#14994)
1313
* Fix several render issues highlighted during fuzzing (#14986)
1414
* BREAKING
15+
* Fix double 'push tag' action feed (#15078) (#15083)
16+
* Remove possible resource leak (#15067) (#15082)
17+
* Handle unauthorized user events gracefully (#15071) (#15074)
1518
* Restore Access.log following migration to Chi framework (Stops access logging of /api/internal routes) (#14475)
1619
* Migrate from Macaron to Chi framework (#14293)
1720
* Deprecate building for mips (#14174)
@@ -42,6 +45,7 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
4245
* Dump github/gitlab/gitea repository data to a local directory and restore to gitea (#12244)
4346
* Create Rootless Docker image (#10154)
4447
* API
48+
* Speedup issue search (#15179) (#15192)
4549
* Get pull, return head branch sha, even if deleted (#14931)
4650
* Export LFS & TimeTracking function status (#14753)
4751
* Show Gitea version in swagger (#14654)
@@ -66,6 +70,20 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
6670
* Add more filters to issues search (#13514)
6771
* Add review request api (#11355)
6872
* BUGFIXES
73+
* Fix delete nonexist oauth application 500 and prevent deadlock (#15384) (#15396)
74+
* Always set the merge base used to merge the commit (#15352) (#15385)
75+
* Upgrade to bluemonday 1.0.7 (#15379) (#15380)
76+
* Turn RepoRef and RepoAssignment back into func(*Context) (#15372) (#15377)
77+
* Move FCGI req.URL.Path fix-up to the FCGI listener (#15292) (#15361)
78+
* Show diff on rename with diff changes (#15338) (#15339)
79+
* Fix handling of logout event (#15323) (#15337)
80+
* Fix CanCreateRepo check (#15311) (#15321)
81+
* Fix xorm log stack level (#15285) (#15316)
82+
* Fix bug in Wrap (#15302) (#15309)
83+
* Drop the event source if we are unauthorized (#15275) (#15280)
84+
* Backport Fix graph pagination (#15225) (#15249)
85+
* Prevent NPE in CommentMustAsDiff if no hunk header (#15199) (#15200)
86+
* should run RetrieveRepoMetas() for empty pr (#15187) (#15190)
6987
* Move setting to enable closing issue via commit in non default branch to repo settings (#14965)
7088
* Show correct issues for team dashboard (#14952)
7189
* Ensure that new pull request button works on forked forks owned by owner of the root and reduce ambiguity (#14932)
@@ -122,6 +140,9 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
122140
* Use GO variable in go-check target (#13146) (#13147)
123141
* ENHANCEMENTS
124142
* UI style improvements
143+
* Dropzone styling improvements (#15291) (#15374)
144+
* Add size to Save function (#15264) (#15270)
145+
* Monaco improvements (#15333) (#15345)
125146
* Support .mailmap in code activity stats (#15009)
126147
* Sort release attachments by name (#15008)
127148
* Add ui.explore settings to control view of explore pages (#14094)
@@ -267,6 +288,31 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
267288
* Reduce make verbosity (#13803)
268289
* Add git command error directory on log (#13194)
269290

291+
## [1.13.7](https://github.com/go-gitea/gitea/releases/tag/v1.13.7) - 2021-04-07
292+
293+
* SECURITY
294+
* Update to bluemonday-1.0.6 (#15294) (#15298)
295+
* Clusterfuzz found another way (#15160) (#15169)
296+
* API
297+
* Fix wrong user returned in API (#15139) (#15150)
298+
* BUGFIXES
299+
* Add 'fonts' into 'KnownPublicEntries' (#15188) (#15317)
300+
* Speed up `enry.IsVendor` (#15213) (#15246)
301+
* Response 404 for diff/patch of a commit that not exist (#15221) (#15238)
302+
* Prevent NPE in CommentMustAsDiff if no hunk header (#15199) (#15201)
303+
* MISC
304+
* Add size to Save function (#15264) (#15271)
305+
306+
## [1.13.6](https://github.com/go-gitea/gitea/releases/tag/v1.13.6) - 2021-03-23
307+
308+
* SECURITY
309+
* Fix bug on avatar middleware (#15124) (#15125)
310+
* Fix another clusterfuzz identified issue (#15096) (#15114)
311+
* API
312+
* Fix nil exeption for get pull reviews API #15104 (#15106)
313+
* BUGFIXES
314+
* Fix markdown rendering in milestone content (#15056) (#15092)
315+
270316
## [1.13.5](https://github.com/go-gitea/gitea/releases/tag/v1.13.5) - 2021-03-21
271317

272318
* SECURITY

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ Karl Heinz Marbaise <[email protected]> (@khmarbaise)
4141
Norwin Roosen <[email protected]> (@noerw)
4242
Kyle Dumont <[email protected]> (@kdumontnu)
4343
Patrick Schratz <[email protected]> (@pat-s)
44+
Janis Estelmann <[email protected]> (@KN4CK3R)

Makefile

Lines changed: 30 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ else
1414

1515
# This is the "normal" part of the Makefile
1616

17-
TAR := $(shell hash bsdtar > /dev/null 2>&1 && echo "bsdtar --no-xattrs" || echo "tar" )
18-
1917
DIST := dist
2018
DIST_DIRS := $(DIST)/binaries $(DIST)/release
2119
IMPORT := code.gitea.io/gitea
@@ -28,7 +26,7 @@ COMMA := ,
2826

2927
XGO_VERSION := go-1.16.x
3028
MIN_GO_VERSION := 001014000
31-
MIN_NODE_VERSION := 010013000
29+
MIN_NODE_VERSION := 012017000
3230

3331
DOCKER_IMAGE ?= gitea/gitea
3432
DOCKER_TAG ?= latest
@@ -93,8 +91,6 @@ LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64
9391

9492
GO_PACKAGES ?= $(filter-out code.gitea.io/gitea/models/migrations code.gitea.io/gitea/integrations/migration-test code.gitea.io/gitea/integrations,$(shell $(GO) list -mod=vendor ./... | grep -v /vendor/))
9593

96-
FOMANTIC_CONFIGS := semantic.json web_src/fomantic/theme.config.less web_src/fomantic/_site/globals/site.variables
97-
FOMANTIC_DEST := web_src/fomantic/build/semantic.js web_src/fomantic/build/semantic.css
9894
FOMANTIC_WORK_DIR := web_src/fomantic
9995

10096
WEBPACK_SOURCES := $(shell find web_src/js web_src/less -type f)
@@ -115,6 +111,8 @@ TAGS_EVIDENCE := $(MAKE_EVIDENCE_DIR)/tags
115111

116112
TEST_TAGS ?= sqlite sqlite_unlock_notify
117113

114+
TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMANTIC_WORK_DIR)/node_modules $(DIST) $(MAKE_EVIDENCE_DIR) $(AIR_TMP_DIR)
115+
118116
GO_DIRS := cmd integrations models modules routers build services vendor tools
119117

120118
GO_SOURCES := $(wildcard *.go)
@@ -173,6 +171,9 @@ help:
173171
@echo " - checks run various consistency checks"
174172
@echo " - checks-frontend check frontend files"
175173
@echo " - checks-backend check backend files"
174+
@echo " - test test everything"
175+
@echo " - test-frontend test frontend files"
176+
@echo " - test-backend test backend files"
176177
@echo " - webpack build webpack files"
177178
@echo " - svg build svg files"
178179
@echo " - fomantic build fomantic files"
@@ -322,8 +323,9 @@ lint: lint-frontend lint-backend
322323

323324
.PHONY: lint-frontend
324325
lint-frontend: node_modules
325-
npx eslint --color --max-warnings=0 web_src/js build templates webpack.config.js
326+
npx eslint --color --max-warnings=0 web_src/js build templates *.config.js
326327
npx stylelint --color --max-warnings=0 web_src/less
328+
npx editorconfig-checker templates
327329

328330
.PHONY: lint-backend
329331
lint-backend: golangci-lint revive vet
@@ -345,16 +347,23 @@ watch-backend: go-check
345347
air -c .air.conf
346348

347349
.PHONY: test
348-
test:
350+
test: test-frontend test-backend
351+
352+
.PHONY: test-backend
353+
test-backend:
349354
@echo "Running go test with -tags '$(TEST_TAGS)'..."
350355
@$(GO) test $(GOTESTFLAGS) -mod=vendor -tags='$(TEST_TAGS)' $(GO_PACKAGES)
351356

357+
.PHONY: test-frontend
358+
test-frontend:
359+
@NODE_OPTIONS="--experimental-vm-modules --no-warnings" npx jest --color
360+
352361
.PHONY: test-check
353362
test-check:
354363
@echo "Running test-check...";
355364
@diff=$$(git status -s); \
356365
if [ -n "$$diff" ]; then \
357-
echo "make test has changed files in the source tree:"; \
366+
echo "make test-backend has changed files in the source tree:"; \
358367
echo "$${diff}"; \
359368
echo "You should change the tests to create these files in a temporary directory."; \
360369
echo "Do not simply add these files to .gitignore"; \
@@ -579,7 +588,7 @@ install: $(wildcard *.go)
579588
build: frontend backend
580589

581590
.PHONY: frontend
582-
frontend: node-check $(WEBPACK_DEST)
591+
frontend: $(WEBPACK_DEST)
583592

584593
.PHONY: backend
585594
backend: go-check generate $(EXECUTABLE)
@@ -644,16 +653,16 @@ release-compress: | $(DIST_DIRS)
644653
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && gxz -k -9 $${file}; done;
645654

646655
.PHONY: release-sources
647-
release-sources: | $(DIST_DIRS) npm-cache
656+
release-sources: | $(DIST_DIRS)
648657
echo $(VERSION) > $(STORED_VERSION_FILE)
649-
$(eval EXCL := --exclude=$(shell [ ! "$(TAR)" = "tar" ] && echo "^" )./)
650-
$(eval EXCL_RECURSIVE := --exclude=)
651-
$(TAR) $(EXCL)$(DIST) $(EXCL).git $(EXCL)$(MAKE_EVIDENCE_DIR) $(EXCL_RECURSIVE)node_modules $(EXCL)$(AIR_TMP_DIR) -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz .
658+
# bsdtar needs a ^ to prevent matching subdirectories
659+
$(eval EXCL := --exclude=$(shell tar --help | grep -q bsdtar && echo "^")./)
660+
tar $(addprefix $(EXCL),$(TAR_EXCLUDES)) -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz .
652661
rm -f $(STORED_VERSION_FILE)
653662

654663
.PHONY: release-docs
655664
release-docs: | $(DIST_DIRS) docs
656-
$(TAR) -czf $(DIST)/release/gitea-docs-$(VERSION).tar.gz -C ./docs/public .
665+
tar -czf $(DIST)/release/gitea-docs-$(VERSION).tar.gz -C ./docs/public .
657666

658667
.PHONY: docs
659668
docs:
@@ -666,25 +675,6 @@ node_modules: package-lock.json
666675
npm install --no-save
667676
@touch node_modules
668677

669-
.PHONY: npm-cache
670-
npm-cache: .npm-cache $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui
671-
672-
.npm-cache: package-lock.json
673-
rm -rf .npm-cache
674-
$(eval ESBUILD_VERSION := $(shell node -p "require('./package-lock.json').dependencies.esbuild.version"))
675-
npm config --userconfig=.npmrc set cache=.npm-cache
676-
rm -rf node_modules && npm install --no-save
677-
npm config --userconfig=$(FOMANTIC_WORK_DIR)/.npmrc set cache=../../.npm-cache
678-
echo $(foreach build, darwin-64 $(foreach arch,arm arm64 32 64,linux-${arch}) $(foreach arch,32 64,windows-${arch}), esbuild-${build}@$(ESBUILD_VERSION)) | tr " " "\n" | xargs -n 1 -P 4 npm cache add
679-
rm -rf $(FOMANTIC_WORK_DIR)/node_modules
680-
@touch .npm-cache
681-
682-
.PHONY: npm-uncache
683-
npm-uncache:
684-
rm -rf .npm-cache
685-
npm config --userconfig=$(FOMANTIC_WORK_DIR)/.npmrc rm cache
686-
npm config --userconfig=.npmrc rm cache
687-
688678
.PHONY: npm-update
689679
npm-update: node-check | node_modules
690680
npx updates -cu
@@ -693,30 +683,18 @@ npm-update: node-check | node_modules
693683
@touch node_modules
694684

695685
.PHONY: fomantic
696-
fomantic: $(FOMANTIC_DEST)
697-
698-
$(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui:
699-
ln -sf ../../semantic.json $(FOMANTIC_WORK_DIR)
700-
cd $(FOMANTIC_WORK_DIR); \
701-
rm -rf node_modules && mkdir node_modules && \
702-
npm install fomantic-ui; \
703-
rm -f semantic.json
704-
@touch $(FOMANTIC_WORK_DIR)/node_modules
705-
706-
$(FOMANTIC_DEST): $(FOMANTIC_CONFIGS) $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui
707-
ln -sf ../../semantic.json $(FOMANTIC_WORK_DIR)
686+
fomantic:
708687
rm -rf $(FOMANTIC_WORK_DIR)/build
709-
cd $(FOMANTIC_WORK_DIR); \
710-
cp -f theme.config.less node_modules/fomantic-ui/src/theme.config; \
711-
cp -rf _site node_modules/fomantic-ui/src/; \
712-
npx gulp -f node_modules/fomantic-ui/gulpfile.js build; \
713-
rm -f semantic.json
714-
@touch $(FOMANTIC_DEST)
688+
cd $(FOMANTIC_WORK_DIR) && npm install --no-save
689+
cp -f $(FOMANTIC_WORK_DIR)/theme.config.less $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/theme.config
690+
cp -rf $(FOMANTIC_WORK_DIR)/_site $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/
691+
cd $(FOMANTIC_WORK_DIR) && npx gulp -f node_modules/fomantic-ui/gulpfile.js build
715692

716693
.PHONY: webpack
717694
webpack: $(WEBPACK_DEST)
718695

719-
$(WEBPACK_DEST): $(WEBPACK_SOURCES) $(WEBPACK_CONFIGS) package-lock.json | node_modules
696+
$(WEBPACK_DEST): $(WEBPACK_SOURCES) $(WEBPACK_CONFIGS) package-lock.json
697+
@$(MAKE) -s node-check node_modules
720698
rm -rf $(WEBPACK_DEST_ENTRIES)
721699
npx webpack
722700
@touch $(WEBPACK_DEST)

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,11 @@ or if sqlite support is required:
7777
The `build` target is split into two sub-targets:
7878

7979
- `make backend` which requires [Go 1.13](https://golang.org/dl/) or greater.
80-
- `make frontend` which requires [Node.js 10.13](https://nodejs.org/en/download/) or greater.
80+
- `make frontend` which requires [Node.js 12.17](https://nodejs.org/en/download/) or greater and Internet connectivity to download npm dependencies.
8181

82-
If pre-built frontend files are present it is possible to only build the backend:
82+
When building from the official source tarballs which include pre-built frontend files, the `frontend` target will not be triggered, making it possible to build without Node.js and Internet connectivity.
8383

84-
TAGS="bindata" make backend
85-
86-
Parallelism is not supported for these targets, so please don't include `-j <num>`.
84+
Parallelism (`make -j <num>`) is not supported.
8785

8886
More info: https://docs.gitea.io/en-us/install-from-source/
8987

build/generate-images.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
#!/usr/bin/env node
2-
'use strict';
3-
4-
const imageminZopfli = require('imagemin-zopfli');
5-
const {optimize, extendDefaultPlugins} = require('svgo');
6-
const {fabric} = require('fabric');
7-
const {readFile, writeFile} = require('fs').promises;
8-
const {resolve} = require('path');
1+
import imageminZopfli from 'imagemin-zopfli';
2+
import {optimize, extendDefaultPlugins} from 'svgo';
3+
import {fabric} from 'fabric';
4+
import {readFile, writeFile} from 'fs/promises';
5+
import {resolve, dirname} from 'path';
6+
import {fileURLToPath} from 'url';
97

8+
const __dirname = dirname(fileURLToPath(import.meta.url));
109
const logoFile = resolve(__dirname, '../assets/logo.svg');
1110

1211
function exit(err) {

0 commit comments

Comments
 (0)