Skip to content

Commit b84a143

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Refactor smal code snippeds in models/issues/pull.go (go-gitea#35301) fix: remove duplicate IDs (go-gitea#35210) Add start time on perf trace because it seems some steps haven't been recorded. (go-gitea#35282) nix dev shell add zip (go-gitea#35300) [skip ci] Updated translations via Crowdin Fix LFS range size header response (go-gitea#35277) Skip "parentsigned" check when the repo is empty (go-gitea#35292) [skip ci] Updated translations via Crowdin Fix GitHub release assets URL validation (go-gitea#35287) nix flake use go1.25 (go-gitea#35288) go1.25.0 (go-gitea#35262) fix nix dev shell on darwin (go-gitea#35278) Fix token lifetime, closes go-gitea#35230 (go-gitea#35271) OneDev migration: fix broken migration caused by various REST API changes in OneDev 7.8.0 and later (go-gitea#35216) [skip ci] Updated translations via Crowdin Fix font-size in inline code comment preview (go-gitea#35209) Fix a bug where lfs gc never worked. (go-gitea#35198)
2 parents 0f8c04d + 57b8441 commit b84a143

File tree

20 files changed

+679
-428
lines changed

20 files changed

+679
-428
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM docker.io/library/golang:1.24-alpine3.22 AS build-env
2+
FROM docker.io/library/golang:1.25-alpine3.22 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY=${GOPROXY:-direct}

Dockerfile.rootless

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM docker.io/library/golang:1.24-alpine3.22 AS build-env
2+
FROM docker.io/library/golang:1.25-alpine3.22 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY=${GOPROXY:-direct}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ SHASUM ?= shasum -a 256
2323
HAS_GO := $(shell hash $(GO) > /dev/null 2>&1 && echo yes)
2424
COMMA := ,
2525

26-
XGO_VERSION := go-1.24.x
26+
XGO_VERSION := go-1.25.x
2727

2828
AIR_PACKAGE ?= github.com/air-verse/air@v1
2929
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3

flake.lock

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

flake.nix

Lines changed: 41 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,54 @@
1515
with pkgs;
1616
let
1717
# only bump toolchain versions here
18-
go = go_1_24;
18+
go = go_1_25;
1919
nodejs = nodejs_24;
2020
python3 = python312;
21+
22+
# Platform-specific dependencies
23+
linuxOnlyInputs = lib.optionals pkgs.stdenv.isLinux [
24+
glibc.static
25+
];
26+
27+
linuxOnlyEnv = lib.optionalAttrs pkgs.stdenv.isLinux {
28+
CFLAGS = "-I${glibc.static.dev}/include";
29+
LDFLAGS = "-L ${glibc.static}/lib";
30+
};
2131
in
22-
pkgs.mkShell {
23-
buildInputs = [
24-
# generic
25-
git
26-
git-lfs
27-
gnumake
28-
gnused
29-
gnutar
30-
gzip
32+
pkgs.mkShell (
33+
{
34+
buildInputs = [
35+
# generic
36+
git
37+
git-lfs
38+
gnumake
39+
gnused
40+
gnutar
41+
gzip
42+
zip
3143

32-
# frontend
33-
nodejs
44+
# frontend
45+
nodejs
3446

35-
# linting
36-
python3
37-
uv
47+
# linting
48+
python3
49+
uv
3850

39-
# backend
40-
go
41-
glibc.static
42-
gofumpt
43-
sqlite
44-
];
45-
CFLAGS = "-I${glibc.static.dev}/include";
46-
LDFLAGS = "-L ${glibc.static}/lib";
47-
GO = "${go}/bin/go";
48-
GOROOT = "${go}/share/go";
51+
# backend
52+
go
53+
gofumpt
54+
sqlite
55+
]
56+
++ linuxOnlyInputs;
57+
58+
GO = "${go}/bin/go";
59+
GOROOT = "${go}/share/go";
4960

50-
TAGS = "sqlite sqlite_unlock_notify";
51-
STATIC = "true";
52-
};
61+
TAGS = "sqlite sqlite_unlock_notify";
62+
STATIC = "true";
63+
}
64+
// linuxOnlyEnv
65+
);
5366
}
5467
);
5568
}

models/issues/pull.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import (
2929

3030
var ErrMustCollaborator = util.NewPermissionDeniedErrorf("user must be a collaborator")
3131

32+
const reviewedBy = "Reviewed-by: "
33+
3234
// ErrPullRequestNotExist represents a "PullRequestNotExist" kind of error.
3335
type ErrPullRequestNotExist struct {
3436
ID int64
@@ -348,7 +350,11 @@ type ReviewCount struct {
348350
func (pr *PullRequest) GetApprovalCounts(ctx context.Context) ([]*ReviewCount, error) {
349351
rCounts := make([]*ReviewCount, 0, 6)
350352
sess := db.GetEngine(ctx).Where("issue_id = ?", pr.IssueID)
351-
return rCounts, sess.Select("issue_id, type, count(id) as `count`").Where("official = ? AND dismissed = ?", true, false).GroupBy("issue_id, type").Table("review").Find(&rCounts)
353+
return rCounts, sess.Select("issue_id, type, count(id) as `count`").
354+
Where(builder.Eq{"official": true, "dismissed": false}).
355+
GroupBy("issue_id, type").
356+
Table("review").
357+
Find(&rCounts)
352358
}
353359

354360
// GetApprovers returns the approvers of the pull request
@@ -392,7 +398,7 @@ func (pr *PullRequest) getReviewedByLines(ctx context.Context, writer io.Writer)
392398
} else if review.Reviewer == nil {
393399
continue
394400
}
395-
if _, err := writer.Write([]byte("Reviewed-by: ")); err != nil {
401+
if _, err := writer.Write([]byte(reviewedBy)); err != nil {
396402
return err
397403
}
398404
if _, err := writer.Write([]byte(review.Reviewer.NewGitSig().String())); err != nil {

modules/gtprof/trace_builtin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (t *traceBuiltinSpan) toString(out *strings.Builder, indent int) {
4040
if t.ts.endTime.IsZero() {
4141
out.WriteString(" duration: (not ended)")
4242
} else {
43-
fmt.Fprintf(out, " duration=%.4fs", t.ts.endTime.Sub(t.ts.startTime).Seconds())
43+
fmt.Fprintf(out, " start=%s duration=%.4fs", t.ts.startTime.Format("2006-01-02 15:04:05"), t.ts.endTime.Sub(t.ts.startTime).Seconds())
4444
}
4545
for _, a := range t.ts.attributes {
4646
out.WriteString(" ")

modules/setting/cron_test.go

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,56 @@ EXTEND = true
4141
assert.Equal(t, "white rabbit", extended.Second)
4242
assert.True(t, extended.Extend)
4343
}
44+
45+
// Test_getCronSettings2 tests that getCronSettings can not handle two levels of embedding
46+
func Test_getCronSettings2(t *testing.T) {
47+
type BaseStruct struct {
48+
Enabled bool
49+
RunAtStart bool
50+
Schedule string
51+
}
52+
53+
type Extended struct {
54+
BaseStruct
55+
Extend bool
56+
}
57+
type Extended2 struct {
58+
Extended
59+
Third string
60+
}
61+
62+
iniStr := `
63+
[cron.test]
64+
ENABLED = TRUE
65+
RUN_AT_START = TRUE
66+
SCHEDULE = @every 1h
67+
EXTEND = true
68+
THIRD = white rabbit
69+
`
70+
cfg, err := NewConfigProviderFromData(iniStr)
71+
assert.NoError(t, err)
72+
73+
extended := &Extended2{
74+
Extended: Extended{
75+
BaseStruct: BaseStruct{
76+
Enabled: false,
77+
RunAtStart: false,
78+
Schedule: "@every 72h",
79+
},
80+
Extend: false,
81+
},
82+
Third: "black rabbit",
83+
}
84+
85+
_, err = getCronSettings(cfg, "test", extended)
86+
assert.NoError(t, err)
87+
88+
// This confirms the first level of embedding works
89+
assert.Equal(t, "white rabbit", extended.Third)
90+
assert.True(t, extended.Extend)
91+
92+
// This confirms 2 levels of embedding doesn't work
93+
assert.False(t, extended.Enabled)
94+
assert.False(t, extended.RunAtStart)
95+
assert.Equal(t, "@every 72h", extended.Schedule)
96+
}

0 commit comments

Comments
 (0)