Skip to content

Commit e424efe

Browse files
committed
Merge branch 'main' into git-diff-highlights
# Conflicts: # routers/api/v1/repo/pull.go # services/convert/git_commit.go # services/gitdiff/gitdiff.go
2 parents 1e6c8dd + 6422f05 commit e424efe

File tree

39 files changed

+394
-391
lines changed

39 files changed

+394
-391
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,28 @@ This changelog goes through the changes that have been made in each release
44
without substantial changes to our git log; to see the highlights of what has
55
been added to each release, please refer to the [blog](https://blog.gitea.com).
66

7+
## [1.23.5](https://github.com/go-gitea/gitea/releases/tag/v1.23.5) - 2025-03-04
8+
9+
* SECURITY
10+
* Bump x/oauth2 & x/crypto (#33704) (#33727)
11+
* PERFORMANCE
12+
* Optimize user dashboard loading (#33686) (#33708)
13+
* BUGFIXES
14+
* Fix navbar dropdown item align (#33782)
15+
* Fix inconsistent closed issue list icon (#33722) (#33728)
16+
* Fix for Maven Package Naming Convention Handling (#33678) (#33679)
17+
* Improve Open-with URL encoding (#33666) (#33680)
18+
* Deleting repository should unlink all related packages (#33653) (#33673)
19+
* Fix omitempty bug (#33663) (#33670)
20+
* Upgrade go-crypto from 1.1.4 to 1.1.6 (#33745) (#33754)
21+
* Fix OCI image.version annotation for releases to use full semver (#33698) (#33701)
22+
* Try to fix ACME path when renew (#33668) (#33693)
23+
* Fix mCaptcha bug (#33659) (#33661)
24+
* Git graph: don't show detached commits (#33645) (#33650)
25+
* Use MatchPhraseQuery for bleve code search (#33628)
26+
* Adjust appearence of commit status webhook (#33778) #33789
27+
* Upgrade golang net from 0.35.0 -> 0.36.0 (#33795) #33796
28+
729
## [1.23.4](https://github.com/go-gitea/gitea/releases/tag/v1.23.4) - 2025-02-16
830

931
* SECURITY

cmd/doctor.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package cmd
55

66
import (
7+
"context"
78
"fmt"
89
golog "log"
910
"os"
@@ -130,8 +131,8 @@ func runRecreateTable(ctx *cli.Context) error {
130131
}
131132
recreateTables := migrate_base.RecreateTables(beans...)
132133

133-
return db.InitEngineWithMigration(stdCtx, func(x *xorm.Engine) error {
134-
if err := migrations.EnsureUpToDate(x); err != nil {
134+
return db.InitEngineWithMigration(stdCtx, func(ctx context.Context, x *xorm.Engine) error {
135+
if err := migrations.EnsureUpToDate(ctx, x); err != nil {
135136
return err
136137
}
137138
return recreateTables(x)

cmd/migrate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"context"
88

99
"code.gitea.io/gitea/models/db"
10-
"code.gitea.io/gitea/models/migrations"
1110
"code.gitea.io/gitea/modules/log"
1211
"code.gitea.io/gitea/modules/setting"
12+
"code.gitea.io/gitea/services/versioned_migration"
1313

1414
"github.com/urfave/cli/v2"
1515
)
@@ -36,7 +36,7 @@ func runMigrate(ctx *cli.Context) error {
3636
log.Info("Log path: %s", setting.Log.RootPath)
3737
log.Info("Configuration file: %s", setting.CustomConf)
3838

39-
if err := db.InitEngineWithMigration(context.Background(), migrations.Migrate); err != nil {
39+
if err := db.InitEngineWithMigration(context.Background(), versioned_migration.Migrate); err != nil {
4040
log.Fatal("Failed to initialize ORM engine: %v", err)
4141
return err
4242
}

cmd/migrate_storage.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ import (
1313
actions_model "code.gitea.io/gitea/models/actions"
1414
"code.gitea.io/gitea/models/db"
1515
git_model "code.gitea.io/gitea/models/git"
16-
"code.gitea.io/gitea/models/migrations"
1716
packages_model "code.gitea.io/gitea/models/packages"
1817
repo_model "code.gitea.io/gitea/models/repo"
1918
user_model "code.gitea.io/gitea/models/user"
2019
"code.gitea.io/gitea/modules/log"
2120
packages_module "code.gitea.io/gitea/modules/packages"
2221
"code.gitea.io/gitea/modules/setting"
2322
"code.gitea.io/gitea/modules/storage"
23+
"code.gitea.io/gitea/services/versioned_migration"
2424

2525
"github.com/urfave/cli/v2"
2626
)
@@ -227,7 +227,7 @@ func runMigrateStorage(ctx *cli.Context) error {
227227
log.Info("Log path: %s", setting.Log.RootPath)
228228
log.Info("Configuration file: %s", setting.CustomConf)
229229

230-
if err := db.InitEngineWithMigration(context.Background(), migrations.Migrate); err != nil {
230+
if err := db.InitEngineWithMigration(context.Background(), versioned_migration.Migrate); err != nil {
231231
log.Fatal("Failed to initialize ORM engine: %v", err)
232232
return err
233233
}

cmd/web_acme.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"code.gitea.io/gitea/modules/log"
1717
"code.gitea.io/gitea/modules/process"
1818
"code.gitea.io/gitea/modules/setting"
19+
"code.gitea.io/gitea/modules/util"
1920

2021
"github.com/caddyserver/certmagic"
2122
)
@@ -68,9 +69,15 @@ func runACME(listenAddr string, m http.Handler) error {
6869
// And one more thing, no idea why we should set the global default variables here
6970
// But it seems that the current ACME code needs these global variables to make renew work.
7071
// Otherwise, "renew" will use incorrect storage path
72+
oldDefaultACME := certmagic.DefaultACME
7173
certmagic.Default.Storage = &certmagic.FileStorage{Path: setting.AcmeLiveDirectory}
7274
certmagic.DefaultACME = certmagic.ACMEIssuer{
73-
CA: setting.AcmeURL,
75+
// try to use the default values provided by DefaultACME
76+
CA: util.IfZero(setting.AcmeURL, oldDefaultACME.CA),
77+
TestCA: oldDefaultACME.TestCA,
78+
Logger: oldDefaultACME.Logger,
79+
HTTPProxy: oldDefaultACME.HTTPProxy,
80+
7481
TrustedRoots: certPool,
7582
Email: setting.AcmeEmail,
7683
Agreed: setting.AcmeTOS,

models/db/engine_init.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func UnsetDefaultEngine() {
105105
// When called from the "doctor" command, the migration function is a version check
106106
// that prevents the doctor from fixing anything in the database if the migration level
107107
// is different from the expected value.
108-
func InitEngineWithMigration(ctx context.Context, migrateFunc func(*xorm.Engine) error) (err error) {
108+
func InitEngineWithMigration(ctx context.Context, migrateFunc func(context.Context, *xorm.Engine) error) (err error) {
109109
if err = InitEngine(ctx); err != nil {
110110
return err
111111
}
@@ -122,7 +122,7 @@ func InitEngineWithMigration(ctx context.Context, migrateFunc func(*xorm.Engine)
122122
// Installation should only be being re-run if users want to recover an old database.
123123
// However, we should think carefully about should we support re-install on an installed instance,
124124
// as there may be other problems due to secret reinitialization.
125-
if err = migrateFunc(xormEngine); err != nil {
125+
if err = migrateFunc(ctx, xormEngine); err != nil {
126126
return fmt.Errorf("migrate: %w", err)
127127
}
128128

models/migrations/migrations.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ func ExpectedDBVersion() int64 {
413413
}
414414

415415
// EnsureUpToDate will check if the db is at the correct version
416-
func EnsureUpToDate(x *xorm.Engine) error {
416+
func EnsureUpToDate(ctx context.Context, x *xorm.Engine) error {
417417
currentDB, err := GetCurrentDBVersion(x)
418418
if err != nil {
419419
return err

modules/git/repo_compare.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,9 @@ func (repo *Repository) GetDiffNumChangedFiles(base, head string, directComparis
174174
return w.numLines, nil
175175
}
176176

177-
// GetDiffShortStat counts number of changed files, number of additions and deletions
178-
func (repo *Repository) GetDiffShortStat(base, head string) (numFiles, totalAdditions, totalDeletions int, err error) {
179-
numFiles, totalAdditions, totalDeletions, err = GetDiffShortStat(repo.Ctx, repo.Path, nil, base+"..."+head)
180-
if err != nil && strings.Contains(err.Error(), "no merge base") {
181-
return GetDiffShortStat(repo.Ctx, repo.Path, nil, base, head)
182-
}
183-
return numFiles, totalAdditions, totalDeletions, err
184-
}
185-
186-
// GetDiffShortStat counts number of changed files, number of additions and deletions
187-
func GetDiffShortStat(ctx context.Context, repoPath string, trustedArgs TrustedCmdArgs, dynamicArgs ...string) (numFiles, totalAdditions, totalDeletions int, err error) {
177+
// GetDiffShortStatByCmdArgs counts number of changed files, number of additions and deletions
178+
// TODO: it can be merged with another "GetDiffShortStat" in the future
179+
func GetDiffShortStatByCmdArgs(ctx context.Context, repoPath string, trustedArgs TrustedCmdArgs, dynamicArgs ...string) (numFiles, totalAdditions, totalDeletions int, err error) {
188180
// Now if we call:
189181
// $ git diff --shortstat 1ebb35b98889ff77299f24d82da426b434b0cca0...788b8b1440462d477f45b0088875
190182
// we get:

modules/structs/pull.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ type PullRequest struct {
2525
Draft bool `json:"draft"`
2626
IsLocked bool `json:"is_locked"`
2727
Comments int `json:"comments"`
28+
2829
// number of review comments made on the diff of a PR review (not including comments on commits or issues in a PR)
29-
ReviewComments int `json:"review_comments"`
30-
Additions int `json:"additions"`
31-
Deletions int `json:"deletions"`
32-
ChangedFiles int `json:"changed_files"`
30+
ReviewComments int `json:"review_comments,omitempty"`
31+
32+
Additions *int `json:"additions,omitempty"`
33+
Deletions *int `json:"deletions,omitempty"`
34+
ChangedFiles *int `json:"changed_files,omitempty"`
3335

3436
HTMLURL string `json:"html_url"`
3537
DiffURL string `json:"diff_url"`

options/locale/locale_ga-IE.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,6 +1937,7 @@ pulls.outdated_with_base_branch=Tá an brainse seo as dáta leis an mbunbhrainse
19371937
pulls.close=Dún Iarratas Tarraing
19381938
pulls.closed_at=`dhún an t-iarratas tarraingthe seo <a id="%[1]s" href="#%[1]s">%[2]s</a>`
19391939
pulls.reopened_at=`athoscail an t-iarratas tarraingthe seo <a id="%[1]s" href="#%[1]s">%[2]s</a>`
1940+
pulls.cmd_instruction_hint=Féach ar threoracha na n-orduithe
19401941
pulls.cmd_instruction_checkout_title=Seiceáil
19411942
pulls.cmd_instruction_checkout_desc=Ó stór tionscadail, seiceáil brainse nua agus déan tástáil ar na hathruithe.
19421943
pulls.cmd_instruction_merge_title=Cumaisc

0 commit comments

Comments
 (0)