Skip to content

Commit e98dd6e

Browse files
wxiaoguangdelvh
andauthored
Backport 1.23 (#32868)
Co-authored-by: delvh <[email protected]>
1 parent 22c4599 commit e98dd6e

File tree

16 files changed

+209
-8
lines changed

16 files changed

+209
-8
lines changed

models/actions/run_job_status_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func TestAggregateJobStatus(t *testing.T) {
6969
{[]Status{StatusFailure, StatusBlocked}, StatusFailure},
7070

7171
// skipped with other status
72-
// TODO: need to clarify whether a PR with "skipped" job status is considered as "mergeable" or not.
72+
// "all skipped" is also considered as "mergeable" by "services/actions.toCommitStatus", the same as GitHub
7373
{[]Status{StatusSkipped}, StatusSkipped},
7474
{[]Status{StatusSkipped, StatusSuccess}, StatusSuccess},
7575
{[]Status{StatusSkipped, StatusFailure}, StatusFailure},

modules/markup/markdown/markdown.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ func SpecializedMarkdown(ctx *markup.RenderContext) *GlodmarkRender {
129129
Enabled: setting.Markdown.EnableMath,
130130
ParseDollarInline: true,
131131
ParseDollarBlock: true,
132-
ParseSquareBlock: true, // TODO: this is a bad syntax, it should be deprecated in the future (by some config options)
132+
ParseSquareBlock: true, // TODO: this is a bad syntax "\[ ... \]", it conflicts with normal markdown escaping, it should be deprecated in the future (by some config options)
133+
// ParseBracketInline: true, // TODO: this is also a bad syntax "\( ... \)", it also conflicts, it should be deprecated in the future
133134
}),
134135
meta.Meta,
135136
),

modules/repository/fork.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ import (
1212
"code.gitea.io/gitea/modules/setting"
1313
)
1414

15+
// CanUserForkBetweenOwners returns true if user can fork between owners.
16+
// By default, a user can fork a repository from another owner, but not from themselves.
17+
// Many users really like to fork their own repositories, so add an experimental setting to allow this.
1518
func CanUserForkBetweenOwners(id1, id2 int64) bool {
1619
if id1 != id2 {
1720
return true

options/locale/locale_fr-FR.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,6 @@ issues.timetracker_timer_stop=Arrêter le minuteur
16761676
issues.timetracker_timer_discard=Annuler le minuteur
16771677
issues.timetracker_timer_manually_add=Pointer du temps
16781678
1679-
issues.time_estimate_placeholder=1h 2m
16801679
issues.time_estimate_set=Définir le temps estimé
16811680
issues.time_estimate_display=Estimation : %s
16821681
issues.change_time_estimate_at=a changé le temps estimé à <b>%s</b> %s

options/locale/locale_ga-IE.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,6 @@ issues.timetracker_timer_stop=Stop an t-amadóir
16761676
issues.timetracker_timer_discard=Déan an t-amadóir a scriosadh
16771677
issues.timetracker_timer_manually_add=Cuir Am leis
16781678

1679-
issues.time_estimate_placeholder=1u 2n
16801679
issues.time_estimate_set=Socraigh am measta
16811680
issues.time_estimate_display=Meastachán: %s
16821681
issues.change_time_estimate_at=d'athraigh an meastachán ama go <b>%s</b> %s

options/locale/locale_pt-PT.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1679,7 +1679,6 @@ issues.timetracker_timer_stop=Parar cronómetro
16791679
issues.timetracker_timer_discard=Descartar cronómetro
16801680
issues.timetracker_timer_manually_add=Adicionar tempo
16811681

1682-
issues.time_estimate_placeholder=1h 2m
16831682
issues.time_estimate_set=Definir tempo estimado
16841683
issues.time_estimate_display=Estimativa: %s
16851684
issues.change_time_estimate_at=alterou a estimativa de tempo para <b>%s</b> %s
@@ -2632,6 +2631,7 @@ release.new_release=Novo lançamento
26322631
release.draft=Rascunho
26332632
release.prerelease=Pré-lançamento
26342633
release.stable=Estável
2634+
release.latest=Mais recente
26352635
release.compare=Comparar
26362636
release.edit=editar
26372637
release.ahead.commits=<strong>%d</strong> cometimentos

options/locale/locale_zh-CN.ini

Lines changed: 170 additions & 1 deletion
Large diffs are not rendered by default.

routers/web/repo/actions/view.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,11 @@ func ViewPost(ctx *context_module.Context) {
205205
}
206206
}
207207

208+
// TODO: "ComposeMetas" (usually for comment) is not quite right, but it is still the same as what template "RenderCommitMessage" does.
209+
// need to be refactored together in the future
208210
metas := ctx.Repo.Repository.ComposeMetas(ctx)
209211

212+
// the title for the "run" is from the commit message
210213
resp.State.Run.Title = run.Title
211214
resp.State.Run.TitleHTML = templates.NewRenderUtils(ctx).RenderCommitMessage(run.Title, metas)
212215
resp.State.Run.Link = run.Link()

services/auth/source/ldap/source_authenticate.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"code.gitea.io/gitea/models/auth"
1313
user_model "code.gitea.io/gitea/models/user"
1414
auth_module "code.gitea.io/gitea/modules/auth"
15+
"code.gitea.io/gitea/modules/log"
1516
"code.gitea.io/gitea/modules/optional"
1617
asymkey_service "code.gitea.io/gitea/services/asymkey"
1718
source_service "code.gitea.io/gitea/services/auth/source"
@@ -31,7 +32,12 @@ func (source *Source) Authenticate(ctx context.Context, user *user_model.User, u
3132
return nil, user_model.ErrUserNotExist{Name: loginName}
3233
}
3334
// Fallback.
35+
// FIXME: this fallback would cause problems when the "Username" attribute is not set and a user inputs their email.
36+
// In this case, the email would be used as the username, and will cause the "CreateUser" failure for the first login.
3437
if sr.Username == "" {
38+
if strings.Contains(userName, "@") {
39+
log.Error("No username in search result (Username Attribute is not set properly?), using email as username might cause problems")
40+
}
3541
sr.Username = userName
3642
}
3743
if sr.Mail == "" {

templates/package/content/container.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@
3636
</thead>
3737
<tbody>
3838
{{range .PackageDescriptor.Metadata.Manifests}}
39+
{{/* "unknown/unknown" is attestation-manifest, so we should skip it */}}
3940
{{if ne .Platform "unknown/unknown"}}
4041
<tr>
41-
<td><a href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .Digest}}">{{StringUtils.TrimPrefix .Digest "sha256:" | ShortSha}}</a></td>
42+
<td><a class="tw-font-mono" href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .Digest}}">{{StringUtils.TrimPrefix .Digest "sha256:" | ShortSha}}</a></td>
4243
<td>{{.Platform}}</td>
4344
<td>{{FileSize .Size}}</td>
4445
</tr>

0 commit comments

Comments
 (0)