From 0206882e8a9ee226092ffd0d4d39de494d2f9b80 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Sun, 19 Mar 2023 02:29:14 -0400 Subject: [PATCH 01/22] Match api migration behavior to web behavior (#23552) When attempting to migrate a repository via the API endpoint comments are always included. This can create a problem if your source repository has issues or pull requests but you do not want to import them into Gitea that displays as something like: > Error 500: We were unable to perform the request due to server-side problems. 'comment references non existent IssueIndex 4 There are only two ways to resolve this: 1. Migrate using the web interface 2. Migrate using the API including at issues or pull requests. This PR matches the behavior of the API migration router to the web migration router. Co-authored-by: Lauris BH Co-authored-by: Lunny Xiao --- routers/api/v1/repo/migrate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/api/v1/repo/migrate.go b/routers/api/v1/repo/migrate.go index 09e857b5fcfe8..efce39e520344 100644 --- a/routers/api/v1/repo/migrate.go +++ b/routers/api/v1/repo/migrate.go @@ -154,7 +154,7 @@ func Migrate(ctx *context.APIContext) { Issues: form.Issues, Milestones: form.Milestones, Labels: form.Labels, - Comments: true, + Comments: form.Issues || form.PullRequests, PullRequests: form.PullRequests, Releases: form.Releases, GitServiceType: gitServiceType, From 1a4efa0ee9a49d48549be7479a46be133b9bc260 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Sun, 19 Mar 2023 21:44:48 +0900 Subject: [PATCH 02/22] Use `project.IconName` instead of repeated unreadable `if-else` chains (#23538) The project type will be changed in https://github.com/go-gitea/gitea/pull/23353, so the old fix https://github.com/go-gitea/gitea/pull/23325 will not work as well. And I also found that there were some problems in the old fix.... --------- Co-authored-by: Lauris BH --- models/project/project.go | 11 +++++++++++ templates/projects/list.tmpl | 2 +- templates/repo/issue/list.tmpl | 12 ++++-------- templates/repo/issue/new_form.tmpl | 9 +++------ templates/repo/issue/view_content/sidebar.tmpl | 9 +++------ templates/repo/projects/list.tmpl | 2 +- templates/shared/issuelist.tmpl | 2 +- 7 files changed, 24 insertions(+), 23 deletions(-) diff --git a/models/project/project.go b/models/project/project.go index 679d695881c84..44609e60b2ea0 100644 --- a/models/project/project.go +++ b/models/project/project.go @@ -144,10 +144,21 @@ func (p *Project) Link() string { return "" } +func (p *Project) IconName() string { + if p.IsRepositoryProject() { + return "octicon-project" + } + return "octicon-project-symlink" +} + func (p *Project) IsOrganizationProject() bool { return p.Type == TypeOrganization } +func (p *Project) IsRepositoryProject() bool { + return p.Type == TypeRepository +} + func init() { db.RegisterModel(new(Project)) } diff --git a/templates/projects/list.tmpl b/templates/projects/list.tmpl index 89c52dee68088..5062109161ee1 100644 --- a/templates/projects/list.tmpl +++ b/templates/projects/list.tmpl @@ -38,7 +38,7 @@
{{range .Projects}}
  • - {{svg "octicon-project-symlink"}} {{.Title}} + {{svg .IconName}} {{.Title}}
    {{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}} {{if .IsClosed}} diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index 975d659470926..726ef25cfe8ad 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -100,8 +100,7 @@
    {{range .OpenProjects}} - {{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}} - {{.Title}} + {{svg .IconName 18 "gt-mr-3"}}{{.Title}} {{end}} {{end}} @@ -112,8 +111,7 @@
  • {{range .ClosedProjects}} - {{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}} - {{.Title}} + {{svg .IconName 18 "gt-mr-3"}}{{.Title}} {{end}} {{end}} @@ -273,8 +271,7 @@ {{range .OpenProjects}}
    - {{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}} - {{.Title}} + {{svg .IconName 18 "gt-mr-3"}}{{.Title}}
    {{end}} {{end}} @@ -285,8 +282,7 @@ {{range .ClosedProjects}}
    - {{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}} - {{.Title}} + {{svg .IconName 18 "gt-mr-3"}}{{.Title}}
    {{end}} {{end}} diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index b45a00f781403..4945203ca5334 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -134,8 +134,7 @@ {{range .OpenProjects}} - {{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}} - {{.Title}} + {{svg .IconName 18 "gt-mr-3"}}{{.Title}} {{end}} {{end}} @@ -146,8 +145,7 @@ {{range .ClosedProjects}} - {{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}} - {{.Title}} + {{svg .IconName 18 "gt-mr-3"}}{{.Title}} {{end}} {{end}} @@ -159,8 +157,7 @@ diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 40d87b41785b8..cef1e3a02ec89 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -196,8 +196,7 @@ {{range .OpenProjects}} - {{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}} - {{.Title}} + {{svg .IconName 18 "gt-mr-3"}}{{.Title}} {{end}} {{end}} @@ -208,8 +207,7 @@ {{range .ClosedProjects}} - {{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}} - {{.Title}} + {{svg .IconName 18 "gt-mr-3"}}{{.Title}} {{end}} {{end}} @@ -220,8 +218,7 @@ diff --git a/templates/repo/projects/list.tmpl b/templates/repo/projects/list.tmpl index 6833b7d785a70..2350a3af546b5 100644 --- a/templates/repo/projects/list.tmpl +++ b/templates/repo/projects/list.tmpl @@ -40,7 +40,7 @@
    {{range .Projects}}
  • - {{svg "octicon-project"}} {{.Title}} + {{svg .IconName}} {{.Title}}
    {{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}} {{if .IsClosed}} diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl index ae9cb55d44df0..40ddb4dab03a5 100644 --- a/templates/shared/issuelist.tmpl +++ b/templates/shared/issuelist.tmpl @@ -88,7 +88,7 @@ {{end}} {{if .Project}} - {{if .Project.IsOrganizationProject}}{{svg "octicon-project-symlink" 14 "gt-mr-2"}}{{else}}{{svg "octicon-project" 14 "gt-mr-2"}}{{end}}{{.Project.Title}} + {{svg .Project.IconName 14 "gt-mr-2"}}{{.Project.Title}} {{end}} {{if .Ref}} From dbdb5ba33eeecf788650e6c1c675abc602d836b5 Mon Sep 17 00:00:00 2001 From: Samuel FORESTIER Date: Sun, 19 Mar 2023 14:19:37 +0000 Subject: [PATCH 03/22] Sort Python package descriptors by version to mimic PyPI format (#23550) --- Hi, very naive and **untested** first time ever Go code, feel free to reject/edit this as needed. (PyPI actually performs "naive" string comparison too) --------- Co-authored-by: Lauris BH --- routers/api/packages/pypi/pypi.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/routers/api/packages/pypi/pypi.go b/routers/api/packages/pypi/pypi.go index 609c63dc64f5a..2f71801a8f63c 100644 --- a/routers/api/packages/pypi/pypi.go +++ b/routers/api/packages/pypi/pypi.go @@ -8,6 +8,7 @@ import ( "io" "net/http" "regexp" + "sort" "strings" packages_model "code.gitea.io/gitea/models/packages" @@ -62,6 +63,11 @@ func PackageMetadata(ctx *context.Context) { return } + // sort package descriptors by version to mimic PyPI format + sort.Slice(pds, func(i, j int) bool { + return strings.Compare(pds[i].Version.Version, pds[j].Version.Version) < 0 + }) + ctx.Data["RegistryURL"] = setting.AppURL + "api/packages/" + ctx.Package.Owner.Name + "/pypi" ctx.Data["PackageDescriptor"] = pds[0] ctx.Data["PackageDescriptors"] = pds From af3711100a7dc73e8c2482667bbccdcd049e25e0 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 19 Mar 2023 20:58:43 +0100 Subject: [PATCH 04/22] Add `.patch` to `attachment.ALLOWED_TYPES` (#23580) --- custom/conf/app.example.ini | 2 +- docs/content/doc/advanced/config-cheat-sheet.en-us.md | 2 +- modules/setting/attachment.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini index 1e55ce73a2385..131fb3401eec2 100644 --- a/custom/conf/app.example.ini +++ b/custom/conf/app.example.ini @@ -1848,7 +1848,7 @@ ROUTER = console ;ENABLED = true ;; ;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. -;ALLOWED_TYPES = .csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip +;ALLOWED_TYPES = .csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip ;; ;; Max size of each file. Defaults to 4MB ;MAX_SIZE = 4 diff --git a/docs/content/doc/advanced/config-cheat-sheet.en-us.md b/docs/content/doc/advanced/config-cheat-sheet.en-us.md index e0df371a0f0a0..aca591787e91b 100644 --- a/docs/content/doc/advanced/config-cheat-sheet.en-us.md +++ b/docs/content/doc/advanced/config-cheat-sheet.en-us.md @@ -841,7 +841,7 @@ Default templates for project boards: ## Issue and pull request attachments (`attachment`) - `ENABLED`: **true**: Whether issue and pull request attachments are enabled. -- `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. +- `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. - `MAX_SIZE`: **4**: Maximum size (MB). - `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once. - `STORAGE_TYPE`: **local**: Storage type for attachments, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]` diff --git a/modules/setting/attachment.go b/modules/setting/attachment.go index 8b6eb9fd7a1ed..4d4b8e3b02430 100644 --- a/modules/setting/attachment.go +++ b/modules/setting/attachment.go @@ -26,7 +26,7 @@ func loadAttachmentFrom(rootCfg ConfigProvider) { Attachment.Storage = getStorage(rootCfg, "attachments", storageType, sec) - Attachment.AllowedTypes = sec.Key("ALLOWED_TYPES").MustString(".csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip") + Attachment.AllowedTypes = sec.Key("ALLOWED_TYPES").MustString(".csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip") Attachment.MaxSize = sec.Key("MAX_SIZE").MustInt64(4) Attachment.MaxFiles = sec.Key("MAX_FILES").MustInt(5) Attachment.Enabled = sec.Key("ENABLED").MustBool(true) From 371520d7ab5c018c380f8f7981a8be7d40a01f72 Mon Sep 17 00:00:00 2001 From: sillyguodong <33891828+sillyguodong@users.noreply.github.com> Date: Mon, 20 Mar 2023 10:19:40 +0800 Subject: [PATCH 05/22] Display the version of runner in the runner list (#23490) Close: #23489 ### Change 1. Add version column to action_runner table. 2. Read the runner version from the request header, and update it in DB. 3. Display version in runner list ### Screenshot ![image](https://user-images.githubusercontent.com/33891828/225220990-98bc0158-4403-4e6c-9805-31bbbc65a802.png) --- models/actions/runner.go | 1 + models/migrations/migrations.go | 2 ++ models/migrations/v1_20/v248.go | 14 ++++++++++++++ options/locale/locale_en-US.ini | 1 + routers/api/actions/runner/interceptor.go | 17 +++++++++++++++-- templates/shared/actions/runner_list.tmpl | 2 ++ 6 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 models/migrations/v1_20/v248.go diff --git a/models/actions/runner.go b/models/actions/runner.go index 4efe105b08845..cce8b4f4431d3 100644 --- a/models/actions/runner.go +++ b/models/actions/runner.go @@ -25,6 +25,7 @@ type ActionRunner struct { ID int64 UUID string `xorm:"CHAR(36) UNIQUE"` Name string `xorm:"VARCHAR(255)"` + Version string `xorm:"VARCHAR(64)"` OwnerID int64 `xorm:"index"` // org level runner, 0 means system Owner *user_model.User `xorm:"-"` RepoID int64 `xorm:"index"` // repo level runner, if orgid also is zero, then it's a global diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index 5401ae2fa6352..6224e1c8d7c0f 100644 --- a/models/migrations/migrations.go +++ b/models/migrations/migrations.go @@ -473,6 +473,8 @@ var migrations = []Migration{ NewMigration("Add missed column owner_id for project table", v1_20.AddNewColumnForProject), // v247 -> v248 NewMigration("Fix incorrect project type", v1_20.FixIncorrectProjectType), + // v248 -> v249 + NewMigration("Add version column to action_runner table", v1_20.AddVersionToActionRunner), } // GetCurrentDBVersion returns the current db version diff --git a/models/migrations/v1_20/v248.go b/models/migrations/v1_20/v248.go new file mode 100644 index 0000000000000..40555210e7e0b --- /dev/null +++ b/models/migrations/v1_20/v248.go @@ -0,0 +1,14 @@ +// Copyright 2023 The Gitea Authors. All rights reserved. +// SPDX-License-Identifier: MIT + +package v1_20 //nolint + +import "xorm.io/xorm" + +func AddVersionToActionRunner(x *xorm.Engine) error { + type ActionRunner struct { + Version string `xorm:"VARCHAR(64)"` // the version of act_runner + } + + return x.Sync(new(ActionRunner)) +} diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index da925a27f5d3d..e519258c6b28f 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -3355,6 +3355,7 @@ runners.status.unspecified = Unknown runners.status.idle = Idle runners.status.active = Active runners.status.offline = Offline +runners.version = Version runs.all_workflows = All Workflows runs.open_tab = %d Open diff --git a/routers/api/actions/runner/interceptor.go b/routers/api/actions/runner/interceptor.go index 8c0bd86ecb6c6..d97b78f8513be 100644 --- a/routers/api/actions/runner/interceptor.go +++ b/routers/api/actions/runner/interceptor.go @@ -21,8 +21,11 @@ import ( ) const ( - uuidHeaderKey = "x-runner-uuid" - tokenHeaderKey = "x-runner-token" + uuidHeaderKey = "x-runner-uuid" + tokenHeaderKey = "x-runner-token" + versionHeaderKey = "x-runner-version" + + versionUnknown = "Unknown" ) var withRunner = connect.WithInterceptors(connect.UnaryInterceptorFunc(func(unaryFunc connect.UnaryFunc) connect.UnaryFunc { @@ -33,6 +36,12 @@ var withRunner = connect.WithInterceptors(connect.UnaryInterceptorFunc(func(unar } uuid := request.Header().Get(uuidHeaderKey) token := request.Header().Get(tokenHeaderKey) + version := request.Header().Get(versionHeaderKey) + if util.IsEmptyString(version) { + version = versionUnknown + } + version, _ = util.SplitStringAtByteN(version, 64) + runner, err := actions_model.GetRunnerByUUID(ctx, uuid) if err != nil { if errors.Is(err, util.ErrNotExist) { @@ -45,6 +54,10 @@ var withRunner = connect.WithInterceptors(connect.UnaryInterceptorFunc(func(unar } cols := []string{"last_online"} + if runner.Version != version { + runner.Version = version + cols = append(cols, "version") + } runner.LastOnline = timeutil.TimeStampNow() if methodName == "UpdateTask" || methodName == "UpdateLog" { runner.LastActive = timeutil.TimeStampNow() diff --git a/templates/shared/actions/runner_list.tmpl b/templates/shared/actions/runner_list.tmpl index 30c52c01b4577..dd2e43f816a93 100644 --- a/templates/shared/actions/runner_list.tmpl +++ b/templates/shared/actions/runner_list.tmpl @@ -49,6 +49,7 @@ {{.locale.Tr "actions.runners.status"}} {{.locale.Tr "actions.runners.id"}} {{.locale.Tr "actions.runners.name"}} + {{.locale.Tr "actions.runners.version"}} {{.locale.Tr "actions.runners.owner_type"}} {{.locale.Tr "actions.runners.labels"}} {{.locale.Tr "actions.runners.last_online"}} @@ -64,6 +65,7 @@ {{.ID}}

    {{.Name}}

    + {{.Version}} {{.OwnType}} {{range .AllLabels}}{{.}}{{end}} From ccd3a55bf4f07a390e13d48100c58fb937fd3dcf Mon Sep 17 00:00:00 2001 From: delvh Date: Mon, 20 Mar 2023 08:42:23 +0100 Subject: [PATCH 06/22] Add CHANGELOG for 1.19.0 (#23583) Co-authored-by: silverwind Co-authored-by: Lauris BH Co-authored-by: techknowlogick Co-authored-by: Lunny Xiao --- CHANGELOG.md | 350 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 350 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 507722f31b1d1..324b0cdfd6023 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,356 @@ This changelog goes through all the changes that have been made in each release without substantial changes to our git log; to see the highlights of what has been added to each release, please refer to the [blog](https://blog.gitea.io). +## [1.19.0](https://github.com/go-gitea/gitea/releases/tag/1.19.0) - 2023-03-19 + +* BREAKING + * Add loading yaml label template files (#22976) (#23232) + * Make issue and code search support camel case for Bleve (#22829) + * Repositories: by default disable all units except code and pulls on forks (#22541) + * Support template for merge message description (#22248) + * Remove ONLY_SHOW_RELEVANT_REPOS setting (#21962) + * Implement actions (#21937) + * Remove deprecated DSA host key from Docker Container (#21522) + * Improve valid user name check (#20136) +* SECURITY + * Return 404 instead of 403 if user can not access the repo (#23155) (#23158) + * Support scoped access tokens (#20908) +* FEATURES + * Add support for commit cross references (#22645) + * Scoped labels (#22585) + * Add Chef package registry (#22554) + * Support asciicast files as new markup (#22448) + * cgo cross-compile for freebsd (#22397) + * Add cron method to gc LFS MetaObjects (#22385) + * Add new captcha: cloudflare turnstile (#22369) + * Enable `@`- completion popup on the release description textarea (#22359) + * make /{username}.png redirect to user/org avatar (#22356) + * Add Conda package registry (#22262) + * Support org/user level projects (#22235) + * Add Mermaid copy button (#22225) + * Add user secrets (#22191) + * Secrets storage with SecretKey encrypted (#22142) + * Preview images for Issue cards in Project Board view (#22112) + * Add support for incoming emails (#22056) + * Add Cargo package registry (#21888) + * Add option to prohibit fork if user reached maximum limit of repositories (#21848) + * Add attention blocks within quote blocks for `Note` and `Warning` (#21711) + * Add Feed for Releases and Tags (#21696) + * Add package registry cleanup rules (#21658) + * Add "Copy" button to file view of raw text (#21629) + * Allow disable sitemap (#21617) + * Add package registry quota limits (#21584) + * Map OIDC groups to Orgs/Teams (#21441) + * Keep languages defined in .gitattributes (#21403) + * Add Webhook authorization header (#20926) + * Supports wildcard protected branch (#20825) + * Copy citation file content, in APA and BibTex format, on repo home page (#19999) +* API + * Match api migration behavior to web behavior (#23552) (#23573) + * Purge API comment (#23451) (#23452) + * User creation API: allow custom "created" timestamps (#22549) + * Add `updated_at` field to PullReview API object (#21812) + * Add API management for issue/pull and comment attachments (#21783) + * Add API endpoint to get latest release (#21267) + * Support system hook API (#14537) +* ENHANCEMENTS + * Add `.patch` to `attachment.ALLOWED_TYPES` (#23580) (#23582) + * Fix sticky header in diff view (#23554) (#23568) + * Refactor merge/update git command calls (#23366) (#23544) + * Fix review comment context menu clipped bug (#23523) (#23543) + * Imrove scroll behavior to hash issuecomment(scroll position, auto expand if file is folded, and on refreshing) (#23513) (#23540) + * Increase horizontal page padding (#23507) (#23537) + * Use octicon-verified for gpg signatures (#23529) (#23536) + * Make time tooltips interactive (#23526) (#23527) + * Replace Less with CSS (#23508) + * Fix 'View File' button in code search (#23478) (#23483) + * Convert GitHub event on actions and fix some pull_request events. (#23037) (#23471) + * Support reflogs (#22451) (#23438) + * Fix actions frontend bugs (pagination, long name alignment) and small simplify (#23370) (#23436) + * Scoped label display and documentation tweaks (#23430) (#23433) + * Add missing tabs to org projects page (#22705) (#23412) + * Fix and move "Use this template" button (#23398) (#23408) + * Handle OpenID discovery URL errors a little nicer when creating/editing sources (#23397) (#23403) + * Rename `canWriteUnit` to `canWriteProjects` (#23386) (#23399) + * Refactor and tidy-up the merge/update branch code (#22568) (#23365) + * Refactor `setting.Database.UseXXX` to methods (#23354) (#23356) + * Fix incorrect project links and use symlink icon for org-wide projects (#23325) (#23336) + * Fix PR view misalignment caused by long name file (#23321) (#23335) + * Scoped labels: don't require holding alt key to remove (#23303) (#23331) + * Add context when rendering labels or emojis (#23281) (#23319) + * Change interactiveBorder to fix popup preview (#23169) (#23314) + * Scoped labels: set aria-disabled on muted Exclusive option for a11y (#23306) (#23311) + * update to mermaid v10 (#23178) (#23299) + * Fix code wrap for unbroken lines (#23268) (#23293) + * Use async await to fix empty quote reply at first time (#23168) (#23256) + * Fix switched citation format (#23250) (#23253) + * Allow `
  • From f83246edb263c039904ee9723f5dfc2a46f2259f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A5=E8=87=AA=E6=9D=91=E9=87=8C=E7=9A=84=E5=B0=8F?= =?UTF-8?q?=E8=9E=83=E8=9F=B9?= Date: Tue, 21 Mar 2023 06:26:01 +0800 Subject: [PATCH 10/22] fix submodule is nil panic (#23588) #23587 submodule path is nil It is panic a nil error --------- Co-authored-by: delvh Co-authored-by: KN4CK3R --- services/repository/files/content.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/repository/files/content.go b/services/repository/files/content.go index 31827e8846ed3..6f6dc91d859ab 100644 --- a/services/repository/files/content.go +++ b/services/repository/files/content.go @@ -214,7 +214,9 @@ func GetContents(ctx context.Context, repo *repo_model.Repository, treePath, ref if err != nil { return nil, err } - contentsResponse.SubmoduleGitURL = &submodule.URL + if submodule != nil && submodule.URL != "" { + contentsResponse.SubmoduleGitURL = &submodule.URL + } } // Handle links if entry.IsRegular() || entry.IsLink() { From 6250fe1dc15eccc18cdc4261e354c1c77f0a7fca Mon Sep 17 00:00:00 2001 From: delvh Date: Tue, 21 Mar 2023 01:41:57 +0100 Subject: [PATCH 11/22] Fix `.locale.Tr` function not found in delete modal (#23468) Caught by @wxiaoguang in https://github.com/go-gitea/gitea/pull/23337#issuecomment-1467317742. Additionally, there were three instances that have the same content as `templates/base/deletion_modal_actions.tmpl` but that are not intended to delete something. Instead of renaming the template above, these instances were simply re-hard-coded again. Renaming/improving the template above is left for future PRs. --- templates/admin/repo/unadopted.tmpl | 22 ++++++++++++++++++++-- templates/user/settings/repos.tmpl | 13 +++++++++++-- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/templates/admin/repo/unadopted.tmpl b/templates/admin/repo/unadopted.tmpl index 7ff41d503ad29..a8e04850d0dd3 100644 --- a/templates/admin/repo/unadopted.tmpl +++ b/templates/admin/repo/unadopted.tmpl @@ -43,7 +43,16 @@ - {{template "base/delete_modal_actions" .}} +
    + + +
    @@ -61,7 +70,16 @@ - {{template "base/delete_modal_actions" .}} +
    + + +
    diff --git a/templates/user/settings/repos.tmpl b/templates/user/settings/repos.tmpl index 2e107ca7fa1a7..6742cb1671826 100644 --- a/templates/user/settings/repos.tmpl +++ b/templates/user/settings/repos.tmpl @@ -50,7 +50,16 @@ {{$.CsrfTokenHtml}} - {{template "base/delete_modal_actions" .}} +
    + + +
    {{end}} @@ -68,7 +77,7 @@ {{$.CsrfTokenHtml}} - {{template "base/delete_modal_actions" .}} + {{template "base/delete_modal_actions" $}} {{end}} From 45aa4ea7056f5a6cd286715596b64f4163588cd8 Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 21 Mar 2023 02:07:14 +0100 Subject: [PATCH 12/22] Fix pagination on `/notifications/watching` (#23564) The `q` parameter was not rendered in pagination links because `context.Pagination:AddParam` checks for existance of the parameter in `ctx.Data` where it was absent. Added the parameter there to fix it. --- routers/web/user/notification.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routers/web/user/notification.go b/routers/web/user/notification.go index e12b41e649e63..e0aa92879fcc4 100644 --- a/routers/web/user/notification.go +++ b/routers/web/user/notification.go @@ -344,6 +344,9 @@ func NotificationWatching(ctx *context.Context) { page = 1 } + keyword := ctx.FormTrim("q") + ctx.Data["Keyword"] = keyword + var orderBy db.SearchOrderBy ctx.Data["SortType"] = ctx.FormString("sort") switch ctx.FormString("sort") { @@ -378,7 +381,7 @@ func NotificationWatching(ctx *context.Context) { Page: page, }, Actor: ctx.Doer, - Keyword: ctx.FormTrim("q"), + Keyword: keyword, OrderBy: orderBy, Private: ctx.IsSigned, WatchedByID: ctx.Doer.ID, From 34a2cf5079fb9537d1927ddc57cc3f9267a079fc Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 21 Mar 2023 02:42:02 +0100 Subject: [PATCH 13/22] Replace a few fontawesome icons with svg (#23602) Replaced a few icons with SVG. The only ones left are some in actions (idk why new code introduces legacy icons) and a few dropdown icons. --- templates/org/team/repositories.tmpl | 2 +- templates/repo/editor/edit.tmpl | 6 +++--- templates/repo/editor/patch.tmpl | 2 +- templates/user/auth/webauthn.tmpl | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/org/team/repositories.tmpl b/templates/org/team/repositories.tmpl index 0391a762faf22..c8651761eb130 100644 --- a/templates/org/team/repositories.tmpl +++ b/templates/org/team/repositories.tmpl @@ -77,7 +77,7 @@