]> source.dussan.org Git - gitea.git/log
gitea.git
4 months ago[Refactor] Unify repo search order by logic (#30876)
6543 [Thu, 13 Jun 2024 09:13:11 +0000 (11:13 +0200)]
[Refactor] Unify repo search order by logic (#30876)

have repo OrderBy definitions defined in one place and use a single type
for OrderBy database options

4 months agoFixed incorrect localization `explorer.go` (#31348)
Kerwin Bryant [Thu, 13 Jun 2024 01:43:41 +0000 (09:43 +0800)]
Fixed incorrect localization `explorer.go` (#31348)

see: https://github.com/go-gitea/gitea/pull/29701/files#r1637325139

4 months agoImprove detecting empty files (#31332)
wxiaoguang [Thu, 13 Jun 2024 01:06:46 +0000 (09:06 +0800)]
Improve detecting empty files (#31332)

Co-authored-by: silverwind <me@silverwind.io>
4 months agoFix hash render end with colon (#31319)
Lunny Xiao [Wed, 12 Jun 2024 22:35:46 +0000 (06:35 +0800)]
Fix hash render end with colon (#31319)

Fix a hash render problem like `<hash>: xxxxx` which is usually used in
release notes.

4 months agoFix line number widths (#31341)
silverwind [Wed, 12 Jun 2024 15:23:42 +0000 (17:23 +0200)]
Fix line number widths (#31341)

Fixes regression
https://github.com/go-gitea/gitea/pull/31307#issuecomment-2162554913

Table CSS is weird. A `auto` value does not work and causes the
regression while any pixel value causes another regression in diff where
the code lines do not stretch. Partially revert that PR and clean up
some related too-deep CSS selectors.

<img width="109" alt="Screenshot 2024-06-12 at 15 07 22"
src="https://github.com/go-gitea/gitea/assets/115237/756c5dea-44b8-49f9-8a08-acef68075f62">
<img width="119" alt="Screenshot 2024-06-12 at 15 07 43"
src="https://github.com/go-gitea/gitea/assets/115237/28ae1adc-118e-4016-8d09-033b9f1c9a6f">
<img width="151" alt="Screenshot 2024-06-12 at 15 07 07"
src="https://github.com/go-gitea/gitea/assets/115237/08db7ed9-de4e-405e-874d-c7ebe3082557">
<img width="141" alt="Screenshot 2024-06-12 at 15 07 14"
src="https://github.com/go-gitea/gitea/assets/115237/c4a5492b-1bf1-4773-bc8d-64eb36d823f9">

4 months agoFix navbar `+` menu flashing on page load (#31281)
silverwind [Wed, 12 Jun 2024 14:58:03 +0000 (16:58 +0200)]
Fix navbar `+` menu flashing on page load (#31281)

Fixes
https://github.com/go-gitea/gitea/pull/31273#issuecomment-2153771331.
Same method as used in https://github.com/go-gitea/gitea/pull/30215. All
left-opening dropdowns need to use it method.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
4 months agoReduce memory usage for chunked artifact uploads to MinIO (#31325)
Rowan Bohde [Wed, 12 Jun 2024 11:34:35 +0000 (06:34 -0500)]
Reduce memory usage for chunked artifact uploads to MinIO (#31325)

When using the MinIO storage driver for Actions Artifacts, we found that
the chunked artifact required significantly more memory usage to both
upload and merge than the local storage driver. This seems to be related
to hardcoding a value of `-1` for the size to the MinIO client [which
has a warning about memory usage in the respective
docs](https://pkg.go.dev/github.com/minio/minio-go/v7#Client.PutObject).
Specifying the size in both the upload and merge case reduces memory
usage of the MinIO client.

Co-authored-by: Kyle D <kdumontnu@gmail.com>
4 months agoFix dates displaying in a wrong manner when we're close to the end of the month ...
Yarden Shoham [Wed, 12 Jun 2024 10:27:00 +0000 (13:27 +0300)]
Fix dates displaying in a wrong manner when we're close to the end of the month (#31331)

I tested and all timestamps work as before.

- Reference https://github.com/github/relative-time-element/pull/285
- Fixes https://github.com/go-gitea/gitea/issues/31197

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
4 months agoFix adopt repository has empty object name in database (#31333)
Lunny Xiao [Wed, 12 Jun 2024 10:22:01 +0000 (18:22 +0800)]
Fix adopt repository has empty object name in database (#31333)

Fix #31330
Fix #31311

A workaround to fix the old database is to update object_format_name to
`sha1` if it's empty or null.

4 months agoOptimize profile layout to enhance visual experience (#31278)
Kerwin Bryant [Wed, 12 Jun 2024 04:06:12 +0000 (12:06 +0800)]
Optimize profile layout to enhance visual experience (#31278)

Co-authored-by: silverwind <me@silverwind.io>
4 months agoFix #31185 try fix lfs download from bitbucket failed (#31201)
Zoupers Zou [Tue, 11 Jun 2024 22:22:28 +0000 (06:22 +0800)]
Fix #31185 try fix lfs download from bitbucket failed (#31201)

Fix #31185

4 months agoEnable `unparam` linter (#31277)
silverwind [Tue, 11 Jun 2024 18:47:45 +0000 (20:47 +0200)]
Enable `unparam` linter (#31277)

Enable [unparam](https://github.com/mvdan/unparam) linter.

Often I could not tell the intention why param is unused, so I put
`//nolint` for those cases like webhook request creation functions never
using `ctx`.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
4 months agoMake template `Iif` exactly match `if` (#31322)
wxiaoguang [Tue, 11 Jun 2024 14:52:12 +0000 (22:52 +0800)]
Make template `Iif` exactly match `if` (#31322)

4 months agoupdate nix flake and add gofumpt (#31320)
6543 [Tue, 11 Jun 2024 13:47:13 +0000 (15:47 +0200)]
update nix flake and add gofumpt (#31320)

nix flake maintenance

4 months agocode optimization (#31315)
Kerwin Bryant [Tue, 11 Jun 2024 13:07:10 +0000 (21:07 +0800)]
code optimization (#31315)

Simplifying complex if-else to existing Iif operations

4 months agoFix line number width in code preview (#31307)
silverwind [Tue, 11 Jun 2024 04:54:39 +0000 (06:54 +0200)]
Fix line number width in code preview (#31307)

Line numbers were using some hacky CSS `width: 1%` that did nothing to
the code rendering as far as I can tell but broken the inline preview in
markup when line numbers are greater than 2 digits. Also I removed one
duplicate `font-family` rule (it is set below in the `.lines-num,
.lines-code` selector.

4 months agoDelete legacy cookie before setting new cookie (#31306)
wxiaoguang [Tue, 11 Jun 2024 03:31:23 +0000 (11:31 +0800)]
Delete legacy cookie before setting new cookie (#31306)

Try to fix #31202

4 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 11 Jun 2024 00:26:13 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

4 months agoUse `querySelector` over alternative DOM methods (#31280)
silverwind [Mon, 10 Jun 2024 20:49:33 +0000 (22:49 +0200)]
Use `querySelector` over alternative DOM methods (#31280)

As per
https://github.com/go-gitea/gitea/pull/30115#discussion_r1626060164,
prefer `querySelector` by enabling
[`unicorn/prefer-query-selector`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-query-selector.md)
and autofixing all except 10 issues.

According to
[this](https://old.reddit.com/r/learnjavascript/comments/i0f5o8/performance_of_getelementbyid_vs_queryselector/),
querySelector may be faster as well, so it's a win-win.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
4 months agoRemove jQuery `.text()` (#30506)
silverwind [Mon, 10 Jun 2024 10:12:31 +0000 (12:12 +0200)]
Remove jQuery `.text()` (#30506)

Remove and forbid [.text()](https://api.jquery.com/text/). Tested some,
but not all functionality, but I think these are pretty safe
replacements.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
4 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 10 Jun 2024 00:27:20 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

4 months agoRemove sub-path from container registry realm (#31293)
wxiaoguang [Sun, 9 Jun 2024 08:29:29 +0000 (16:29 +0800)]
Remove sub-path from container registry realm (#31293)

Container registry requires that the "/v2" must be in the root, so the
sub-path in AppURL should be removed

4 months agoFix some URLs whose sub-path is missing (#31289)
wxiaoguang [Fri, 7 Jun 2024 15:15:17 +0000 (23:15 +0800)]
Fix some URLs whose sub-path is missing (#31289)

Fix #31285

4 months agoFix and clean up `ConfirmModal` (#31283)
silverwind [Fri, 7 Jun 2024 13:42:31 +0000 (15:42 +0200)]
Fix and clean up `ConfirmModal` (#31283)

Bug: orange button color was removed in
https://github.com/go-gitea/gitea/pull/30475, replaced with red
Bug: translation text was not html-escaped
Refactor: Replaced as much jQuery as possible, added useful
`createElementFromHTML`
Refactor: Remove colors checks that don't exist on `.link-action`

<img width="381" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/5900bf6a-8a86-4a86-b368-0559cbfea66e">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
4 months agoEnable poetry non-package mode (#31282)
silverwind [Fri, 7 Jun 2024 13:37:33 +0000 (15:37 +0200)]
Enable poetry non-package mode (#31282)

[Poetry
1.8.0](https://github.com/python-poetry/poetry/releases/tag/1.8.0) added
support for [non-package
mode](https://python-poetry.org/docs/basic-usage/#operating-modes), e.g.
projects that are not python packages themselves like we are. Make use
of that and remove the previous workaround via `--no-root`.

4 months agofixed the dropdown menu for the top New button to expand to the left (#31273)
Kerwin Bryant [Thu, 6 Jun 2024 23:49:53 +0000 (07:49 +0800)]
fixed the dropdown menu for the top New button to expand to the left (#31273)

before:

![1717660314025](https://github.com/go-gitea/gitea/assets/3371163/17ae7a48-31c5-4c71-b285-f65d9106bf86)

after:

![1717660674763](https://github.com/go-gitea/gitea/assets/3371163/85f847ac-a044-4695-9004-26e6485288c6)

4 months agoOptimize repo-list layout to enhance visual experience (#31272)
Kerwin Bryant [Thu, 6 Jun 2024 23:22:03 +0000 (07:22 +0800)]
Optimize repo-list layout to enhance visual experience (#31272)

before:

![1717655078227](https://github.com/go-gitea/gitea/assets/3371163/4d564f96-c2f8-46b1-996f-6cc7abb940ef)
***The problem was that the icon and text were not on a horizontal line,
and the horizontal was not centered;***

after:

![1717655094071](https://github.com/go-gitea/gitea/assets/3371163/b11797f6-05f8-486c-b5fd-df89d0cbdcfd)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
4 months agoAllow including `Reviewed-on`/`Reviewed-by` lines for custom merge messages (#31211)
Max Wipfli [Thu, 6 Jun 2024 08:35:04 +0000 (10:35 +0200)]
Allow including `Reviewed-on`/`Reviewed-by` lines for custom merge messages (#31211)

This PR introduces the `ReviewedOn` and `ReviewedBy` variables for the
default merge message templates (e.g.,
`.gitea/default_merge_message/MERGE_TEMPLATE.md`).

This allows customizing the default merge messages while retaining these
trailers.

This also moves the associated logic out of `pull.tmpl` into the
relevant Go function.

This is a first contribution towards #11077.

---

For illustration, this allows to recreate the "default default" merge
message with the following template:
```
.gitea/default_merge_message/MERGE_TEMPLATE.md
Merge pull request '${PullRequestTitle}' (${PullRequestReference}) from ${HeadBranch} into ${BaseBranch}

${ReviewedOn}
${ReviewedBy}
```

4 months agoAdd `MAX_ROWS` option for CSV rendering (#30268)
Henrique Pimentel [Thu, 6 Jun 2024 08:06:59 +0000 (09:06 +0100)]
Add `MAX_ROWS` option for CSV rendering (#30268)

This solution implements a new config variable MAX_ROWS, which
corresponds to the “Maximum allowed rows to render CSV files. (0 for no
limit)” and rewrites the Render function for CSV files in markup module.
Now the render function only reads the file once, having MAX_FILE_SIZE+1
as a reader limit and MAX_ROWS as a row limit. When the file is larger
than MAX_FILE_SIZE or has more rows than MAX_ROWS, it only renders until
the limit, and displays a user-friendly warning informing that the
rendered data is not complete, in the user's language.

---

Previously, when a CSV file was larger than the limit, the render
function lost its function to render the code. There were also multiple
reads to the file, in order to determine its size and render or
pre-render.

The warning: ![image](https://s3.amazonaws.com/i.snag.gy/vcKh90.jpg)

4 months agoUpdate `golang.org/x/net` (#31260)
silverwind [Thu, 6 Jun 2024 04:29:42 +0000 (06:29 +0200)]
Update `golang.org/x/net` (#31260)

Result of `go get -u golang.org/x/net && make tidy`. ~~Fixes
https://pkg.go.dev/vuln/GO-2024-2887.~~

4 months agoAdd replacement module for `mholt/archiver` (#31267)
silverwind [Thu, 6 Jun 2024 03:37:08 +0000 (05:37 +0200)]
Add replacement module for `mholt/archiver` (#31267)

Switch to this fork tag:
https://github.com/anchore/archiver/releases/tag/v3.5.2 which includes
https://github.com/anchore/archiver/commit/82ca88a2eb24d418c30bf960ef071b0bbec04631.

Ref: https://pkg.go.dev/vuln/GO-2024-2698
Ref: https://github.com/advisories/GHSA-rhh4-rh7c-7r5v

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 months agoFix Activity Page Contributors dropdown (#31264)
wxiaoguang [Thu, 6 Jun 2024 02:28:33 +0000 (10:28 +0800)]
Fix Activity Page Contributors dropdown (#31264)

Fix #31261

4 months agoOptimize runner-tags layout to enhance visual experience (#31258)
Kerwin Bryant [Wed, 5 Jun 2024 14:39:45 +0000 (22:39 +0800)]
Optimize runner-tags layout to enhance visual experience (#31258)

![image](https://github.com/go-gitea/gitea/assets/3371163/b8199005-94f2-45be-8ca9-4fa1b3f221b2)

4 months agofix: allow actions artifacts storage migration to complete succesfully (#31251)
Rowan Bohde [Wed, 5 Jun 2024 04:00:56 +0000 (23:00 -0500)]
fix: allow actions artifacts storage migration to complete succesfully (#31251)

Change the copy to use `ActionsArtifact.StoragePath` instead of the
`ArtifactPath`. Skip artifacts that are expired, and don't error if the
file to copy does not exist.

---

When trying to migrate actions artifact storage from local to MinIO, we
encountered errors that prevented the process from completing
successfully:

* The migration tries to copy the files using the per-run
`ArtifactPath`, instead of the unique `StoragePath`.
* Artifacts that have been marked expired and had their files deleted
would throw an error
* Artifacts that are pending, but don't have a file uploaded yet will
throw an error.

This PR addresses these cases, and allow the process to complete
successfully.

4 months agoAdd `lint-go-gopls` (#30729)
silverwind [Wed, 5 Jun 2024 01:22:38 +0000 (03:22 +0200)]
Add `lint-go-gopls` (#30729)

Uses `gopls check <files>` as a linter. Tested locally and brings up 149
errors currently for me. I don't think I want to fix them in this PR,
but I would like at least to get this analysis running on CI.

List of errors:
```
modules/indexer/code/indexer.go:181:11: impossible condition: nil != nil
routers/private/hook_post_receive.go:120:15: tautological condition: nil == nil
services/auth/source/oauth2/providers.go:185:9: tautological condition: nil == nil
services/convert/issue.go:216:11: tautological condition: non-nil != nil
tests/integration/git_test.go:332:9: impossible condition: nil != nil
services/migrations/migrate.go:179:24-43: unused parameter: ctx
services/repository/transfer.go:288:48-69: unused parameter: doer
tests/integration/api_repo_tags_test.go:75:41-61: unused parameter: session
tests/integration/git_test.go:696:64-74: unused parameter: baseBranch
tests/integration/gpg_git_test.go:265:27-39: unused parameter: t
tests/integration/gpg_git_test.go:284:23-29: unused parameter: tmpDir
tests/integration/gpg_git_test.go:284:31-35: unused parameter: name
tests/integration/gpg_git_test.go:284:37-42: unused parameter: email
```

4 months agoMake blockquote attention recognize more syntaxes (#31240)
wxiaoguang [Tue, 4 Jun 2024 15:35:29 +0000 (23:35 +0800)]
Make blockquote attention recognize more syntaxes (#31240)

Fix #31214

4 months agoFix admin oauth2 custom URL settings (#31246)
wxiaoguang [Tue, 4 Jun 2024 15:06:21 +0000 (23:06 +0800)]
Fix admin oauth2 custom URL settings (#31246)

Fix #31244

4 months agoReplace `gt-word-break` with `tw-break-anywhere` (#31183)
silverwind [Tue, 4 Jun 2024 13:57:11 +0000 (15:57 +0200)]
Replace `gt-word-break` with `tw-break-anywhere` (#31183)

`overflow-wrap: anywhere` is a superior alternative to `word-wrap:
break-word` and we were already setting it in the class. I tested a few
cases, all look good.

4 months agoMake pasted "img" tag has the same behavior as markdown image (#31235)
wxiaoguang [Tue, 4 Jun 2024 12:19:41 +0000 (20:19 +0800)]
Make pasted "img" tag has the same behavior as markdown image (#31235)

Fix #31230

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 months agoRemove .segment from .project-column (#31204)
silverwind [Tue, 4 Jun 2024 07:46:05 +0000 (09:46 +0200)]
Remove .segment from .project-column (#31204)

Using `.segment` on the project columns is a major abuse of that class,
so remove it and instead set the border-radius directly on it.

Fixes: https://github.com/go-gitea/gitea/issues/31129
4 months agoFix overflow on push notification (#31179)
silverwind [Tue, 4 Jun 2024 07:14:24 +0000 (09:14 +0200)]
Fix overflow on push notification (#31179)

Fixes: https://github.com/go-gitea/gitea/issues/30063
<img width="1301" alt="Screenshot 2024-05-30 at 14 43 24"
src="https://github.com/go-gitea/gitea/assets/115237/00443af0-088d-49a5-be9e-8c9adcc2c01d">

4 months agoFix NuGet Package API for $filter with Id equality (#31188)
Thomas Desveaux [Tue, 4 Jun 2024 06:45:56 +0000 (08:45 +0200)]
Fix NuGet Package API for $filter with Id equality  (#31188)

Fixes issue when running `choco info pkgname` where `pkgname` is also a
substring of another package Id.

Relates to #31168

---

This might fix the issue linked, but I'd like to test it with more choco
commands before closing the issue in case I find other problems if
that's ok.

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
4 months agoFix overflow on notifications (#31178)
silverwind [Tue, 4 Jun 2024 06:10:04 +0000 (08:10 +0200)]
Fix overflow on notifications (#31178)

Fixes https://github.com/go-gitea/gitea/issues/31170.

<img width="1312" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/627711ed-93ca-4be6-b958-10d673ae9517">

4 months agoUpdate chroma to v2.14.0 (#31177)
silverwind [Tue, 4 Jun 2024 05:34:34 +0000 (07:34 +0200)]
Update chroma to v2.14.0 (#31177)

https://github.com/alecthomas/chroma/releases/tag/v2.14.0

Tested it with a typescript file.

4 months agoUpdate air package path (#31233)
yp05327 [Tue, 4 Jun 2024 05:00:44 +0000 (14:00 +0900)]
Update air package path (#31233)

4 months agoBump `@github/relative-time-element` to v4.4.1 (#31232)
Yarden Shoham [Tue, 4 Jun 2024 03:01:06 +0000 (06:01 +0300)]
Bump `@github/relative-time-element` to v4.4.1 (#31232)

I tested and all timestamps work as before.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
4 months agoAdd option for mailer to override mail headers (#27860)
6543 [Mon, 3 Jun 2024 18:42:52 +0000 (20:42 +0200)]
Add option for mailer to override mail headers (#27860)

Add option to override headers of mails, gitea send out

---
*Sponsored by Kithara Software GmbH*

4 months agoMove custom `tw-` helpers to tailwind plugin (#31184)
silverwind [Mon, 3 Jun 2024 18:21:28 +0000 (20:21 +0200)]
Move custom `tw-` helpers to tailwind plugin (#31184)

Move the previous custom `tw-` classes to be defined in a tailwind
plugin. I think it's cleaner that way and I also verified double-class
works as expected:

<img width="299" alt="Screenshot 2024-05-30 at 19 06 24"
src="https://github.com/go-gitea/gitea/assets/115237/003cbc76-2013-46a0-9e27-63023fa7c7a4">

4 months agoRemove unnecessary inline style for tab-size (#31224)
silverwind [Mon, 3 Jun 2024 17:21:45 +0000 (19:21 +0200)]
Remove unnecessary inline style for tab-size (#31224)

Move the rule to the parent node. `tab-size` is inherited so will work
just as before.

4 months agoDocument possible action types for the user activity feed API (#31196)
Kemal Zebari [Mon, 3 Jun 2024 13:40:48 +0000 (06:40 -0700)]
Document possible action types for the user activity feed API (#31196)

Resolves #31131.

It uses the the go-swagger `enum` property to document the activity
action types.

4 months agoRemove sqlite-viewer and using database client (#31223)
yp05327 [Mon, 3 Jun 2024 10:41:29 +0000 (19:41 +0900)]
Remove sqlite-viewer and using database client (#31223)

sqlite-viewer can not edit sqlite.
database client can connect to almost all common databases, which is
very useful I think. Of cause, it can edit sqlite.

https://marketplace.visualstudio.com/items?itemName=cweijan.vscode-database-client2

And for using sqlite, sqlite3 is required. So also added a new feature:
https://github.com/warrenbuckley/codespace-features
found from: https://containers.dev/features

4 months agoUpdate golangci-lint to v1.59.0 (#31221)
silverwind [Mon, 3 Jun 2024 07:04:35 +0000 (09:04 +0200)]
Update golangci-lint to v1.59.0 (#31221)

One new error regarding `fmt.Fscanf` error return in `gitdiff.go` but
I'm not touching that further right now as handling the error would
introduce a behaviour difference.

4 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 3 Jun 2024 00:27:17 +0000 (00:27 +0000)]
[skip ci] Updated licenses and gitignores

4 months agoFix overflow in issue card (#31203)
silverwind [Mon, 3 Jun 2024 00:09:51 +0000 (02:09 +0200)]
Fix overflow in issue card (#31203)

Before:

<img width="373" alt="Screenshot 2024-06-01 at 01 31 26"
src="https://github.com/go-gitea/gitea/assets/115237/82a210f2-c82e-4b7e-ac43-e70e46fa1186">

After:
<img width="376" alt="Screenshot 2024-06-01 at 01 31 32"
src="https://github.com/go-gitea/gitea/assets/115237/82d1b9f7-4fad-47bd-948a-04e1e7e006e6">

4 months agoFix agit checkout command line hint & fix ShowMergeInstructions checking (#31219)
Lunny Xiao [Sun, 2 Jun 2024 22:45:21 +0000 (06:45 +0800)]
Fix agit checkout command line hint & fix ShowMergeInstructions checking (#31219)

4 months agoFix the possible migration failure on 286 with postgres 16 (#31209)
Lunny Xiao [Sun, 2 Jun 2024 03:01:08 +0000 (11:01 +0800)]
Fix the possible migration failure on 286 with postgres 16 (#31209)

Try to fix #31205

4 months agoOnly update poster in issue/comment list if it has been loaded (#31216)
Max Wipfli [Sun, 2 Jun 2024 02:32:20 +0000 (04:32 +0200)]
Only update poster in issue/comment list if it has been loaded (#31216)

Previously, all posters were updated, even if they were not part of
posterMaps. In that case, a ghost user was erroneously inserted.

Fixes #31213.

4 months agoReturn an empty string when a repo has no avatar in the repo API (#31187)
Kemal Zebari [Sat, 1 Jun 2024 11:49:42 +0000 (04:49 -0700)]
Return an empty string when a repo has no avatar in the repo API (#31187)

Resolves #31167.

https://github.com/go-gitea/gitea/pull/30885 changed the behavior of
`repo.AvatarLink()` where it can now take the empty string and append it
to the app data URL. This does not point to a valid avatar image URL,
and, as the issue mentions, previous Gitea versions returned the empty
string.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
4 months agoSplit sanitizer functions and fine-tune some tests (#31192)
wxiaoguang [Fri, 31 May 2024 13:26:01 +0000 (21:26 +0800)]
Split sanitizer functions and fine-tune some tests (#31192)

4 months agoPerformance improvements for pull request list API (#30490)
Lunny Xiao [Fri, 31 May 2024 12:10:11 +0000 (20:10 +0800)]
Performance improvements for pull request list API (#30490)

Fix #30483

---------

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: Giteabot <teabot@gitea.io>
4 months agoFix URL In Gitea Actions Badge Docs (#31191)
TheBrokenRail [Fri, 31 May 2024 11:41:44 +0000 (07:41 -0400)]
Fix URL In Gitea Actions Badge Docs (#31191)

The example URL given in the documentation leads to a 404.

For instance,
`https://your-gitea-instance.com/{owner}/{repo}/actions/workflows/{workflow_file}?branch={branch}&event={event}`
translates to
`https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn/actions/workflows/build.yml`,
which is a 404.

I had to check the [linked GitHub
docs](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge)
to learn that you have to add `/badge.svg` to the URL.

Example:
https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn/actions/workflows/build.yml/badge.svg

4 months agoDrop `IDOrderDesc` for listing Actions task and always order by `id DESC` (#31150)
Jason Song [Fri, 31 May 2024 02:30:02 +0000 (10:30 +0800)]
Drop `IDOrderDesc` for listing Actions task and always order by `id DESC` (#31150)

Close #31066

Just follow what `FindRunOptions` and `FindScheduleOptions` do.

4 months agoFix branch order (#31174)
Lunny Xiao [Fri, 31 May 2024 01:58:41 +0000 (09:58 +0800)]
Fix branch order (#31174)

Fix #31172

The original order or the default order should not be ignored even if we
have an is_deleted order.

4 months agoAzure blob storage support (#30995)
Lunny Xiao [Thu, 30 May 2024 07:33:50 +0000 (15:33 +0800)]
Azure blob storage support (#30995)

This PR implemented object storages(LFS/Packages/Attachments and etc.)
for Azure Blob Storage. It depends on azure official golang SDK and can
support both the azure blob storage cloud service and azurite mock
server.

Replace #25458
Fix #22527

- [x] CI Tests
- [x] integration test, MSSQL integration tests will now based on
azureblob
  - [x] unit test
- [x] CLI Migrate Storage
- [x] Documentation for configuration added

------

TODO (other PRs):
- [ ] Improve performance of `blob download`.

---------

Co-authored-by: yp05327 <576951401@qq.com>
4 months agoUse repo as of renderctx's member rather than a repoPath on metas (#29222)
Lunny Xiao [Thu, 30 May 2024 07:04:01 +0000 (15:04 +0800)]
Use repo as of renderctx's member rather than a repoPath on metas (#29222)

Use a `gitrepo.Repository` in the markup's RenderContext but not store
the repository's path.

4 months agoIgnore FindRecentlyPushedNewBranches err (#31164)
wxiaoguang [Thu, 30 May 2024 02:24:22 +0000 (10:24 +0800)]
Ignore FindRecentlyPushedNewBranches err (#31164)

Fix #31163

4 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 30 May 2024 00:26:20 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

4 months agoFix markup preview (#31158)
wxiaoguang [Wed, 29 May 2024 16:28:55 +0000 (00:28 +0800)]
Fix markup preview (#31158)

Fix #31157

After:

![image](https://github.com/go-gitea/gitea/assets/2114189/4d918cce-cd0d-4601-9c81-4b32df1b0b38)

4 months agoSwap word order in Comment and Close (#31148)
techknowlogick [Wed, 29 May 2024 15:54:17 +0000 (11:54 -0400)]
Swap word order in Comment and Close (#31148)

Reduce accident closing of tickets only to re-open them right away. This
aligns the text on these buttons with what GitHub has.

Commit is authored by @LazyDodo, and was committed to the Blender fork
by @brechtvl

Background details:
https://projects.blender.org/infrastructure/gitea-custom/pulls/7

Co-authored-by: Ray Molenkamp <github@lazydodo.com>
4 months agoFix push multiple branches error with tests (#31151)
Lunny Xiao [Wed, 29 May 2024 06:43:02 +0000 (14:43 +0800)]
Fix push multiple branches error with tests (#31151)

4 months agoUse vertical layout for multiple code expander buttons (#31122)
silverwind [Wed, 29 May 2024 06:08:45 +0000 (08:08 +0200)]
Use vertical layout for multiple code expander buttons (#31122)

Fixes: https://github.com/go-gitea/gitea/issues/31068
- Now it only does a single call to `GetExpandDirection` per line
instead of multiples.
- Exposed `data-expand-direction` to frontend so it can correctly size
the buttons (it's a pain to do in tables).

<img width="142" alt="Screenshot 2024-05-27 at 20 44 56"
src="https://github.com/go-gitea/gitea/assets/115237/8b0b45a6-8e50-4081-8822-5e0775d8d941">
<img width="142" alt="Screenshot 2024-05-27 at 20 44 51"
src="https://github.com/go-gitea/gitea/assets/115237/b7ba2c57-8f55-4e9f-9606-c96d16b77892">
<img width="132" alt="Screenshot 2024-05-27 at 20 44 46"
src="https://github.com/go-gitea/gitea/assets/115237/0e838fb8-5e8c-4250-9843-a68b88d5418b">
<img width="80" alt="Screenshot 2024-05-27 at 20 44 33"
src="https://github.com/go-gitea/gitea/assets/115237/da6c7f83-c160-4389-8ab2-889d0568cbe8">
<img width="80" alt="Screenshot 2024-05-27 at 20 44 26"
src="https://github.com/go-gitea/gitea/assets/115237/cdb490b2-5040-484a-92e5-46fc5e37c199">
<img width="78" alt="Screenshot 2024-05-27 at 20 44 20"
src="https://github.com/go-gitea/gitea/assets/115237/d2978ab0-764e-41ff-922c-25f8fe749f28">

Would backport as trivial enhancement.

4 months agoRemove duplicate `ProxyPreserveHost` in Apache httpd doc (#31143)
Samuel FORESTIER [Wed, 29 May 2024 00:35:21 +0000 (00:35 +0000)]
Remove duplicate `ProxyPreserveHost` in Apache httpd doc (#31143)

---

(fix up for #31003)

4 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 29 May 2024 00:26:43 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

4 months agoAdd an immutable tarball link to archive download headers for Nix (#31139)
Jörg Thalheim [Tue, 28 May 2024 15:30:34 +0000 (17:30 +0200)]
Add an immutable tarball link to archive download headers for Nix (#31139)

This allows `nix flake metadata` and nix in general to lock a *branch*
tarball link in a manner that causes it to fetch the correct commit even
if the branch is updated with a newer version.

Co-authored-by: Jade Lovelace <software@lfcode.ca>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
4 months agoImprove mobile review ui (#31091)
silverwind [Tue, 28 May 2024 13:41:37 +0000 (15:41 +0200)]
Improve mobile review ui (#31091)

Fixes: https://github.com/go-gitea/gitea/issues/31071
Not perfect but much better than before.

Before: Overflows, sticky not working, filename unreadable:

<img width="506" alt="Screenshot 2024-05-27 at 02 02 40"
src="https://github.com/go-gitea/gitea/assets/115237/a06b1edf-dece-4402-98c2-68670fca265f">

After:
<img width="457" alt="Screenshot 2024-05-27 at 01 59 06"
src="https://github.com/go-gitea/gitea/assets/115237/2a282c96-e719-4554-b418-81963ae6269c">

4 months agoAdd topics for repository API (#31127)
Lunny Xiao [Tue, 28 May 2024 10:03:54 +0000 (18:03 +0800)]
Add topics for repository API (#31127)

Fix ##31100

4 months agoAdd missed return after `ctx.ServerError` (#31130)
Lunny Xiao [Tue, 28 May 2024 09:31:59 +0000 (17:31 +0800)]
Add missed return after `ctx.ServerError` (#31130)

4 months agoFix API repository object format missed (#31118)
Lunny Xiao [Tue, 28 May 2024 02:43:13 +0000 (10:43 +0800)]
Fix API repository object format missed (#31118)

Fix #31117

4 months agoFix DashboardRepoList margin (#31121)
silverwind [Tue, 28 May 2024 02:13:42 +0000 (04:13 +0200)]
Fix DashboardRepoList margin (#31121)

Fixes: https://github.com/go-gitea/gitea/issues/31115
<img width="476" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/ba508ba9-b02d-47c6-ad9f-495101c81330">

4 months agoUpdate JS dependencies (#31120)
silverwind [Tue, 28 May 2024 01:50:28 +0000 (03:50 +0200)]
Update JS dependencies (#31120)

- Add `eslint-plugin-no-use-extend-native` to exclude list because it
requires flat config
- Exclude `@github/text-expander-element` because new version has broken
positioning
- Tested mermaid, monaco, swagger, chartjs

4 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 28 May 2024 00:26:53 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

4 months agoPrevent simultaneous editing of comments and issues (#31053)
metiftikci [Mon, 27 May 2024 15:34:18 +0000 (18:34 +0300)]
Prevent simultaneous editing of comments and issues (#31053)

fixes #22907

Tested:
- [x] issue content edit
- [x] issue content change tasklist
- [x] pull request content edit
- [x] pull request change tasklist

![issue-content-edit](https://github.com/go-gitea/gitea/assets/29250154/a0828889-fb96-4bc4-8600-da92e3205812)

4 months agoUpdate demo site location from try.gitea.io -> demo.gitea.com (#31054)
Lunny Xiao [Mon, 27 May 2024 15:05:12 +0000 (23:05 +0800)]
Update demo site location from try.gitea.io -> demo.gitea.com (#31054)

4 months agoMove documents under actions (#31110)
Lunny Xiao [Mon, 27 May 2024 14:53:48 +0000 (22:53 +0800)]
Move documents under actions (#31110)

Move secrets and badge under actions

4 months agoUpdate pip related commands for docker (#31106)
wxiaoguang [Mon, 27 May 2024 13:53:33 +0000 (21:53 +0800)]
Update pip related commands for docker (#31106)

Thanks to graelo and silverwind for figuring out the problem.

Fix #31101

4 months agoFix missing memcache import (#31105)
wxiaoguang [Mon, 27 May 2024 13:43:32 +0000 (21:43 +0800)]
Fix missing memcache import (#31105)

Fix #31102

4 months agofeat: add support for a credentials chain for minio access (#31051)
Rowan Bohde [Mon, 27 May 2024 12:56:04 +0000 (07:56 -0500)]
feat: add support for a credentials chain for minio access (#31051)

We wanted to be able to use the IAM role provided by the EC2 instance
metadata in order to access S3 via the Minio configuration. To do this,
a new credentials chain is added that will check the following locations
for credentials when an access key is not provided. In priority order,
they are:

1. MINIO_ prefixed environment variables
2. AWS_ prefixed environment variables
3. a minio credentials file
4. an aws credentials file
5. EC2 instance metadata

4 months agoRename project board -> column to make the UI less confusing (#30170)
Lunny Xiao [Mon, 27 May 2024 08:59:54 +0000 (16:59 +0800)]
Rename project board -> column to make the UI less confusing (#30170)

This PR split the `Board` into two parts. One is the struct has been
renamed to `Column` and the second we have a `Template Type`.

But to make it easier to review, this PR will not change the database
schemas, they are just renames. The database schema changes could be in
future PRs.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: yp05327 <576951401@qq.com>
4 months agoSimplify review UI (#31062)
delvh [Mon, 27 May 2024 08:24:34 +0000 (10:24 +0200)]
Simplify review UI (#31062)

Instead of always displaying all available actions as buttons, merge
them into a single dropdown menu, same as GitHub. That decreases visual
overload and is more mobile-friendly, while not losing any
functionality.

## Screenshots
<details><summary>Before</summary>

![grafik](https://github.com/go-gitea/gitea/assets/51889757/b957fab0-4cc7-4cf5-a6c8-33f571be7b19)
</details>
<details><summary>After (unexpanded)</summary>

![grafik](https://github.com/go-gitea/gitea/assets/51889757/c8fd3428-4092-4295-bd55-c243409ba90d)
</details>

<details><summary>After (expanded)</summary>

![grafik](https://github.com/go-gitea/gitea/assets/51889757/c0eada91-54be-42ce-9db1-0db56d971438)
</details>

4 months agoPrevent tab shifting, remove extra margin on fluid pages (#31090)
silverwind [Mon, 27 May 2024 06:45:16 +0000 (08:45 +0200)]
Prevent tab shifting, remove extra margin on fluid pages (#31090)

1. Extend concept of https://github.com/go-gitea/gitea/pull/29831 to all
tabular menus, there were only three left that weren't already
`<overflow-menu>`.

<img width="634" alt="Screenshot 2024-05-27 at 00 42 16"
src="https://github.com/go-gitea/gitea/assets/115237/d9a7e219-d05e-40a1-9e93-777f9a8a90dd">
<img width="965" alt="Screenshot 2024-05-27 at 00 29 32"
src="https://github.com/go-gitea/gitea/assets/115237/e6ed71b1-11fb-4a74-9adb-af4524286cff">

2. Remove extra padding on `fluid padded` container like for example PR
diff view. The page margin is already correctly sized via
`.ui.container`, so this was just extraneous padding that looked ugly.

Before:
<img width="1351" alt="Screenshot 2024-05-27 at 00 45 11"
src="https://github.com/go-gitea/gitea/assets/115237/4b45fd11-b1b2-4fbb-a618-26eb22be9472">

After:
<img width="1344" alt="Screenshot 2024-05-27 at 00 45 22"
src="https://github.com/go-gitea/gitea/assets/115237/d09593eb-6c7f-45e7-85b6-f0050047004b">

3. Replace `gt-word-break` with `tw-break-anywhere` in issue-title,
fixing overflow.

Before:
<img width="1333" alt="Screenshot 2024-05-27 at 00 50 14"
src="https://github.com/go-gitea/gitea/assets/115237/64d15d04-b456-401e-a972-df636965f0eb">

After:
<img width="1316" alt="Screenshot 2024-05-27 at 00 50 26"
src="https://github.com/go-gitea/gitea/assets/115237/ed1ce830-1408-414b-8263-eeaf773f52c8">

4 months agoImprove the handling of `jobs.<job_id>.if` (#31070)
Zettat123 [Mon, 27 May 2024 06:15:34 +0000 (14:15 +0800)]
Improve the handling of `jobs.<job_id>.if` (#31070)

Fix #25897
Fix #30322

#29464 cannot handle some complex `if` conditions correctly because it
only checks `always()` literally. In fact, it's not easy to evaluate the
`if` condition on the Gitea side because evaluating it requires a series
of contexts. But act_runner is able to evaluate the `if` condition
before running the job (for more information, see
[`gitea/act`](https://gitea.com/gitea/act/src/commit/517d11c67126bd97c88e2faabda0832fff482258/pkg/runner/run_context.go#L739-L753))
. So we can use act_runner to check the `if` condition.

In this PR, how to handle a blocked job depends on its `needs` and `if`:
- If not all jobs in `needs` completed successfully and the job's `if`
is empty, set the job status to `StatusSkipped`
- In other cases, the job status will be set to `StatusWaiting`, and
then act_runner will check the `if` condition and run the job if the
condition is met

4 months agoFix possible ui 500 if workflow's job is nil (#31092)
Lunny Xiao [Mon, 27 May 2024 05:21:00 +0000 (13:21 +0800)]
Fix possible ui 500 if workflow's job is nil (#31092)

Fix #31087

4 months agoFix border radius on hovered secondary menu (#31089)
silverwind [Mon, 27 May 2024 04:48:41 +0000 (06:48 +0200)]
Fix border radius on hovered secondary menu (#31089)

Presumably a regression from
https://github.com/go-gitea/gitea/pull/30325, these menus were showing a
border radius on hover, which is fixed with this change.

<img width="154" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/eafdc1c5-3cf5-48d1-86c4-21c58f92cfaf">

4 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 27 May 2024 00:26:27 +0000 (00:26 +0000)]
[skip ci] Updated licenses and gitignores

4 months agoMake gitea webhooks openproject compatible (#28435) 27900/head
André Rosenhammer [Sun, 26 May 2024 04:08:13 +0000 (06:08 +0200)]
Make gitea webhooks openproject compatible (#28435)

This PR adds some fields to the gitea webhook payload that
[openproject](https://www.openproject.org/) expects to exists in order
to process the webhooks.
These fields do exists in Github's webhook payload so adding them makes
Gitea's native webhook more compatible towards Github's.

4 months agoChange `--border-radius-circle` to `--border-radius-full` (#30936)
silverwind [Sat, 25 May 2024 14:33:34 +0000 (16:33 +0200)]
Change `--border-radius-circle` to `--border-radius-full` (#30936)

Percentage-based `border-radius` [creates undesirable
ellipse](https://jsfiddle.net/silverwind/j9ko5wnt/4/) on non-square
content. Instead, use pixel value and use same wording `full` like
tailwind does, but increast to 99999px over their 9999px.

4 months agoFix `View File` button link if branch deleted on pull request files pages (#31063)
metiftikci [Sat, 25 May 2024 14:02:07 +0000 (17:02 +0300)]
Fix `View File` button link if branch deleted on pull request files pages (#31063)

as title

4 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 24 May 2024 00:25:44 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

4 months agoSupport setting the `default` attribute of the issue template dropdown field (#31045)
Zettat123 [Thu, 23 May 2024 13:01:02 +0000 (21:01 +0800)]
Support setting the `default` attribute of the issue template dropdown field (#31045)

Fix #31044

According to [GitHub issue template
documentation](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-for-dropdown),
the `default` attribute can be used to specify the preselected option
for a dropdown field.

4 months agoAlpine 3.20 has been released (#31047)
techknowlogick [Thu, 23 May 2024 12:18:25 +0000 (08:18 -0400)]
Alpine 3.20 has been released (#31047)