Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions patches/0001-BLENDER-Blender-ID-goth-provider.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 10205667dc82b937bd956945be551edb4509e3fb Mon Sep 17 00:00:00 2001
From ab305db7214f442a80ce6df7ed714ae3cae00e0b Mon Sep 17 00:00:00 2001
From: Brecht Van Lommel <brecht@blender.org>
Date: Fri, 10 May 2024 13:28:51 +0200
Subject: [PATCH 01/19] BLENDER: Blender ID goth provider
Subject: [PATCH 01/22] BLENDER: Blender ID goth provider

Provider authored by Matti Ranta and Arnd Marijnissen.
---
Expand All @@ -25,22 +25,22 @@ Provider authored by Matti Ranta and Arnd Marijnissen.
create mode 100644 services/auth/source/oauth2/blenderid/session_test.go

diff --git a/go.mod b/go.mod
index e4c0a5a989..120fe31c15 100644
index a2b35f48e0..8e4601f498 100644
--- a/go.mod
+++ b/go.mod
@@ -237,6 +237,7 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
@@ -233,6 +233,7 @@ require (
github.com/minio/minlz v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
+ github.com/mozillazg/go-unidecode v0.2.0 // indirect
github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450 // indirect
github.com/mschoch/smat v0.2.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
diff --git a/go.sum b/go.sum
index d5ea5f6663..ebb4d17d32 100644
index 5b228a00f4..41ddeffe56 100644
--- a/go.sum
+++ b/go.sum
@@ -599,6 +599,9 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w
@@ -549,6 +549,9 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
Expand Down Expand Up @@ -593,5 +593,5 @@ index 65cf538ad7..f6f49ada04 100644
+ }))
}
--
2.51.0
2.47.3

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From a9d7f0bcc2c5b0f366c0fb9b7f179ddbb4d52e6b Mon Sep 17 00:00:00 2001
From c63e94599a05b3d79b4f730295b0914b7c8ef4ae Mon Sep 17 00:00:00 2001
From: Brecht Van Lommel <brecht@blender.org>
Date: Fri, 10 May 2024 13:31:35 +0200
Subject: [PATCH 02/19] BLENDER: Show warning for target branch switching
Subject: [PATCH 02/22] BLENDER: Show warning for target branch switching

---
templates/repo/issue/view_title.tmpl | 1 +
Expand All @@ -20,5 +20,5 @@ index 103fa5de53..f67531d055 100644
{{end}}
{{else}}
--
2.51.0
2.47.3

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From c167bf3727880b2ea354407127cdad0db68bd903 Mon Sep 17 00:00:00 2001
From 4b2c9eb6995284aae06962d33beb6a0fe65414ff Mon Sep 17 00:00:00 2001
From: Brecht Van Lommel <brecht@blender.org>
Date: Fri, 10 May 2024 13:32:53 +0200
Subject: [PATCH 03/19] BLENDER: Workaround LFS files not being available in
Subject: [PATCH 03/22] BLENDER: Workaround LFS files not being available in
pull requests

Patch taken from issue number 17715, associating the LFS pointer when the
Expand All @@ -12,10 +12,10 @@ file is downloaded.
2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/models/git/lfs.go b/models/git/lfs.go
index 8bba060ff9..2f2f13254e 100644
index 1f3d086ac2..3a33c46ae9 100644
--- a/models/git/lfs.go
+++ b/models/git/lfs.go
@@ -223,7 +223,7 @@ func CountLFSMetaObjects(ctx context.Context, repoID int64) (int64, error) {
@@ -192,7 +192,7 @@ func CountLFSMetaObjects(ctx context.Context, repoID int64) (int64, error) {

// LFSObjectAccessible checks if a provided Oid is accessible to the user
func LFSObjectAccessible(ctx context.Context, user *user_model.User, oid string) (bool, error) {
Expand All @@ -25,10 +25,10 @@ index 8bba060ff9..2f2f13254e 100644
return count > 0, err
}
diff --git a/services/lfs/server.go b/services/lfs/server.go
index 4a1e0aaf7d..58c05fa760 100644
index 26eb4878c6..e0b3dd136e 100644
--- a/services/lfs/server.go
+++ b/services/lfs/server.go
@@ -285,6 +285,26 @@ func BatchHandler(ctx *context.Context) {
@@ -284,6 +284,26 @@ func BatchHandler(ctx *context.Context) {
responseObject = buildObjectResponse(rc, p, false, !exists, err)
} else {
var err *lfs_module.ObjectError
Expand Down Expand Up @@ -56,5 +56,5 @@ index 4a1e0aaf7d..58c05fa760 100644
err = &lfs_module.ObjectError{
Code: http.StatusNotFound,
--
2.51.0
2.47.3

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
From bc9cfc7e3eebf9217902a6931aa6e0e409384706 Mon Sep 17 00:00:00 2001
From 1a64ab3dc14b7625ce6b7dbe1d829f0bd450414a Mon Sep 17 00:00:00 2001
From: Brecht Van Lommel <brecht@blender.org>
Date: Fri, 10 May 2024 13:33:32 +0200
Subject: [PATCH 04/19] BLENDER: Don't allow assigning large teams as reviewers
Subject: [PATCH 04/22] BLENDER: Don't allow assigning large teams as reviewers

To avoid accidentally spamming hundreds of people.
---
models/organization/team.go | 16 ++++++++++++++++
routers/web/repo/issue.go | 4 ++--
services/pull/reviewer.go | 2 +-
models/organization/team.go | 16 ++++++++++++++++
routers/web/shared/mention/mention.go | 4 ++--
services/pull/reviewer.go | 2 +-
3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/models/organization/team.go b/models/organization/team.go
Expand All @@ -34,37 +34,33 @@ index 7f3a9b3829..f0717faf2e 100644
+
+ return smallTeams, nil
+}
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go
index 54b7e5df2a..ec2d9c0131 100644
--- a/routers/web/repo/issue.go
+++ b/routers/web/repo/issue.go
@@ -673,13 +673,13 @@ func handleMentionableAssigneesAndTeams(ctx *context.Context, assignees []*user_
}

diff --git a/routers/web/shared/mention/mention.go b/routers/web/shared/mention/mention.go
index 5f163cb146..e02da20de6 100644
--- a/routers/web/shared/mention/mention.go
+++ b/routers/web/shared/mention/mention.go
@@ -65,9 +65,9 @@ func (c *Collector) AddMentionableTeams(ctx context.Context, doer, owner *user_m
var teams []*organization.Team
var err error
if isAdmin {
- teams, err = org.LoadTeams(ctx)
+ teams, err = organization.FilterLargeTeams(org.LoadTeams(ctx))
if err != nil {
ctx.ServerError("LoadTeams", err)
return
}
} else {
- teams, err = org.GetUserTeams(ctx, ctx.Doer.ID)
+ teams, err = organization.FilterLargeTeams(org.GetUserTeams(ctx, ctx.Doer.ID))
if err != nil {
ctx.ServerError("GetUserTeams", err)
return
- teams, err = org.GetUserTeams(ctx, doer.ID)
+ teams, err = organization.FilterLargeTeams(org.GetUserTeams(ctx, doer.ID))
}
if err != nil {
return err
diff --git a/services/pull/reviewer.go b/services/pull/reviewer.go
index 52f2f3401c..8794a787fc 100644
index 139aeeb950..d7f8d3dc9b 100644
--- a/services/pull/reviewer.go
+++ b/services/pull/reviewer.go
@@ -85,5 +85,5 @@ func GetReviewerTeams(ctx context.Context, repo *repo_model.Repository) ([]*orga
@@ -78,5 +78,5 @@ func GetReviewerTeams(ctx context.Context, repo *repo_model.Repository) ([]*orga
return nil, nil
}

- return organization.GetTeamsWithAccessToAnyRepoUnit(ctx, repo.OwnerID, repo.ID, perm.AccessModeRead, unit.TypePullRequests)
+ return organization.FilterLargeTeams(organization.GetTeamsWithAccessToAnyRepoUnit(ctx, repo.OwnerID, repo.ID, perm.AccessModeRead, unit.TypePullRequests))
}
--
2.51.0
2.47.3

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 10b499c2c2ec0f51d45f8d8ee42f9b9ffc455fc3 Mon Sep 17 00:00:00 2001
From 21188912848b3c302cd401fe5790b75fb55dcb98 Mon Sep 17 00:00:00 2001
From: Brecht Van Lommel <brecht@blender.org>
Date: Fri, 10 May 2024 13:58:05 +0200
Subject: [PATCH 05/19] BLENDER: Support both exclusive and non-exclusive scope
Subject: [PATCH 05/22] BLENDER: Support both exclusive and non-exclusive scope
for labels

---
Expand Down Expand Up @@ -46,10 +46,10 @@ index 25d6f1303e..951cfdc1a6 100644
func NewLabel(ctx context.Context, l *Label) error {
color, err := label.NormalizeColor(l.Color)
diff --git a/modules/templates/util_render.go b/modules/templates/util_render.go
index 1056c42643..5b4cabf6d8 100644
index 081a13fb9e..5757e3e805 100644
--- a/modules/templates/util_render.go
+++ b/modules/templates/util_render.go
@@ -142,7 +142,7 @@ func (ut *RenderUtils) renderLabelWithTag(label *issues_model.Label, tagName, ta
@@ -145,7 +145,7 @@ func (ut *RenderUtils) renderLabelWithTag(label *issues_model.Label, tagName, ta
locale := ut.ctx.Value(translation.ContextKey).(translation.Locale)
var extraCSSClasses string
textColor := util.ContrastColor(label.Color)
Expand Down Expand Up @@ -113,10 +113,10 @@ index 04c3605a6a..f0bffcd155 100644
{{ctx.RenderUtils.RenderLabel .}}
<p class="tw-ml-auto">{{template "repo/issue/labels/label_archived" .}}</p>
diff --git a/templates/repo/issue/sidebar/label_list.tmpl b/templates/repo/issue/sidebar/label_list.tmpl
index 15c8760d1a..75a66290b1 100644
index d30196326b..6339331e0f 100644
--- a/templates/repo/issue/sidebar/label_list.tmpl
+++ b/templates/repo/issue/sidebar/label_list.tmpl
@@ -19,23 +19,25 @@
@@ -20,23 +20,25 @@
<div class="scrolling menu">
<a class="item clear-selection" data-text="" href="#">{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}</a>
<div class="divider"></div>
Expand All @@ -131,7 +131,7 @@ index 15c8760d1a..75a66290b1 100644
{{end}}
- {{$previousExclusiveScope = $exclusiveScope}}
+ {{$previousScope = $scope}}
{{template "repo/issue/sidebar/label_list_item" dict "Label" .}}
{{template "repo/issue/sidebar/label_list_item" dict "Label" . "LabelLink" (print $listBaseLink "?labels=" .ID)}}
{{end}}
{{if and $data.RepoLabels $data.OrgLabels}}<div class="divider"></div>{{end}}
- {{$previousExclusiveScope = "_no_scope"}}
Expand All @@ -145,9 +145,9 @@ index 15c8760d1a..75a66290b1 100644
{{end}}
- {{$previousExclusiveScope = $exclusiveScope}}
+ {{$previousScope = $scope}}
{{template "repo/issue/sidebar/label_list_item" dict "Label" .}}
{{template "repo/issue/sidebar/label_list_item" dict "Label" . "LabelLink" (print $listBaseLink "?labels=" .ID)}}
{{end}}
</div>
--
2.51.0
2.47.3

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From f27d18bf6759b707f9430dbae507bd220b0c5cb7 Mon Sep 17 00:00:00 2001
From f4a59ee77343c1b3e2bb69b3ca8e47c1dfabbf7e Mon Sep 17 00:00:00 2001
From: Brecht Van Lommel <brecht@blender.org>
Date: Thu, 23 Oct 2025 20:18:11 +0200
Subject: [PATCH 06/19] BLENDER: Projects: button to show/hide issue details
Subject: [PATCH 06/22] BLENDER: Projects: button to show/hide issue details
and closed issue

Both are off by default. This is implemented fully on the frontend, so
Expand All @@ -15,18 +15,18 @@ all issues and their details are still always loaded.
5 files changed, 71 insertions(+), 14 deletions(-)

diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index e454bce4bd..ff3f7cfda1 100644
index f81be1255a..a11226a75e 100644
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -40,6 +40,7 @@ func NewFuncMap() template.FuncMap {
@@ -38,6 +38,7 @@ func newFuncMapWebPage() template.FuncMap {
"HTMLFormat": htmlFormat,
"QueryEscape": queryEscape,
"QueryBuild": QueryBuild,
+ "JSEscape": jsEscapeSafe,
"SanitizeHTML": SanitizeHTML,
"URLJoin": util.URLJoin,
"DotEscape": dotEscape,
@@ -180,6 +181,10 @@ func htmlFormat(s any, args ...any) template.HTML {

"PathEscape": url.PathEscape,
@@ -165,6 +166,10 @@ func htmlFormat(s any, args ...any) template.HTML {
panic(fmt.Sprintf("unexpected type %T", s))
}

Expand All @@ -38,11 +38,11 @@ index e454bce4bd..ff3f7cfda1 100644
return template.URL(url.QueryEscape(s))
}
diff --git a/templates/projects/view.tmpl b/templates/projects/view.tmpl
index 21bc287643..7972bc298d 100644
index ac08e56781..5a03bdcfd5 100644
--- a/templates/projects/view.tmpl
+++ b/templates/projects/view.tmpl
@@ -17,6 +17,16 @@
"TextFilterMatchAny" (ctx.Locale.Tr "repo.issues.filter_assignee_any_assignee")
@@ -23,6 +23,16 @@
"ClosedMilestones" .ClosedMilestones
}}
</div>
+ <div class="ui compact mini menu" style="margin-left: auto; margin-right: 1em;">
Expand All @@ -58,7 +58,7 @@ index 21bc287643..7972bc298d 100644
{{if $canWriteProject}}
<div class="ui compact mini menu">
<a class="item screen-full">
@@ -114,7 +124,7 @@
@@ -122,7 +132,7 @@
<div class="divider"{{if .Color}} style="color: {{ContrastColor .Color}} !important"{{end}}></div>
<div class="ui cards" data-url="{{$.Link}}/{{.ID}}" data-project="{{$.Project.ID}}" data-board="{{.ID}}" id="board_{{.ID}}">
{{range (index $.IssuesMap .ID)}}
Expand All @@ -67,7 +67,7 @@ index 21bc287643..7972bc298d 100644
{{template "repo/issue/card" (dict "Issue" . "Page" $)}}
</div>
{{end}}
@@ -124,6 +134,37 @@
@@ -132,6 +142,37 @@
</div>
</div>

Expand Down Expand Up @@ -106,7 +106,7 @@ index 21bc287643..7972bc298d 100644
<div class="ui small modal" id="project-column-modal-edit">
<div class="header">edit</div>
diff --git a/templates/repo/issue/card.tmpl b/templates/repo/issue/card.tmpl
index 6dae49c455..f3398cd0fd 100644
index 9600752036..89b8c9d354 100644
--- a/templates/repo/issue/card.tmpl
+++ b/templates/repo/issue/card.tmpl
@@ -10,6 +10,14 @@
Expand All @@ -128,8 +128,8 @@ index 6dae49c455..f3398cd0fd 100644
{{end}}
</div>
<div class="meta">
- <span class="text light grey muted-links">
+ <span class="text light grey muted-links issue-card-details tw-hidden">
- <span class="tw-text-grey-light muted-links">
+ <span class="tw-text-grey-light muted-links issue-card-details tw-hidden">
{{if not $.Page.Repository}}{{.Repo.FullName}}{{end}}#{{.Index}}
{{$timeStr := DateUtils.TimeSince .GetLastEventTimestamp}}
{{if .OriginalAuthor}}
Expand All @@ -149,8 +149,8 @@ index 6dae49c455..f3398cd0fd 100644
- <div class="meta tw-my-1">
+ <div class="meta tw-my-1 issue-card-details tw-hidden">
<a href="{{.Repo.Link}}/pulls/{{.Index}}">
<span class="tw-m-0 text {{if .PullRequest.HasMerged}}purple{{else if .IsClosed}}red{{else}}green{{end}}">{{svg "octicon-git-merge" 16 "tw-mr-1 tw-align-middle"}}</span>
<span class="tw-align-middle">{{.Title}} <span class="text light grey">#{{.Index}}</span></span>
<span class="tw-m-0 {{if .PullRequest.HasMerged}}tw-text-purple{{else if .IsClosed}}tw-text-red{{else}}tw-text-green{{end}}">{{svg "octicon-git-merge" 16 "tw-mr-1 tw-align-middle"}}</span>
<span class="tw-align-middle">{{.Title}} <span class="tw-text-grey-light">#{{.Index}}</span></span>
@@ -54,15 +62,15 @@
{{end}}
{{$tasks := .GetTasks}}
Expand Down Expand Up @@ -215,5 +215,5 @@ index 327919b1fe..1067b5c8f7 100644
+ margin-left: 0.5em;
}
--
2.51.0
2.47.3

19 changes: 9 additions & 10 deletions patches/0007-BLENDER-Remember-login-for-OAuth-Blender-ID.patch
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
From cc522968972bc3c5df57f2516678976c89fb14a0 Mon Sep 17 00:00:00 2001
From 1d9fed7574b38782b975690821963474f00a2c20 Mon Sep 17 00:00:00 2001
From: Brecht Van Lommel <brecht@blender.org>
Date: Fri, 10 May 2024 14:04:02 +0200
Subject: [PATCH 07/19] BLENDER: Remember login for OAuth / Blender ID
Subject: [PATCH 07/22] BLENDER: Remember login for OAuth / Blender ID

Otherwise for some browsers, users have to login again for every session.
---
routers/web/auth/oauth.go | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/routers/web/auth/oauth.go b/routers/web/auth/oauth.go
index f1c155e78f..03457cb260 100644
index 824de60313..7dbdb0f37f 100644
--- a/routers/web/auth/oauth.go
+++ b/routers/web/auth/oauth.go
@@ -21,7 +21,9 @@ import (
@@ -24,6 +24,8 @@ import (
"code.gitea.io/gitea/modules/optional"
"code.gitea.io/gitea/modules/session"
"code.gitea.io/gitea/modules/setting"
+ "code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/web/middleware"
+ auth_service "code.gitea.io/gitea/services/auth"
source_service "code.gitea.io/gitea/services/auth/source"
"code.gitea.io/gitea/services/auth/source/oauth2"
"code.gitea.io/gitea/services/context"
@@ -391,6 +393,17 @@ func handleOAuth2SignIn(ctx *context.Context, authSource *auth.Source, u *user_m
@@ -413,6 +415,17 @@ func handleOAuth2SignIn(ctx *context.Context, authSource *auth.Source, u *user_m
return
}

Expand All @@ -37,9 +36,9 @@ index f1c155e78f..03457cb260 100644
+ }
+ ctx.SetSiteCookie(setting.CookieRememberName, nt.ID+":"+token, setting.LogInRememberDays*timeutil.Day)
+
// force to generate a new CSRF token
ctx.Csrf.PrepareForSessionUser(ctx)

if err := resetLocale(ctx, u); err != nil {
ctx.ServerError("resetLocale", err)
return
--
2.51.0
2.47.3

Loading
Loading