Skip to content

Commit 4d7ea0d

Browse files
authored
Merge branch 'go-gitea:main' into main
2 parents a3c2953 + 0534edd commit 4d7ea0d

File tree

36 files changed

+716
-143
lines changed

36 files changed

+716
-143
lines changed

cmd/dump_repo.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ wiki, issues, labels, releases, release_assets, milestones, pull_requests, comme
8080
}
8181

8282
func runDumpRepository(ctx *cli.Context) error {
83+
setupConsoleLogger(log.INFO, log.CanColorStderr, os.Stderr)
84+
85+
setting.DisableLoggerInit()
86+
setting.LoadSettings() // cannot access skip_tls_verify settings otherwise
87+
8388
stdCtx, cancel := installSignals()
8489
defer cancel()
8590

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.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1
317317

318318
replace github.com/shurcooL/vfsgen => github.com/lunny/vfsgen v0.0.0-20220105142115-2c99e1ffdfa0
319319

320-
replace github.com/nektos/act => gitea.com/gitea/act v0.261.4
320+
replace github.com/nektos/act => gitea.com/gitea/act v0.261.6
321321

322322
// TODO: the only difference is in `PutObject`: the fork doesn't use `NewVerifyingReader(r, sha256.New(), oid, expectedSize)`, need to figure out why
323323
replace github.com/charmbracelet/git-lfs-transfer => gitea.com/gitea/git-lfs-transfer v0.2.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
1414
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
1515
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
1616
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
17-
gitea.com/gitea/act v0.261.4 h1:Tf9eLlvsYFtKcpuxlMvf9yT3g4Hshb2Beqw6C1STuH8=
18-
gitea.com/gitea/act v0.261.4/go.mod h1:Pg5C9kQY1CEA3QjthjhlrqOC/QOT5NyWNjOjRHw23Ok=
17+
gitea.com/gitea/act v0.261.6 h1:CjZwKOyejonNFDmsXOw3wGm5Vet573hHM6VMLsxtvPY=
18+
gitea.com/gitea/act v0.261.6/go.mod h1:Pg5C9kQY1CEA3QjthjhlrqOC/QOT5NyWNjOjRHw23Ok=
1919
gitea.com/gitea/git-lfs-transfer v0.2.0 h1:baHaNoBSRaeq/xKayEXwiDQtlIjps4Ac/Ll4KqLMB40=
2020
gitea.com/gitea/git-lfs-transfer v0.2.0/go.mod h1:UrXUCm3xLQkq15fu7qlXHUMlrhdlXHoi13KH2Dfiits=
2121
gitea.com/gitea/go-xsd-duration v0.0.0-20220703122237-02e73435a078 h1:BAFmdZpRW7zMQZQDClaCWobRj9uL1MR3MzpCVJvc5s4=

models/actions/utils.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,22 @@ func calculateDuration(started, stopped timeutil.TimeStamp, status Status) time.
8282
}
8383
return timeSince(s).Truncate(time.Second)
8484
}
85+
86+
// best effort function to convert an action schedule to action run, to be used in GenerateGiteaContext
87+
func (s *ActionSchedule) ToActionRun() *ActionRun {
88+
return &ActionRun{
89+
Title: s.Title,
90+
RepoID: s.RepoID,
91+
Repo: s.Repo,
92+
OwnerID: s.OwnerID,
93+
WorkflowID: s.WorkflowID,
94+
TriggerUserID: s.TriggerUserID,
95+
TriggerUser: s.TriggerUser,
96+
Ref: s.Ref,
97+
CommitSHA: s.CommitSHA,
98+
Event: s.Event,
99+
EventPayload: s.EventPayload,
100+
Created: s.Created,
101+
Updated: s.Updated,
102+
}
103+
}

models/migrations/v1_23/v302.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ func AddIndexToActionTaskStoppedLogExpired(x *xorm.Engine) error {
1414
Stopped timeutil.TimeStamp `xorm:"index(stopped_log_expired)"`
1515
LogExpired bool `xorm:"index(stopped_log_expired)"`
1616
}
17-
return x.Sync(new(ActionTask))
17+
_, err := x.SyncWithOptions(xorm.SyncOptions{
18+
IgnoreDropIndices: true,
19+
}, new(ActionTask))
20+
return err
1821
}

models/migrations/v1_23/v302_test.go

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Copyright 2025 The Gitea Authors. All rights reserved.
2+
// SPDX-License-Identifier: MIT
3+
4+
package v1_23 //nolint
5+
6+
import (
7+
"testing"
8+
9+
"code.gitea.io/gitea/models/migrations/base"
10+
"code.gitea.io/gitea/modules/timeutil"
11+
12+
"github.com/stretchr/testify/assert"
13+
)
14+
15+
func Test_AddIndexToActionTaskStoppedLogExpired(t *testing.T) {
16+
type ActionTask struct {
17+
ID int64
18+
JobID int64
19+
Attempt int64
20+
RunnerID int64 `xorm:"index"`
21+
Status int `xorm:"index"`
22+
Started timeutil.TimeStamp `xorm:"index"`
23+
Stopped timeutil.TimeStamp `xorm:"index(stopped_log_expired)"`
24+
25+
RepoID int64 `xorm:"index"`
26+
OwnerID int64 `xorm:"index"`
27+
CommitSHA string `xorm:"index"`
28+
IsForkPullRequest bool
29+
30+
Token string `xorm:"-"`
31+
TokenHash string `xorm:"UNIQUE"` // sha256 of token
32+
TokenSalt string
33+
TokenLastEight string `xorm:"index token_last_eight"`
34+
35+
LogFilename string // file name of log
36+
LogInStorage bool // read log from database or from storage
37+
LogLength int64 // lines count
38+
LogSize int64 // blob size
39+
LogIndexes []int64 `xorm:"LONGBLOB"` // line number to offset
40+
LogExpired bool `xorm:"index(stopped_log_expired)"` // files that are too old will be deleted
41+
42+
Created timeutil.TimeStamp `xorm:"created"`
43+
Updated timeutil.TimeStamp `xorm:"updated index"`
44+
}
45+
46+
// Prepare and load the testing database
47+
x, deferable := base.PrepareTestEnv(t, 0, new(ActionTask))
48+
defer deferable()
49+
50+
assert.NoError(t, AddIndexToActionTaskStoppedLogExpired(x))
51+
}

models/migrations/v1_23/v304.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ func AddIndexForReleaseSha1(x *xorm.Engine) error {
99
type Release struct {
1010
Sha1 string `xorm:"INDEX VARCHAR(64)"`
1111
}
12-
return x.Sync(new(Release))
12+
_, err := x.SyncWithOptions(xorm.SyncOptions{
13+
IgnoreDropIndices: true,
14+
}, new(Release))
15+
return err
1316
}

models/migrations/v1_23/v304_test.go

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright 2025 The Gitea Authors. All rights reserved.
2+
// SPDX-License-Identifier: MIT
3+
4+
package v1_23 //nolint
5+
6+
import (
7+
"testing"
8+
9+
"code.gitea.io/gitea/models/migrations/base"
10+
"code.gitea.io/gitea/modules/timeutil"
11+
12+
"github.com/stretchr/testify/assert"
13+
)
14+
15+
func Test_AddIndexForReleaseSha1(t *testing.T) {
16+
type Release struct {
17+
ID int64 `xorm:"pk autoincr"`
18+
RepoID int64 `xorm:"INDEX UNIQUE(n)"`
19+
PublisherID int64 `xorm:"INDEX"`
20+
TagName string `xorm:"INDEX UNIQUE(n)"`
21+
OriginalAuthor string
22+
OriginalAuthorID int64 `xorm:"index"`
23+
LowerTagName string
24+
Target string
25+
Title string
26+
Sha1 string `xorm:"VARCHAR(64)"`
27+
NumCommits int64
28+
Note string `xorm:"TEXT"`
29+
IsDraft bool `xorm:"NOT NULL DEFAULT false"`
30+
IsPrerelease bool `xorm:"NOT NULL DEFAULT false"`
31+
IsTag bool `xorm:"NOT NULL DEFAULT false"` // will be true only if the record is a tag and has no related releases
32+
CreatedUnix timeutil.TimeStamp `xorm:"INDEX"`
33+
}
34+
35+
// Prepare and load the testing database
36+
x, deferable := base.PrepareTestEnv(t, 0, new(Release))
37+
defer deferable()
38+
39+
assert.NoError(t, AddIndexForReleaseSha1(x))
40+
}

modules/git/commit.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ type CommitsCountOptions struct {
166166
Not string
167167
Revision []string
168168
RelPath []string
169+
Since string
170+
Until string
169171
}
170172

171173
// CommitsCount returns number of total commits of until given revision.
@@ -199,8 +201,8 @@ func (c *Commit) CommitsCount() (int64, error) {
199201
}
200202

201203
// CommitsByRange returns the specific page commits before current revision, every page's number default by CommitsRangeSize
202-
func (c *Commit) CommitsByRange(page, pageSize int, not string) ([]*Commit, error) {
203-
return c.repo.commitsByRange(c.ID, page, pageSize, not)
204+
func (c *Commit) CommitsByRange(page, pageSize int, not, since, until string) ([]*Commit, error) {
205+
return c.repo.commitsByRangeWithTime(c.ID, page, pageSize, not, since, until)
204206
}
205207

206208
// CommitsBefore returns all the commits before current revision

modules/git/repo_commit.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ func (repo *Repository) GetCommitByPath(relpath string) (*Commit, error) {
8989
return commits[0], nil
9090
}
9191

92-
func (repo *Repository) commitsByRange(id ObjectID, page, pageSize int, not string) ([]*Commit, error) {
92+
// commitsByRangeWithTime returns the specific page commits before current revision, with not, since, until support
93+
func (repo *Repository) commitsByRangeWithTime(id ObjectID, page, pageSize int, not, since, until string) ([]*Commit, error) {
9394
cmd := NewCommand("log").
9495
AddOptionFormat("--skip=%d", (page-1)*pageSize).
9596
AddOptionFormat("--max-count=%d", pageSize).
@@ -99,6 +100,12 @@ func (repo *Repository) commitsByRange(id ObjectID, page, pageSize int, not stri
99100
if not != "" {
100101
cmd.AddOptionValues("--not", not)
101102
}
103+
if since != "" {
104+
cmd.AddOptionFormat("--since=%s", since)
105+
}
106+
if until != "" {
107+
cmd.AddOptionFormat("--until=%s", until)
108+
}
102109

103110
stdout, _, err := cmd.RunStdBytes(repo.Ctx, &RunOpts{Dir: repo.Path})
104111
if err != nil {
@@ -212,6 +219,8 @@ type CommitsByFileAndRangeOptions struct {
212219
File string
213220
Not string
214221
Page int
222+
Since string
223+
Until string
215224
}
216225

217226
// CommitsByFileAndRange return the commits according revision file and the page
@@ -231,6 +240,12 @@ func (repo *Repository) CommitsByFileAndRange(opts CommitsByFileAndRangeOptions)
231240
if opts.Not != "" {
232241
gitCmd.AddOptionValues("--not", opts.Not)
233242
}
243+
if opts.Since != "" {
244+
gitCmd.AddOptionFormat("--since=%s", opts.Since)
245+
}
246+
if opts.Until != "" {
247+
gitCmd.AddOptionFormat("--until=%s", opts.Until)
248+
}
234249

235250
gitCmd.AddDashesAndList(opts.File)
236251
err := gitCmd.Run(repo.Ctx, &RunOpts{

modules/git/repo_stats.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ func (repo *Repository) GetCodeActivityStats(fromTime time.Time, branch string)
4040

4141
since := fromTime.Format(time.RFC3339)
4242

43-
stdout, _, runErr := NewCommand("rev-list", "--count", "--no-merges", "--branches=*", "--date=iso").AddOptionFormat("--since='%s'", since).RunStdString(repo.Ctx, &RunOpts{Dir: repo.Path})
43+
stdout, _, runErr := NewCommand("rev-list", "--count", "--no-merges", "--branches=*", "--date=iso").
44+
AddOptionFormat("--since=%s", since).
45+
RunStdString(repo.Ctx, &RunOpts{Dir: repo.Path})
4446
if runErr != nil {
4547
return nil, runErr
4648
}
@@ -60,7 +62,8 @@ func (repo *Repository) GetCodeActivityStats(fromTime time.Time, branch string)
6062
_ = stdoutWriter.Close()
6163
}()
6264

63-
gitCmd := NewCommand("log", "--numstat", "--no-merges", "--pretty=format:---%n%h%n%aN%n%aE%n", "--date=iso").AddOptionFormat("--since='%s'", since)
65+
gitCmd := NewCommand("log", "--numstat", "--no-merges", "--pretty=format:---%n%h%n%aN%n%aE%n", "--date=iso").
66+
AddOptionFormat("--since=%s", since)
6467
if len(branch) == 0 {
6568
gitCmd.AddArguments("--branches=*")
6669
} else {

modules/repository/commits_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,5 +200,3 @@ func TestListToPushCommits(t *testing.T) {
200200
assert.Equal(t, now, pushCommits.Commits[1].Timestamp)
201201
}
202202
}
203-
204-
// TODO TestPushUpdate

modules/structs/repo.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ type Repository struct {
101101
AllowSquash bool `json:"allow_squash_merge"`
102102
AllowFastForwardOnly bool `json:"allow_fast_forward_only_merge"`
103103
AllowRebaseUpdate bool `json:"allow_rebase_update"`
104+
AllowManualMerge bool `json:"allow_manual_merge"`
105+
AutodetectManualMerge bool `json:"autodetect_manual_merge"`
104106
DefaultDeleteBranchAfterMerge bool `json:"default_delete_branch_after_merge"`
105107
DefaultMergeStyle string `json:"default_merge_style"`
106108
DefaultAllowMaintainerEdit bool `json:"default_allow_maintainer_edit"`

options/locale/TRANSLATORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Piotr Orzechowski <piotr AT orzechowski DOT tech>
6666
Richard Bukovansky <richard DOT bukovansky AT gmail DOT com>
6767
Robert Nuske <robert DOT nuske AT web DOT de>
6868
Robin Hübner <profan AT prfn DOT se>
69+
Ryo Hanafusa <ryo7gumi AT gmail DOT com>
6970
SeongJae Park <sj38 DOT park AT gmail DOT com>
7071
Thiago Avelino <thiago AT avelino DOT xxx>
7172
Thomas Fanninger <gogs DOT thomas AT fanninger DOT at>

options/locale/locale_fr-FR.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3728,7 +3728,11 @@ creation.name_placeholder=Caractères alphanumériques ou tirets bas uniquement,
37283728
creation.value_placeholder=Entrez n’importe quoi. Les blancs cernant seront taillés.
37293729
creation.description_placeholder=Décrire brièvement votre dépôt (optionnel).
37303730
3731+
save_success=Le secret « %s » a été enregistré.
3732+
save_failed=Impossible d’enregistrer le secret.
37313733
3734+
add_secret=Ajouter un secret
3735+
edit_secret=Modifier le secret
37323736
deletion=Supprimer le secret
37333737
deletion.description=La suppression d'un secret est permanente et irréversible. Continuer ?
37343738
deletion.success=Le secret a été supprimé.
@@ -3806,6 +3810,9 @@ runs.no_workflows.documentation=Pour plus d’informations sur les actions Gitea
38063810
runs.no_runs=Le flux de travail n'a pas encore d'exécution.
38073811
runs.empty_commit_message=(message de révision vide)
38083812
runs.expire_log_message=Les journaux ont été supprimés car ils étaient trop anciens.
3813+
runs.delete=Supprimer cette exécution
3814+
runs.delete.description=Êtes-vous sûr de vouloir supprimer définitivement cette exécution ? Cette action ne peut pas être annulée.
3815+
runs.not_done=Cette exécution du flux de travail n’est pas terminée.
38093816

38103817
workflow.disable=Désactiver le flux de travail
38113818
workflow.disable_success=Le flux de travail « %s » a bien été désactivé.

options/locale/locale_ga-IE.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3728,7 +3728,11 @@ creation.name_placeholder=carachtair alfanumair nó íoslaghda amháin nach féi
37283728
creation.value_placeholder=Ionchur ábhar ar bith. Fágfar spás bán ag tús agus ag deireadh ar lár.
37293729
creation.description_placeholder=Cuir isteach cur síos gairid (roghnach).
37303730

3731+
save_success=Tá an rún "%s" sábháilte.
3732+
save_failed=Theip ar an rún a shábháil.
37313733

3734+
add_secret=Cuir rún leis
3735+
edit_secret=Cuir rún in eagar
37323736
deletion=Bain rún
37333737
deletion.description=Is buan rún a bhaint agus ní féidir é a chealú. Lean ort?
37343738
deletion.success=Tá an rún bainte.
@@ -3806,6 +3810,9 @@ runs.no_workflows.documentation=Le haghaidh tuilleadh eolais ar Gitea Actions, f
38063810
runs.no_runs=Níl aon rith ag an sreabhadh oibre fós.
38073811
runs.empty_commit_message=(teachtaireacht tiomantas folamh)
38083812
runs.expire_log_message=Glanadh logaí toisc go raibh siad ró-sean.
3813+
runs.delete=Scrios rith sreabha oibre
3814+
runs.delete.description=An bhfuil tú cinnte gur mian leat an rith sreabha oibre seo a scriosadh go buan? Ní féidir an gníomh seo a chealú.
3815+
runs.not_done=Níl an rith sreabha oibre seo críochnaithe.
38093816
38103817
workflow.disable=Díchumasaigh sreabhadh oibre
38113818
workflow.disable_success=D'éirigh le sreabhadh oibre '%s' a dhíchumasú.

options/locale/locale_ja-JP.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ use_scratch_code=スクラッチコードを使う
450450
twofa_scratch_used=あなたはスクラッチコードを使用しました。 2要素認証の設定ページにリダイレクトしましたので、デバイスの登録を解除するか、新しいスクラッチコードを生成しましょう。
451451
twofa_passcode_incorrect=パスコードが正しくありません。デバイスを紛失した場合は、スクラッチコードを使ってサインインしてください。
452452
twofa_scratch_token_incorrect=スクラッチコードが正しくありません。
453+
twofa_required=リポジトリにアクセスするには2段階認証を設定するか、再度ログインしてください。
453454
login_userpass=サインイン
454455
login_openid=OpenID
455456
oauth_signup_tab=新規アカウント登録
@@ -1878,6 +1879,7 @@ pulls.add_prefix=先頭に <strong>%s</strong> を追加
18781879
pulls.remove_prefix=先頭の <strong>%s</strong> を除去
18791880
pulls.data_broken=このプルリクエストは、フォークの情報が見つからないため壊れています。
18801881
pulls.files_conflicted=このプルリクエストは、ターゲットブランチと競合する変更を含んでいます。
1882+
pulls.is_checking=マージの競合を確認しています...
18811883
pulls.is_ancestor=このブランチは既にターゲットブランチに含まれています。マージするものはありません。
18821884
pulls.is_empty=このブランチの変更は既にターゲットブランチにあります。これは空のコミットになります。
18831885
pulls.required_status_check_failed=いくつかの必要なステータスチェックが成功していません。
@@ -3725,7 +3727,11 @@ creation.name_placeholder=大文字小文字の区別なし、英数字とアン
37253727
creation.value_placeholder=内容を入力してください。前後の空白は除去されます。
37263728
creation.description_placeholder=簡単な説明を入力してください。 (オプション)
37273729

3730+
save_success=シークレット "%s" を保存しました。
3731+
save_failed=シークレットの保存に失敗しました。
37283732

3733+
add_secret=シークレットを追加
3734+
edit_secret=シークレットを編集
37293735
deletion=シークレットの削除
37303736
deletion.description=シークレットの削除は恒久的で元に戻すことはできません。 続行しますか?
37313737
deletion.success=シークレットを削除しました。
@@ -3842,6 +3848,8 @@ deleted.display_name=削除されたプロジェクト
38423848
type-1.display_name=個人プロジェクト
38433849
type-2.display_name=リポジトリ プロジェクト
38443850
type-3.display_name=組織プロジェクト
3851+
enter_fullscreen=フルスクリーン
3852+
exit_fullscreen=フルスクリーンを終了
38453853

38463854
[git.filemode]
38473855
changed_filemode=%[1]s → %[2]s

options/locale/locale_pt-PT.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3810,6 +3810,9 @@ runs.no_workflows.documentation=Para mais informação sobre o Gitea Actions vej
38103810
runs.no_runs=A sequência de trabalho ainda não foi executada.
38113811
runs.empty_commit_message=(mensagem de cometimento vazia)
38123812
runs.expire_log_message=Os registros foram removidos porque eram muito antigos.
3813+
runs.delete=Eliminar execução da sequência de trabalho
3814+
runs.delete.description=Tem a certeza que pretende eliminar permanentemente a execução desta sequência de trabalho? Esta operação não poderá ser desfeita.
3815+
runs.not_done=A execução desta sequência de trabalho ainda não terminou.
38133816

38143817
workflow.disable=Desabilitar sequência de trabalho
38153818
workflow.disable_success=A sequência de trabalho '%s' foi desabilitada com sucesso.

0 commit comments

Comments
 (0)