Skip to content

Commit 2258364

Browse files
authored
Merge branch 'main' into onedev-migration-fixes
2 parents 9160baf + a2e8bf5 commit 2258364

File tree

27 files changed

+663
-106
lines changed

27 files changed

+663
-106
lines changed

Makefile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ ifeq ($(HAS_GO), yes)
4848
CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
4949
endif
5050

51+
CGO_ENABLED ?= 0
52+
ifneq (,$(findstring sqlite,$(TAGS))$(findstring pam,$(TAGS)))
53+
CGO_ENABLED = 1
54+
endif
55+
56+
STATIC ?=
57+
EXTLDFLAGS ?=
58+
ifneq ($(STATIC),)
59+
EXTLDFLAGS = -extldflags "-static"
60+
endif
61+
5162
ifeq ($(GOOS),windows)
5263
IS_WINDOWS := yes
5364
else ifeq ($(patsubst Windows%,Windows,$(OS)),Windows)
@@ -746,7 +757,10 @@ security-check:
746757
go run $(GOVULNCHECK_PACKAGE) -show color ./...
747758

748759
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
749-
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
760+
ifneq ($(and $(STATIC),$(findstring pam,$(TAGS))),)
761+
$(error pam support set via TAGS doesn't support static builds)
762+
endif
763+
CGO_ENABLED="$(CGO_ENABLED)" CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(EXTLDFLAGS) $(LDFLAGS)' -o $@
750764

751765
.PHONY: release
752766
release: frontend generate release-windows release-linux release-darwin release-freebsd release-copy release-compress vendor release-sources release-check

flake.nix

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,45 @@
1111
pkgs = nixpkgs.legacyPackages.${system};
1212
in
1313
{
14-
devShells.default = pkgs.mkShell {
15-
buildInputs = with pkgs; [
16-
# generic
17-
git
18-
git-lfs
19-
gnumake
20-
gnused
21-
gnutar
22-
gzip
14+
devShells.default =
15+
with pkgs;
16+
let
17+
# only bump toolchain versions here
18+
go = go_1_24;
19+
nodejs = nodejs_24;
20+
python3 = python312;
21+
in
22+
pkgs.mkShell {
23+
buildInputs = [
24+
# generic
25+
git
26+
git-lfs
27+
gnumake
28+
gnused
29+
gnutar
30+
gzip
2331

24-
# frontend
25-
nodejs_22
32+
# frontend
33+
nodejs
2634

27-
# linting
28-
python312
29-
uv
35+
# linting
36+
python3
37+
uv
3038

31-
# backend
32-
go_1_24
33-
gofumpt
34-
sqlite
35-
];
36-
shellHook = ''
37-
export GO="${pkgs.go_1_24}/bin/go"
38-
export GOROOT="${pkgs.go_1_24}/share/go"
39-
'';
40-
};
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";
49+
50+
TAGS = "sqlite sqlite_unlock_notify";
51+
STATIC = "true";
52+
};
4153
}
4254
);
4355
}

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module code.gitea.io/gitea
22

3-
go 1.24.5
3+
go 1.24.6
44

55
// rfc5280 said: "The serial number is an integer assigned by the CA to each certificate."
66
// But some CAs use negative serial number, just relax the check. related:
@@ -27,7 +27,7 @@ require (
2727
github.com/ProtonMail/go-crypto v1.2.0
2828
github.com/PuerkitoBio/goquery v1.10.3
2929
github.com/SaveTheRbtz/zstd-seekable-format-go/pkg v0.7.3
30-
github.com/alecthomas/chroma/v2 v2.17.0
30+
github.com/alecthomas/chroma/v2 v2.20.0
3131
github.com/aws/aws-sdk-go-v2/credentials v1.17.67
3232
github.com/aws/aws-sdk-go-v2/service/codecommit v1.28.2
3333
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ github.com/SaveTheRbtz/zstd-seekable-format-go/pkg v0.7.3/go.mod h1:hMNtySovKkn2
7878
github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0=
7979
github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k=
8080
github.com/alecthomas/chroma/v2 v2.2.0/go.mod h1:vf4zrexSH54oEjJ7EdB65tGNHmH3pGZmVkgTP5RHvAs=
81-
github.com/alecthomas/chroma/v2 v2.17.0 h1:3r2Cgk+nXNICMBxIFGnTRTbQFUwMiLisW+9uos0TtUI=
82-
github.com/alecthomas/chroma/v2 v2.17.0/go.mod h1:RVX6AvYm4VfYe/zsk7mjHueLDZor3aWCNE14TFlepBk=
81+
github.com/alecthomas/chroma/v2 v2.20.0 h1:sfIHpxPyR07/Oylvmcai3X/exDlE8+FA820NTz+9sGw=
82+
github.com/alecthomas/chroma/v2 v2.20.0/go.mod h1:e7tViK0xh/Nf4BYHl00ycY6rV7b8iXBksI9E359yNmA=
8383
github.com/alecthomas/repr v0.0.0-20220113201626-b1b626ac65ae/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8=
84-
github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc=
85-
github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
84+
github.com/alecthomas/repr v0.5.1 h1:E3G4t2QbHTSNpPKBgMTln5KLkZHLOcU7r37J4pXBuIg=
85+
github.com/alecthomas/repr v0.5.1/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
8686
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa h1:LHTHcTQiSGT7VVbI0o4wBRNQIgn917usHWOd6VAffYI=
8787
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4=
8888
github.com/anchore/archiver/v3 v3.5.2 h1:Bjemm2NzuRhmHy3m0lRe5tNoClB9A4zYyDV58PaB6aA=

modules/markup/orgmode/orgmode_test.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,10 @@ func TestRender_Source(t *testing.T) {
9797
assert.Equal(t, strings.TrimSpace(expected), strings.TrimSpace(buffer))
9898
}
9999

100-
test(`#+begin_src go
101-
// HelloWorld prints "Hello World"
102-
func HelloWorld() {
103-
fmt.Println("Hello World")
104-
}
100+
test(`#+begin_src c
101+
int a;
105102
#+end_src
106-
`, `<div class="src src-go">
107-
<pre><code class="chroma language-go"><span class="c1">// HelloWorld prints &#34;Hello World&#34;</span>
108-
<span class="kd">func</span> <span class="nf">HelloWorld</span><span class="p">()</span> <span class="p">{</span>
109-
<span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="s">&#34;Hello World&#34;</span><span class="p">)</span>
110-
<span class="p">}</span></code></pre>
103+
`, `<div class="src src-c">
104+
<pre><code class="chroma language-c"><span class="kt">int</span> <span class="n">a</span><span class="p">;</span></code></pre>
111105
</div>`)
112106
}

modules/setting/actions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var (
2424
ZombieTaskTimeout time.Duration `ini:"ZOMBIE_TASK_TIMEOUT"`
2525
EndlessTaskTimeout time.Duration `ini:"ENDLESS_TASK_TIMEOUT"`
2626
AbandonedJobTimeout time.Duration `ini:"ABANDONED_JOB_TIMEOUT"`
27-
SkipWorkflowStrings []string `ìni:"SKIP_WORKFLOW_STRINGS"`
27+
SkipWorkflowStrings []string `ini:"SKIP_WORKFLOW_STRINGS"`
2828
}{
2929
Enabled: true,
3030
DefaultActionsURL: defaultActionsURLGitHub,

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+
}

modules/structs/repo.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ type Repository struct {
8484
Updated time.Time `json:"updated_at"`
8585
ArchivedAt time.Time `json:"archived_at"`
8686
Permissions *Permission `json:"permissions,omitempty"`
87+
HasCode bool `json:"has_code"`
8788
HasIssues bool `json:"has_issues"`
8889
InternalTracker *InternalTracker `json:"internal_tracker,omitempty"`
8990
ExternalTracker *ExternalTracker `json:"external_tracker,omitempty"`
@@ -170,6 +171,8 @@ type EditRepoOption struct {
170171
Private *bool `json:"private,omitempty"`
171172
// either `true` to make this repository a template or `false` to make it a normal repository
172173
Template *bool `json:"template,omitempty"`
174+
// either `true` to enable code for this repository or `false` to disable it.
175+
HasCode *bool `json:"has_code,omitempty"`
173176
// either `true` to enable issues for this repository or `false` to disable them.
174177
HasIssues *bool `json:"has_issues,omitempty"`
175178
// set this structure to configure internal issue tracker

options/locale/locale_fr-FR.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,6 +1322,7 @@ commit_graph.color=Couleur
13221322
commit.contained_in=Cette révision appartient à :
13231323
commit.contained_in_default_branch=Cette révision appartient à la branche par défaut
13241324
commit.load_referencing_branches_and_tags=Charger les branches et étiquettes référençant cette révision
1325+
commit.merged_in_pr=Cette révision a été fusionnée dans la demande d’ajout %s.
13251326
blame=Annotations
13261327
download_file=Télécharger le fichier
13271328
normal_view=Vue normale

options/locale/locale_ga-IE.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,6 +1322,7 @@ commit_graph.color=Dath
13221322
commit.contained_in=Tá an tiomantas seo le fáil i:
13231323
commit.contained_in_default_branch=Tá an tiomantas seo mar chuid den bhrainse réamhshocraithe
13241324
commit.load_referencing_branches_and_tags=Luchtaigh brainsí agus clibeanna a thagraíonn an tiomantas
1325+
commit.merged_in_pr=Cuireadh an tiomantas seo le chéile san iarratas tarraingthe %s.
13251326
blame=An milleán
13261327
download_file=Íoslódáil comhad
13271328
normal_view=Amharc Gnáth

0 commit comments

Comments
 (0)