Skip to content

Commit c36d353

Browse files
committed
Merge remote-tracking branch 'origin/main' into coloris
* origin/main: Remove jQuery `.attr` from the Fomantic modal cancel buttons (go-gitea#30113) Remove jQuery `.attr` from the code comments (go-gitea#30112) Remove jQuery calls that have no effect on `showElem` and `hideElem` (go-gitea#30110) Remove jQuery `.attr` from the common issue page functions (go-gitea#30083) Restore aligned grid column CSS (go-gitea#30106) Fix possible data race on tests (go-gitea#30093) Add svg linter and fix incorrect svgs (go-gitea#30086) Fix duplicate migrated milestones (go-gitea#30102) Update JS any PY dependencies, remove workarounds (go-gitea#30085) Fix gitea doctor will remove repo-avatar files when execute command `storage-archives` (go-gitea#30094) Fix alignment in actions right view (go-gitea#29979) Remove repetitive words (go-gitea#30091) Fix table header text-align (go-gitea#30084) Fix panic for `fixBrokenRepoUnits16961` (go-gitea#30068)
2 parents 22f7b91 + f47e00d commit c36d353

File tree

27 files changed

+470
-407
lines changed

27 files changed

+470
-407
lines changed

.github/workflows/files-changed.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ jobs:
7373
- "Makefile"
7474
7575
templates:
76+
- "tools/lint-templates-*.js"
7677
- "templates/**/*.tmpl"
7778
- "pyproject.toml"
7879
- "poetry.lock"

.github/workflows/pull-compliance.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ jobs:
3535
- uses: actions/setup-python@v5
3636
with:
3737
python-version: "3.12"
38+
- uses: actions/setup-node@v4
39+
with:
40+
node-version: 20
3841
- run: pip install poetry
3942
- run: make deps-py
43+
- run: make deps-frontend
4044
- run: make lint-templates
4145

4246
lint-yaml:

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,8 @@ lint-actions:
434434
$(GO) run $(ACTIONLINT_PACKAGE)
435435

436436
.PHONY: lint-templates
437-
lint-templates: .venv
437+
lint-templates: .venv node_modules
438+
@node tools/lint-templates-svg.js
438439
@poetry run djlint $(shell find templates -type f -iname '*.tmpl')
439440

440441
.PHONY: lint-yaml

package-lock.json

Lines changed: 202 additions & 215 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
"@github/text-expander-element": "2.6.1",
1414
"@mcaptcha/vanilla-glue": "0.1.0-alpha-3",
1515
"@melloware/coloris": "0.23.0",
16-
"@primer/octicons": "19.8.0",
16+
"@primer/octicons": "19.9.0",
1717
"add-asset-webpack-plugin": "2.0.1",
1818
"ansi_up": "6.0.2",
19-
"asciinema-player": "3.7.0",
19+
"asciinema-player": "3.7.1",
2020
"chart.js": "4.4.2",
2121
"chartjs-adapter-dayjs-4": "1.0.4",
2222
"chartjs-plugin-zoom": "2.0.1",
@@ -31,15 +31,15 @@
3131
"htmx.org": "1.9.11",
3232
"idiomorph": "0.3.0",
3333
"jquery": "3.7.1",
34-
"katex": "0.16.9",
34+
"katex": "0.16.10",
3535
"license-checker-webpack-plugin": "0.2.1",
3636
"mermaid": "10.9.0",
3737
"mini-css-extract-plugin": "2.8.1",
3838
"minimatch": "9.0.3",
3939
"monaco-editor": "0.47.0",
4040
"monaco-editor-webpack-plugin": "7.1.0",
4141
"pdfobject": "2.3.0",
42-
"postcss": "8.4.35",
42+
"postcss": "8.4.38",
4343
"postcss-loader": "8.1.1",
4444
"postcss-nesting": "12.1.0",
4545
"pretty-ms": "9.0.0",
@@ -58,7 +58,7 @@
5858
"vue-chartjs": "5.3.0",
5959
"vue-loader": "17.4.2",
6060
"vue3-calendar-heatmap": "2.0.5",
61-
"webpack": "5.90.3",
61+
"webpack": "5.91.0",
6262
"webpack-cli": "5.1.4",
6363
"wrap-ansi": "9.0.0"
6464
},
@@ -76,24 +76,24 @@
7676
"eslint-plugin-jquery": "1.5.1",
7777
"eslint-plugin-no-jquery": "2.7.0",
7878
"eslint-plugin-no-use-extend-native": "0.5.0",
79-
"eslint-plugin-regexp": "2.3.0",
79+
"eslint-plugin-regexp": "2.4.0",
8080
"eslint-plugin-sonarjs": "0.24.0",
8181
"eslint-plugin-unicorn": "51.0.1",
82-
"eslint-plugin-vitest": "0.3.26",
83-
"eslint-plugin-vitest-globals": "1.4.0",
84-
"eslint-plugin-vue": "9.23.0",
85-
"eslint-plugin-vue-scoped-css": "2.7.2",
82+
"eslint-plugin-vitest": "0.4.0",
83+
"eslint-plugin-vitest-globals": "1.5.0",
84+
"eslint-plugin-vue": "9.24.0",
85+
"eslint-plugin-vue-scoped-css": "2.8.0",
8686
"eslint-plugin-wc": "2.0.4",
87-
"happy-dom": "14.2.0",
87+
"happy-dom": "14.3.7",
8888
"markdownlint-cli": "0.39.0",
8989
"postcss-html": "1.6.0",
90-
"stylelint": "16.2.1",
90+
"stylelint": "16.3.0",
9191
"stylelint-declaration-block-no-ignored-properties": "2.8.0",
9292
"stylelint-declaration-strict-value": "1.10.4",
9393
"svgo": "3.2.0",
94-
"updates": "15.3.1",
94+
"updates": "16.0.0",
9595
"vite-string-plugin": "1.1.5",
96-
"vitest": "1.3.1"
96+
"vitest": "1.4.0"
9797
},
9898
"browserslist": [
9999
"defaults"

poetry.lock

Lines changed: 3 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

routers/api/v1/repo/file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func GetRawFileOrLFS(ctx *context.APIContext) {
145145
return
146146
}
147147

148-
// OK, now the blob is known to have at most 1024 bytes we can simply read this in in one go (This saves reading it twice)
148+
// OK, now the blob is known to have at most 1024 bytes we can simply read this in one go (This saves reading it twice)
149149
dataRc, err := blob.DataAsync()
150150
if err != nil {
151151
ctx.ServerError("DataAsync", err)

routers/web/repo/issue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,7 @@ func ViewIssue(ctx *context.Context) {
16011601
}
16021602
marked[issue.PosterID] = issue.ShowRole
16031603

1604-
// Render comments and and fetch participants.
1604+
// Render comments and fetch participants.
16051605
participants[0] = issue.Poster
16061606

16071607
if err := issue.Comments.LoadAttachmentsByIssue(ctx); err != nil {

services/doctor/fix16961.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ func fixBrokenRepoUnit16961(repoUnit *repo_model.RepoUnit, bs []byte) (fixed boo
216216
return false, nil
217217
}
218218

219+
var cfg any
220+
err = json.UnmarshalHandleDoubleEncode(bs, &cfg)
221+
if err == nil {
222+
return false, nil
223+
}
224+
219225
switch repoUnit.Type {
220226
case unit.TypeCode, unit.TypeReleases, unit.TypeWiki, unit.TypeProjects:
221227
cfg := &repo_model.UnitConfig{}

services/doctor/storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func checkStorage(opts *checkStorageOptions) func(ctx context.Context, logger lo
162162
if opts.RepoArchives || opts.All {
163163
if err := commonCheckStorage(ctx, logger, autofix,
164164
&commonStorageCheckOptions{
165-
storer: storage.RepoAvatars,
165+
storer: storage.RepoArchives,
166166
isOrphaned: func(path string, obj storage.Object, stat fs.FileInfo) (bool, error) {
167167
exists, err := repo.ExistsRepoArchiverWithStoragePath(ctx, path)
168168
if err == nil || errors.Is(err, util.ErrInvalidArgument) {

services/migrations/migrate.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,13 @@ func migrateRepository(ctx context.Context, doer *user_model.User, downloader ba
250250
}
251251
log.Warn("migrating milestones is not supported, ignored")
252252
}
253-
254253
msBatchSize := uploader.MaxBatchInsertSize("milestone")
255254
for len(milestones) > 0 {
256255
if len(milestones) < msBatchSize {
257256
msBatchSize = len(milestones)
258257
}
259258

260-
if err := uploader.CreateMilestones(milestones...); err != nil {
259+
if err := uploader.CreateMilestones(milestones[:msBatchSize]...); err != nil {
261260
return err
262261
}
263262
milestones = milestones[msBatchSize:]

services/webhook/deliver_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ func TestWebhookDeliverAuthorizationHeader(t *testing.T) {
107107
err := hook.SetHeaderAuthorization("Bearer s3cr3t-t0ken")
108108
assert.NoError(t, err)
109109
assert.NoError(t, webhook_model.CreateWebhook(db.DefaultContext, hook))
110-
db.GetEngine(db.DefaultContext).NoAutoTime().DB().Logger.ShowSQL(true)
111110

112111
hookTask := &webhook_model.HookTask{
113112
HookID: hook.ID,

templates/devtest/flex-list.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</div>
2626
<div class="flex-item-trailing">
2727
<button class="ui tiny red button">
28-
{{svg "octicon-warning" 14}} CJK文本测试
28+
{{svg "octicon-alert" 14}} CJK文本测试
2929
</button>
3030
<button class="ui tiny primary button">
3131
{{svg "octicon-info" 14}} Button
@@ -54,7 +54,7 @@
5454
</div>
5555
<div class="flex-item-trailing">
5656
<button class="ui tiny red button">
57-
{{svg "octicon-warning" 12}} CJK文本测试 <!-- single CJK text test, it shouldn't be horizontal -->
57+
{{svg "octicon-alert" 12}} CJK文本测试 <!-- single CJK text test, it shouldn't be horizontal -->
5858
</button>
5959
</div>
6060
</div>

templates/repo/diff/comment_form.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{{end}}
2727

2828
<div class="field footer tw-mx-2">
29-
<span class="markup-info">{{svg "octicon-markup"}} {{ctx.Locale.Tr "repo.diff.comment.markdown_info"}}</span>
29+
<span class="markup-info">{{svg "octicon-markdown"}} {{ctx.Locale.Tr "repo.diff.comment.markdown_info"}}</span>
3030
<div class="tw-text-right">
3131
{{if $.reply}}
3232
<button class="ui submit primary tiny button btn-reply" type="submit">{{ctx.Locale.Tr "repo.diff.comment.reply"}}</button>

tests/e2e/e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func TestMain(m *testing.M) {
7575

7676
// TestE2e should be the only test e2e necessary. It will collect all "*.test.e2e.js" files in this directory and build a test for each.
7777
func TestE2e(t *testing.T) {
78-
// Find the paths of all e2e test files in test test directory.
78+
// Find the paths of all e2e test files in test directory.
7979
searchGlob := filepath.Join(filepath.Dir(setting.AppPath), "tests", "e2e", "*.test.e2e.js")
8080
paths, err := filepath.Glob(searchGlob)
8181
if err != nil {

tools/lint-templates-svg.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env node
2+
import {readdirSync, readFileSync} from 'node:fs';
3+
import {parse, relative} from 'node:path';
4+
import {fileURLToPath} from 'node:url';
5+
import {exit} from 'node:process';
6+
import fastGlob from 'fast-glob';
7+
8+
const knownSvgs = new Set();
9+
for (const file of readdirSync(new URL('../public/assets/img/svg', import.meta.url))) {
10+
knownSvgs.add(parse(file).name);
11+
}
12+
13+
const rootPath = fileURLToPath(new URL('..', import.meta.url));
14+
let hadErrors = false;
15+
16+
for (const file of fastGlob.sync(fileURLToPath(new URL('../templates/**/*.tmpl', import.meta.url)))) {
17+
const content = readFileSync(file, 'utf8');
18+
for (const [_, name] of content.matchAll(/svg ["'`]([^"'`]+)["'`]/g)) {
19+
if (!knownSvgs.has(name)) {
20+
console.info(`SVG "${name}" not found, used in ${relative(rootPath, file)}`);
21+
hadErrors = true;
22+
}
23+
}
24+
}
25+
26+
exit(hadErrors ? 1 : 0);

web_src/css/modules/grid.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,15 @@
406406
align-self: center !important;
407407
}
408408

409+
.ui[class*="left aligned"].grid > .column,
410+
.ui[class*="left aligned"].grid > .row > .column,
411+
.ui.grid > [class*="left aligned"].row > .column,
412+
.ui.grid > [class*="left aligned"].column.column,
413+
.ui.grid > .row > [class*="left aligned"].column.column {
414+
text-align: left;
415+
align-self: inherit;
416+
}
417+
409418
.ui[class*="center aligned"].grid > .column,
410419
.ui[class*="center aligned"].grid > .row > .column,
411420
.ui.grid > [class*="center aligned"].row > .column,
@@ -418,6 +427,15 @@
418427
justify-content: center;
419428
}
420429

430+
.ui[class*="right aligned"].grid > .column,
431+
.ui[class*="right aligned"].grid > .row > .column,
432+
.ui.grid > [class*="right aligned"].row > .column,
433+
.ui.grid > [class*="right aligned"].column.column,
434+
.ui.grid > .row > [class*="right aligned"].column.column {
435+
text-align: right;
436+
align-self: inherit;
437+
}
438+
421439
.ui[class*="equal width"].grid > .column:not(.row),
422440
.ui[class*="equal width"].grid > .row > .column,
423441
.ui.grid > [class*="equal width"].row > .column {

web_src/css/modules/table.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@
2323
}
2424
.ui.table > thead,
2525
.ui.table > tbody {
26+
text-align: inherit;
2627
vertical-align: inherit;
2728
}
2829

2930
.ui.table > thead > tr > th {
3031
background: var(--color-box-header);
32+
text-align: inherit;
3133
color: var(--color-text);
3234
padding: 6px 5px;
3335
vertical-align: inherit;
@@ -52,6 +54,7 @@
5254
.ui.table > tfoot > tr > td {
5355
border-top: 1px solid var(--color-secondary);
5456
background: var(--color-box-body);
57+
text-align: inherit;
5558
color: var(--color-text);
5659
padding: 0.78571429em;
5760
vertical-align: inherit;
@@ -78,6 +81,7 @@
7881
.ui.table > tbody > tr > td {
7982
border-top: 1px solid var(--color-secondary-alpha-50);
8083
padding: 6px 5px;
84+
text-align: inherit;
8185
}
8286
.ui.table > tr:first-child > td,
8387
.ui.table > tbody > tr:first-child > td {

web_src/js/components/RepoActionView.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,8 @@ export function initRepositoryActionView() {
628628
flex-direction: column;
629629
border: 1px solid var(--color-console-border);
630630
border-radius: var(--border-radius);
631+
background: var(--color-console-bg);
632+
align-self: flex-start;
631633
}
632634
633635
/* begin fomantic button overrides */
@@ -687,10 +689,8 @@ export function initRepositoryActionView() {
687689
justify-content: space-between;
688690
align-items: center;
689691
padding: 0 12px;
690-
background-color: var(--color-console-bg);
691692
position: sticky;
692693
top: 0;
693-
border-radius: var(--border-radius);
694694
height: 60px;
695695
z-index: 1;
696696
}
@@ -711,7 +711,6 @@ export function initRepositoryActionView() {
711711
}
712712
713713
.job-step-container {
714-
background-color: var(--color-console-bg);
715714
max-height: 100%;
716715
border-radius: 0 0 var(--border-radius) var(--border-radius);
717716
border-top: 1px solid var(--color-console-border);

0 commit comments

Comments
 (0)