Skip to content

Commit f4c5144

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: (21 commits) Use 8 as default value for git lfs concurrency (go-gitea#32421) Fix milestone deadline and date related problems (go-gitea#32339) Only query team tables if repository is under org when getting assignees (go-gitea#32414) Refactor RepoRefByType (go-gitea#32413) Refactor template ctx and render utils (go-gitea#32422) Refactor DateUtils and merge TimeSince (go-gitea#32409) Refactor markup package (go-gitea#32399) Add some handy markdown editor features (go-gitea#32400) Make LFS http_client parallel within a batch. (go-gitea#32369) Refactor repo legacy (go-gitea#32404) Replace DateTime with proper functions (go-gitea#32402) Fix git error handling (go-gitea#32401) Fix created_unix for mirroring (go-gitea#32342) Replace DateTime with DateUtils (go-gitea#32383) improve performance of diffs (go-gitea#32393) Refactor tests to prevent from unnecessary preparations (go-gitea#32398) Add artifacts test fixture (go-gitea#30300) Fix `missing signature key` error when pulling Docker images with `SERVE_DIRECT` enabled (go-gitea#32365) Fix a number of typescript issues (go-gitea#32308) Update go dependencies (go-gitea#32389) ...
2 parents b594773 + 41b4ef8 commit f4c5144

File tree

237 files changed

+6073
-5356
lines changed

Some content is hidden

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

237 files changed

+6073
-5356
lines changed

.eslintrc.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ plugins:
2727
- "@stylistic/eslint-plugin-js"
2828
- "@typescript-eslint/eslint-plugin"
2929
- eslint-plugin-array-func
30-
- eslint-plugin-deprecation
3130
- eslint-plugin-github
3231
- eslint-plugin-i
3332
- eslint-plugin-no-jquery
@@ -248,6 +247,7 @@ rules:
248247
"@typescript-eslint/no-base-to-string": [0]
249248
"@typescript-eslint/no-confusing-non-null-assertion": [2]
250249
"@typescript-eslint/no-confusing-void-expression": [0]
250+
"@typescript-eslint/no-deprecated": [2]
251251
"@typescript-eslint/no-dupe-class-members": [0]
252252
"@typescript-eslint/no-duplicate-enum-values": [2]
253253
"@typescript-eslint/no-duplicate-type-constituents": [2, {ignoreUnions: true}]
@@ -359,7 +359,6 @@ rules:
359359
default-case-last: [2]
360360
default-case: [0]
361361
default-param-last: [0]
362-
deprecation/deprecation: [2]
363362
dot-notation: [0]
364363
eqeqeq: [2]
365364
for-direction: [2]
@@ -816,6 +815,7 @@ rules:
816815
unicorn/catch-error-name: [0]
817816
unicorn/consistent-destructuring: [2]
818817
unicorn/consistent-empty-array-spread: [2]
818+
unicorn/consistent-existence-index-check: [0]
819819
unicorn/consistent-function-scoping: [2]
820820
unicorn/custom-error-definition: [0]
821821
unicorn/empty-brace-spaces: [2]
@@ -892,10 +892,12 @@ rules:
892892
unicorn/prefer-dom-node-text-content: [2]
893893
unicorn/prefer-event-target: [2]
894894
unicorn/prefer-export-from: [0]
895+
unicorn/prefer-global-this: [0]
895896
unicorn/prefer-includes: [2]
896897
unicorn/prefer-json-parse-buffer: [0]
897898
unicorn/prefer-keyboard-event-key: [2]
898899
unicorn/prefer-logical-operator-over-ternary: [2]
900+
unicorn/prefer-math-min-max: [2]
899901
unicorn/prefer-math-trunc: [2]
900902
unicorn/prefer-modern-dom-apis: [0]
901903
unicorn/prefer-modern-math-apis: [2]

assets/go-licenses.json

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

custom/conf/app.example.ini

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2642,9 +2642,15 @@ LEVEL = Info
26422642
;; override the azure blob base path if storage type is azureblob
26432643
;AZURE_BLOB_BASE_PATH = lfs/
26442644

2645+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2646+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2647+
;; settings for Gitea's LFS client (eg: mirroring an upstream lfs endpoint)
2648+
;;
26452649
;[lfs_client]
2646-
;; When mirroring an upstream lfs endpoint, limit the number of pointers in each batch request to this number
2650+
;; Limit the number of pointers in each batch request to this number
26472651
;BATCH_SIZE = 20
2652+
;; Limit the number of concurrent upload/download operations within a batch
2653+
;BATCH_OPERATION_CONCURRENCY = 8
26482654

26492655
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
26502656
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

go.mod

Lines changed: 95 additions & 98 deletions
Large diffs are not rendered by default.

go.sum

Lines changed: 226 additions & 236 deletions
Large diffs are not rendered by default.

models/actions/schedule_spec_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,17 @@ import (
77
"testing"
88
"time"
99

10+
"code.gitea.io/gitea/modules/test"
11+
1012
"github.com/stretchr/testify/assert"
1113
"github.com/stretchr/testify/require"
1214
)
1315

1416
func TestActionScheduleSpec_Parse(t *testing.T) {
1517
// Mock the local timezone is not UTC
16-
local := time.Local
1718
tz, err := time.LoadLocation("Asia/Shanghai")
1819
require.NoError(t, err)
19-
defer func() {
20-
time.Local = local
21-
}()
22-
time.Local = tz
20+
defer test.MockVariableValue(&time.Local, tz)()
2321

2422
now, err := time.Parse(time.RFC3339, "2024-07-31T15:47:55+08:00")
2523
require.NoError(t, err)
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
-
2+
id: 1
3+
run_id: 791
4+
runner_id: 1
5+
repo_id: 4
6+
owner_id: 1
7+
commit_sha: c2d72f548424103f01ee1dc02889c1e2bff816b0
8+
storage_path: "26/1/1712166500347189545.chunk"
9+
file_size: 1024
10+
file_compressed_size: 1024
11+
content_encoding: ""
12+
artifact_path: "abc.txt"
13+
artifact_name: "artifact-download"
14+
status: 1
15+
created_unix: 1712338649
16+
updated_unix: 1712338649
17+
expired_unix: 1720114649
18+
19+
-
20+
id: 19
21+
run_id: 791
22+
runner_id: 1
23+
repo_id: 4
24+
owner_id: 1
25+
commit_sha: c2d72f548424103f01ee1dc02889c1e2bff816b0
26+
storage_path: "26/19/1712348022422036662.chunk"
27+
file_size: 1024
28+
file_compressed_size: 1024
29+
content_encoding: ""
30+
artifact_path: "abc.txt"
31+
artifact_name: "multi-file-download"
32+
status: 2
33+
created_unix: 1712348022
34+
updated_unix: 1712348022
35+
expired_unix: 1720124022
36+
37+
-
38+
id: 20
39+
run_id: 791
40+
runner_id: 1
41+
repo_id: 4
42+
owner_id: 1
43+
commit_sha: c2d72f548424103f01ee1dc02889c1e2bff816b0
44+
storage_path: "26/20/1712348022423431524.chunk"
45+
file_size: 1024
46+
file_compressed_size: 1024
47+
content_encoding: ""
48+
artifact_path: "xyz/def.txt"
49+
artifact_name: "multi-file-download"
50+
status: 2
51+
created_unix: 1712348022
52+
updated_unix: 1712348022
53+
expired_unix: 1720124022
54+
55+
-
56+
id: 22
57+
run_id: 792
58+
runner_id: 1
59+
repo_id: 4
60+
owner_id: 1
61+
commit_sha: c2d72f548424103f01ee1dc02889c1e2bff816b0
62+
storage_path: "27/5/1730330775594233150.chunk"
63+
file_size: 1024
64+
file_compressed_size: 1024
65+
content_encoding: "application/zip"
66+
artifact_path: "artifact-v4-download.zip"
67+
artifact_name: "artifact-v4-download"
68+
status: 2
69+
created_unix: 1730330775
70+
updated_unix: 1730330775
71+
expired_unix: 1738106775

models/issues/milestone.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,9 @@ func (m *Milestone) BeforeUpdate() {
8484
// this object.
8585
func (m *Milestone) AfterLoad() {
8686
m.NumOpenIssues = m.NumIssues - m.NumClosedIssues
87-
if m.DeadlineUnix.Year() == 9999 {
87+
if m.DeadlineUnix == 0 {
8888
return
8989
}
90-
9190
m.DeadlineString = m.DeadlineUnix.FormatDate()
9291
if m.IsClosed {
9392
m.IsOverdue = m.ClosedDateUnix >= m.DeadlineUnix

models/migrations/migrations.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ func prepareMigrationTasks() []*migration {
364364
newMigration(304, "Add index for release sha1", v1_23.AddIndexForReleaseSha1),
365365
newMigration(305, "Add Repository Licenses", v1_23.AddRepositoryLicenses),
366366
newMigration(306, "Add BlockAdminMergeOverride to ProtectedBranch", v1_23.AddBlockAdminMergeOverrideBranchProtection),
367+
newMigration(307, "Fix milestone deadline_unix when there is no due date", v1_23.FixMilestoneNoDueDate),
367368
}
368369
return preparedMigrations
369370
}

models/migrations/v1_23/v307.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2024 The Gitea Authors. All rights reserved.
2+
// SPDX-License-Identifier: MIT
3+
4+
package v1_23 //nolint
5+
6+
import (
7+
"code.gitea.io/gitea/modules/timeutil"
8+
9+
"xorm.io/xorm"
10+
)
11+
12+
func FixMilestoneNoDueDate(x *xorm.Engine) error {
13+
type Milestone struct {
14+
DeadlineUnix timeutil.TimeStamp
15+
}
16+
// Wednesday, December 1, 9999 12:00:00 AM GMT+00:00
17+
_, err := x.Table("milestone").Where("deadline_unix > 253399622400").
18+
Cols("deadline_unix").
19+
Update(&Milestone{DeadlineUnix: 0})
20+
return err
21+
}

0 commit comments

Comments
 (0)