Skip to content

Commit 346547b

Browse files
committed
Merge remote-tracking branch 'giteaoffical/main'
* giteaoffical/main: (89 commits) Move some files under repo/setting (go-gitea#25585) Following-up improvments for various PRs (go-gitea#25620) Set SSH_AUTHORIZED_KEYS_BACKUP to false (go-gitea#25412) Fix bug of branches API with tests (go-gitea#25578) [skip ci] Updated translations via Crowdin Application as a maintainer (go-gitea#25614) Adding branch-name copy to clipboard branches screen. (go-gitea#25596) Use AfterCommitId to get commit for Viewed functionality (go-gitea#25529) Fix branch commit message too long problem (go-gitea#25588) Restrict `[actions].DEFAULT_ACTIONS_URL` to only `github` or `self` (go-gitea#25581) Add API for changing Avatars (go-gitea#25369) read-only checkboxes don't appear and don't entirely act the way one might expect (go-gitea#25573) Redirect to package after version deletion (go-gitea#25594) Update emoji set to Unicode 15 (go-gitea#25595) Fix `lint-swagger` action (go-gitea#25593) Replace fomantic divider module with our own (go-gitea#25539) Add documentation about supported workflow trigger events (go-gitea#25582) Sync branches into databases (go-gitea#22743) Fix milestones deletion (go-gitea#25583) Reduce table padding globally (go-gitea#25568) ... # Conflicts: # templates/repo/wiki/revision.tmpl
2 parents 3e8a29d + aab7cb6 commit 346547b

File tree

414 files changed

+7072
-4213
lines changed

Some content is hidden

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

414 files changed

+7072
-4213
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"ghcr.io/devcontainers/features/node:1": {
77
"version":"20"
88
},
9-
"ghcr.io/devcontainers/features/git-lfs:1.1.0": {}
9+
"ghcr.io/devcontainers/features/git-lfs:1.1.0": {},
10+
"ghcr.io/devcontainers-contrib/features/poetry:2": {},
11+
"ghcr.io/devcontainers/features/python:1": {}
1012
},
1113
"customizations": {
1214
"vscode": {

.eslintrc.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ env:
2525
es2022: true
2626
node: true
2727

28-
globals:
29-
__webpack_public_path__: true
30-
3128
overrides:
29+
- files: ["web_src/**/*"]
30+
globals:
31+
__webpack_public_path__: true
32+
process: false # https://github.com/webpack/webpack/issues/15833
3233
- files: ["web_src/**/*", "docs/**/*"]
3334
env:
3435
browser: true

.github/workflows/files-changed.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,21 @@ on:
1515
value: ${{ jobs.detect.outputs.templates }}
1616
docker:
1717
value: ${{ jobs.detect.outputs.docker }}
18+
swagger:
19+
value: ${{ jobs.detect.outputs.swagger }}
1820

1921
jobs:
2022
detect:
2123
runs-on: ubuntu-latest
2224
timeout-minutes: 3
23-
# Map a step output to a job output
2425
outputs:
2526
backend: ${{ steps.changes.outputs.backend }}
2627
frontend: ${{ steps.changes.outputs.frontend }}
2728
docs: ${{ steps.changes.outputs.docs }}
2829
actions: ${{ steps.changes.outputs.actions }}
2930
templates: ${{ steps.changes.outputs.templates }}
3031
docker: ${{ steps.changes.outputs.docker }}
32+
swagger: ${{ steps.changes.outputs.swagger }}
3133
steps:
3234
- uses: actions/checkout@v3
3335
- uses: dorny/paths-filter@v2
@@ -37,14 +39,18 @@ jobs:
3739
backend:
3840
- "**/*.go"
3941
- "templates/**/*.tmpl"
42+
- "assets/emoji.json"
4043
- "go.mod"
4144
- "go.sum"
45+
- "Makefile"
4246
4347
frontend:
4448
- "**/*.js"
4549
- "web_src/**"
50+
- "assets/emoji.json"
4651
- "package.json"
4752
- "package-lock.json"
53+
- "Makefile"
4854
4955
docs:
5056
- "**/*.md"
@@ -56,7 +62,12 @@ jobs:
5662
templates:
5763
- "templates/**/*.tmpl"
5864
- "poetry.lock"
65+
5966
docker:
6067
- "Dockerfile"
6168
- "Dockerfile.rootless"
6269
- "docker/**"
70+
- "Makefile"
71+
72+
swagger:
73+
- "templates/swagger/v1_json.tmpl"

.github/workflows/pull-compliance.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ jobs:
3939
- run: make deps-py
4040
- run: make lint-templates
4141

42+
lint-swagger:
43+
if: needs.files-changed.outputs.swagger == 'true'
44+
needs: files-changed
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v3
48+
- uses: actions/setup-node@v3
49+
with:
50+
node-version: 20
51+
- run: make deps-frontend
52+
- run: make lint-swagger
53+
4254
lint-go-windows:
4355
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
4456
needs: files-changed
@@ -96,6 +108,7 @@ jobs:
96108
- run: make deps-frontend
97109
- run: make lint-frontend
98110
- run: make checks-frontend
111+
- run: make test-frontend
99112
- run: make frontend
100113

101114
backend:
@@ -110,7 +123,7 @@ jobs:
110123
check-latest: true
111124
# no frontend build here as backend should be able to build
112125
# even without any frontend files
113-
- run: make deps-backend deps-tools
126+
- run: make deps-backend
114127
- run: go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
115128
- name: build-backend-arm64
116129
run: make backend # test cross compile

.stylelintrc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ rules:
5050
declaration-no-important: null
5151
declaration-property-max-values: null
5252
declaration-property-unit-allowed-list: null
53-
declaration-property-unit-disallowed-list: null
53+
declaration-property-unit-disallowed-list: {line-height: [em]}
5454
declaration-property-value-allowed-list: null
5555
declaration-property-value-disallowed-list: null
5656
declaration-property-value-no-unknown: true

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@ Xinyi Gong <[email protected]> (@HesterG)
5252
wxiaoguang <[email protected]> (@wxiaoguang)
5353
Gary Moon <[email protected]> (@garymoon)
5454
Philip Peterson <[email protected]> (@philip-peterson)
55+
Denys Konovalov <[email protected]> (@denyskon)

Makefile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ GITHUB_REF_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
8484

8585
ifneq ($(GITHUB_REF_TYPE),branch)
8686
VERSION ?= $(subst v,,$(GITHUB_REF_NAME))
87-
GITEA_VERSION ?= $(GITHUB_REF_NAME)
87+
GITEA_VERSION ?= $(VERSION)
8888
else
8989
ifneq ($(GITHUB_REF_NAME),)
9090
VERSION ?= $(subst release/v,,$(GITHUB_REF_NAME))
@@ -226,6 +226,8 @@ help:
226226
@echo " - test-frontend test frontend files"
227227
@echo " - test-backend test backend files"
228228
@echo " - test-e2e[\#TestSpecificName] test end to end using playwright"
229+
@echo " - update-js update js dependencies"
230+
@echo " - update-py update py dependencies"
229231
@echo " - webpack build webpack files"
230232
@echo " - svg build svg files"
231233
@echo " - fomantic build fomantic files"
@@ -358,10 +360,10 @@ lint: lint-frontend lint-backend
358360
lint-fix: lint-frontend-fix lint-backend-fix
359361

360362
.PHONY: lint-frontend
361-
lint-frontend: lint-js lint-css lint-md lint-swagger
363+
lint-frontend: lint-js lint-css
362364

363365
.PHONY: lint-frontend-fix
364-
lint-frontend-fix: lint-js-fix lint-css-fix lint-md lint-swagger
366+
lint-frontend-fix: lint-js-fix lint-css-fix
365367

366368
.PHONY: lint-backend
367369
lint-backend: lint-go lint-go-vet lint-editorconfig
@@ -924,13 +926,20 @@ node_modules: package-lock.json
924926
poetry install
925927
@touch .venv
926928

927-
.PHONY: npm-update
928-
npm-update: node-check | node_modules
929-
npx updates -cu
929+
.PHONY: update-js
930+
update-js: node-check | node_modules
931+
npx updates -u -f package.json
930932
rm -rf node_modules package-lock.json
931933
npm install --package-lock
932934
@touch node_modules
933935

936+
.PHONY: update-py
937+
update-py: node-check | node_modules
938+
npx updates -u -f pyproject.toml
939+
rm -rf .venv poetry.lock
940+
poetry install
941+
@touch .venv
942+
934943
.PHONY: fomantic
935944
fomantic:
936945
rm -rf $(FOMANTIC_WORK_DIR)/build

assets/emoji.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/generate-emoji.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525

2626
const (
2727
gemojiURL = "https://raw.githubusercontent.com/github/gemoji/master/db/emoji.json"
28-
maxUnicodeVersion = 14
28+
maxUnicodeVersion = 15
2929
)
3030

3131
var flagOut = flag.String("o", "modules/emoji/emoji_data.go", "out")

cmd/cmd.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,21 @@ func setupConsoleLogger(level log.Level, colorize bool, out io.Writer) {
106106
WriterOption: log.WriterConsoleOption{Stderr: out == os.Stderr},
107107
}
108108
writer := log.NewEventWriterConsole("console-default", writeMode)
109-
log.GetManager().GetLogger(log.DEFAULT).RemoveAllWriters().AddWriters(writer)
109+
log.GetManager().GetLogger(log.DEFAULT).ReplaceAllWriters(writer)
110+
}
111+
112+
// PrepareConsoleLoggerLevel by default, use INFO level for console logger, but some sub-commands (for git/ssh protocol) shouldn't output any log to stdout.
113+
// Any log appears in git stdout pipe will break the git protocol, eg: client can't push and hangs forever.
114+
func PrepareConsoleLoggerLevel(defaultLevel log.Level) func(*cli.Context) error {
115+
return func(c *cli.Context) error {
116+
level := defaultLevel
117+
if c.Bool("quiet") || c.GlobalBoolT("quiet") {
118+
level = log.FATAL
119+
}
120+
if c.Bool("debug") || c.GlobalBool("debug") || c.Bool("verbose") || c.GlobalBool("verbose") {
121+
level = log.TRACE
122+
}
123+
log.SetConsoleLogger(log.DEFAULT, "console-default", level)
124+
return nil
125+
}
110126
}

0 commit comments

Comments
 (0)