Skip to content

Commit fde2437

Browse files
authored
Merge branch 'main' into lunny/refactor_settings_menus
2 parents 355d1c1 + 03fce8f commit fde2437

File tree

197 files changed

+3433
-3014
lines changed

Some content is hidden

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

197 files changed

+3433
-3014
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ __debug_bin*
2525
# Visual Studio
2626
/.vs/
2727

28+
# mise version managment tool
29+
mise.toml
30+
2831
*.cgo1.go
2932
*.cgo2.c
3033
_cgo_defun.c
@@ -121,4 +124,3 @@ prime/
121124
/AGENT.md
122125
/CLAUDE.md
123126
/llms.txt
124-

cmd/admin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func runRepoSyncReleases(ctx context.Context, _ *cli.Command) error {
121121
}
122122
log.Trace("Processing next %d repos of %d", len(repos), count)
123123
for _, repo := range repos {
124-
log.Trace("Synchronizing repo %s with path %s", repo.FullName(), repo.RepoPath())
124+
log.Trace("Synchronizing repo %s with path %s", repo.FullName(), repo.RelativePath())
125125
gitRepo, err := gitrepo.OpenRepository(ctx, repo)
126126
if err != nil {
127127
log.Warn("OpenRepository: %v", err)
@@ -147,7 +147,7 @@ func runRepoSyncReleases(ctx context.Context, _ *cli.Command) error {
147147
continue
148148
}
149149

150-
log.Trace(" repo %s releases synchronized to tags: from %d to %d",
150+
log.Trace("repo %s releases synchronized to tags: from %d to %d",
151151
repo.FullName(), oldnum, count)
152152
gitRepo.Close()
153153
}

cmd/admin_user_create.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ func runCreateUser(ctx context.Context, c *cli.Command) error {
151151
if err != nil {
152152
return err
153153
}
154+
// codeql[disable-next-line=go/clear-text-logging]
154155
fmt.Printf("generated random password is '%s'\n", password)
155156
} else if userType == user_model.UserTypeIndividual {
156157
return errors.New("must set either password or random-password flag")

cmd/admin_user_must_change_password.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func runMustChangePassword(ctx context.Context, c *cli.Command) error {
5858
return err
5959
}
6060

61+
// codeql[disable-next-line=go/clear-text-logging]
6162
fmt.Printf("Updated %d users setting MustChangePassword to %t\n", n, mustChangePassword)
6263
return nil
6364
}

cmd/generate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ func runGenerateSecretKey(_ context.Context, c *cli.Command) error {
9191
return err
9292
}
9393

94+
// codeql[disable-next-line=go/clear-text-logging]
9495
fmt.Printf("%s", secretKey)
9596

9697
if isatty.IsTerminal(os.Stdout.Fd()) {

cmd/hook.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Gitea or set your environment appropriately.`, "")
186186
userID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvPusherID), 10, 64)
187187
prID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvPRID), 10, 64)
188188
deployKeyID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvDeployKeyID), 10, 64)
189-
actionPerm, _ := strconv.ParseInt(os.Getenv(repo_module.EnvActionPerm), 10, 64)
189+
actionPerm, _ := strconv.Atoi(os.Getenv(repo_module.EnvActionPerm))
190190

191191
hookOptions := private.HookOptions{
192192
UserID: userID,
@@ -196,7 +196,7 @@ Gitea or set your environment appropriately.`, "")
196196
GitPushOptions: pushOptions(),
197197
PullRequestID: prID,
198198
DeployKeyID: deployKeyID,
199-
ActionPerm: int(actionPerm),
199+
ActionPerm: actionPerm,
200200
}
201201

202202
scanner := bufio.NewScanner(os.Stdin)
@@ -313,7 +313,7 @@ func runHookPostReceive(ctx context.Context, c *cli.Command) error {
313313
setup(ctx, c.Bool("debug"))
314314

315315
// First of all run update-server-info no matter what
316-
if _, _, err := gitcmd.NewCommand("update-server-info").RunStdString(ctx, nil); err != nil {
316+
if _, _, err := gitcmd.NewCommand("update-server-info").RunStdString(ctx); err != nil {
317317
return fmt.Errorf("failed to call 'git update-server-info': %w", err)
318318
}
319319

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ replace github.com/jaytaylor/html2text => github.com/Necoro/html2text v0.0.0-202
295295

296296
replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1
297297

298-
replace github.com/nektos/act => gitea.com/gitea/act v0.261.6
298+
replace github.com/nektos/act => gitea.com/gitea/act v0.261.7-0.20251003180512-ac6e4b751763
299299

300300
// TODO: the only difference is in `PutObject`: the fork doesn't use `NewVerifyingReader(r, sha256.New(), oid, expectedSize)`, need to figure out why
301301
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
@@ -31,8 +31,8 @@ dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA=
3131
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
3232
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
3333
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
34-
gitea.com/gitea/act v0.261.6 h1:CjZwKOyejonNFDmsXOw3wGm5Vet573hHM6VMLsxtvPY=
35-
gitea.com/gitea/act v0.261.6/go.mod h1:Pg5C9kQY1CEA3QjthjhlrqOC/QOT5NyWNjOjRHw23Ok=
34+
gitea.com/gitea/act v0.261.7-0.20251003180512-ac6e4b751763 h1:ohdxegvslDEllZmRNDqpKun6L4Oq81jNdEDtGgHEV2c=
35+
gitea.com/gitea/act v0.261.7-0.20251003180512-ac6e4b751763/go.mod h1:Pg5C9kQY1CEA3QjthjhlrqOC/QOT5NyWNjOjRHw23Ok=
3636
gitea.com/gitea/git-lfs-transfer v0.2.0 h1:baHaNoBSRaeq/xKayEXwiDQtlIjps4Ac/Ll4KqLMB40=
3737
gitea.com/gitea/git-lfs-transfer v0.2.0/go.mod h1:UrXUCm3xLQkq15fu7qlXHUMlrhdlXHoi13KH2Dfiits=
3838
gitea.com/gitea/go-xsd-duration v0.0.0-20220703122237-02e73435a078 h1:BAFmdZpRW7zMQZQDClaCWobRj9uL1MR3MzpCVJvc5s4=

models/fixtures/branch.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,15 @@
213213
is_deleted: false
214214
deleted_by_id: 0
215215
deleted_unix: 0
216+
217+
-
218+
id: 26
219+
repo_id: 10
220+
name: 'feature/1'
221+
commit_id: '65f1bf27bc3bf70f64657658635e66094edbcb4d'
222+
commit_message: 'Initial commit'
223+
commit_time: 1489950479
224+
pusher_id: 2
225+
is_deleted: false
226+
deleted_by_id: 0
227+
deleted_unix: 0

models/migrations/v1_12/v128.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,17 @@ func FixMergeBase(ctx context.Context, x *xorm.Engine) error {
8484

8585
if !pr.HasMerged {
8686
var err error
87-
pr.MergeBase, _, err = gitcmd.NewCommand("merge-base").AddDashesAndList(pr.BaseBranch, gitRefName).RunStdString(ctx, &gitcmd.RunOpts{Dir: repoPath})
87+
pr.MergeBase, _, err = gitcmd.NewCommand("merge-base").AddDashesAndList(pr.BaseBranch, gitRefName).WithDir(repoPath).RunStdString(ctx)
8888
if err != nil {
8989
var err2 error
90-
pr.MergeBase, _, err2 = gitcmd.NewCommand("rev-parse").AddDynamicArguments(git.BranchPrefix+pr.BaseBranch).RunStdString(ctx, &gitcmd.RunOpts{Dir: repoPath})
90+
pr.MergeBase, _, err2 = gitcmd.NewCommand("rev-parse").AddDynamicArguments(git.BranchPrefix + pr.BaseBranch).WithDir(repoPath).RunStdString(ctx)
9191
if err2 != nil {
9292
log.Error("Unable to get merge base for PR ID %d, Index %d in %s/%s. Error: %v & %v", pr.ID, pr.Index, baseRepo.OwnerName, baseRepo.Name, err, err2)
9393
continue
9494
}
9595
}
9696
} else {
97-
parentsString, _, err := gitcmd.NewCommand("rev-list", "--parents", "-n", "1").AddDynamicArguments(pr.MergedCommitID).RunStdString(ctx, &gitcmd.RunOpts{Dir: repoPath})
97+
parentsString, _, err := gitcmd.NewCommand("rev-list", "--parents", "-n", "1").AddDynamicArguments(pr.MergedCommitID).WithDir(repoPath).RunStdString(ctx)
9898
if err != nil {
9999
log.Error("Unable to get parents for merged PR ID %d, Index %d in %s/%s. Error: %v", pr.ID, pr.Index, baseRepo.OwnerName, baseRepo.Name, err)
100100
continue
@@ -108,7 +108,7 @@ func FixMergeBase(ctx context.Context, x *xorm.Engine) error {
108108
refs = append(refs, gitRefName)
109109
cmd := gitcmd.NewCommand("merge-base").AddDashesAndList(refs...)
110110

111-
pr.MergeBase, _, err = cmd.RunStdString(ctx, &gitcmd.RunOpts{Dir: repoPath})
111+
pr.MergeBase, _, err = cmd.WithDir(repoPath).RunStdString(ctx)
112112
if err != nil {
113113
log.Error("Unable to get merge base for merged PR ID %d, Index %d in %s/%s. Error: %v", pr.ID, pr.Index, baseRepo.OwnerName, baseRepo.Name, err)
114114
continue

0 commit comments

Comments
 (0)