Commit Graph

18195 Commits

Author SHA1 Message Date
GiteaBot 7adf8d7727 [skip ci] Updated translations via Crowdin 2024-06-19 00:26:25 +00:00
wxiaoguang 43c7a2e7b1
Refactor names (#31405)
This PR only does "renaming":

* `Route` should be `Router` (and chi router is also called "router")
* `Params` should be `PathParam` (to distingush it from URL query param, and to match `FormString`)
* Use lower case for private functions to avoid exposing or abusing
2024-06-19 06:32:45 +08:00
silverwind 17baf1af10
Update JS dependencies, remove `eslint-plugin-jquery` (#31402)
- Result of `make update-js`
- Added 1 new eslint rule
- Autofixed 1 new eslint issue
- Remove `eslint-plugin-jquery` as `eslint-plugin-no-jquery` does all it
does and is actually the maintained fork of it.
- Tested all affected `dependencies`


Co-authored-by: wxiaoguang <>
2024-06-18 08:10:30 +00:00
Yarden Shoham 9c8092807a
Switch to upstream of `gorilla/feeds` (#31400)
They merged the PR we waited for.

- Reference:
- Follows:

Signed-off-by: Yarden Shoham <>
Co-authored-by: wxiaoguang <>
2024-06-18 16:05:28 +08:00
wxiaoguang 21783a5752
Fix rendered wiki page link (#31398)
Fix #31395
2024-06-18 03:09:20 +00:00
wxiaoguang 37a4b233a0
Refactor repo unit "disabled" check (#31389)
1. There are already global "unit consts", no need to use context data, which is fragile
2. Remove the "String()" method from "unit", it would only cause rendering problems in templates


Co-authored-by: silverwind <>
2024-06-18 00:51:13 +00:00
wxiaoguang d32648b204
Refactor route path normalization (#31381)
Refactor route path normalization and decouple it from the chi router.
Fix the TODO, fix the legacy strange path behavior.
2024-06-17 23:28:47 +00:00
wxiaoguang 5a7376c060
Refactor markup code (#31399)
1. use clearer names
2. remove deadcode
3. avoid name shadowing
4. eliminate some lint warnings
2024-06-17 22:56:45 +00:00
6543 363c123598
Add cache test for admins (#31265)
Add a test to probe the cache similar to the email test func.





Co-authored-by: delvh <>
Co-authored-by: silverwind <>
2024-06-17 21:22:39 +02:00
silverwind 4b6eb46e69
Fix double border in system status table (#31363)
Fix regression from where
the introduction of this `<div>` caused the `.ui.attached:not(.message)
+ .ui.attached.segment:not(.top)` CSS selector to no longer work and
cause a double border.


<img width="200" alt="Screenshot 2024-06-13 at 19 06 12"

<img width="232" alt="Screenshot 2024-06-13 at 19 05 57"


Co-authored-by: wxiaoguang <>
2024-06-17 15:21:59 +02:00
wxiaoguang 0f09c22663
Improve rubygems package registry (#31357)
To make it work with Bundler:

It only adds 2 new API endpoints and improves some tests, existing logic
is not changed.
2024-06-17 08:42:46 +00:00
wxiaoguang 25f3ec5b65
Fix natural sort (#31384)
Fix #31374
2024-06-17 06:45:12 +00:00
Brecht Van Lommel 597d1da96b
Fix missing images in editor preview due to wrong links (#31299)
Parse base path and tree path so that media links can be correctly
created with /media/.

Resolves #31294


Co-authored-by: wxiaoguang <>
2024-06-17 14:16:14 +08:00
wxiaoguang f5dfd7d73c
Add a simple test for AdoptRepository (#31391)
Follow #31333
2024-06-17 01:18:35 +00:00
GiteaBot 129206da45 [skip ci] Updated licenses and gitignores 2024-06-17 00:27:39 +00:00
wxiaoguang f446e3b4ab
Fix JS error when creating new issue (#31383)
Fix #31336
2024-06-16 02:07:21 +00:00
GiteaBot c70d4f03c9 [skip ci] Updated translations via Crowdin 2024-06-16 00:28:50 +00:00
6543 78e8296e11
Rename repo_model.SearchOrderByMap to repo_model.OrderByMap (#31359)
2024-06-15 06:45:02 +00:00
6543 e37ecd1732
rm const do inline (#31360)
2024-06-15 04:48:52 +00:00
Zettat123 42718d32af
Allow downloading attachments of draft releases (#31369)
Fix #31362
2024-06-15 12:20:14 +08:00
wxiaoguang 84cbb6c4d2
Fix duplicate sub-path for avatars (#31365)
Fix #31361, and add tests

And this PR introduces an undocumented & debug-purpose-only config
option: `USE_SUB_URL_PATH`. It does nothing for end users, it only helps
the development of sub-path related problems.

And also fix #31366

Co-authored-by: @ExplodingDragon
2024-06-15 11:43:57 +08:00
GiteaBot 23147494a7 [skip ci] Updated translations via Crowdin 2024-06-15 00:26:00 +00:00
mzroot d4e4226c3c
Add tag protection via rest api #17862 (#31295)
Add tag protection manage via rest API.


Co-authored-by: Alexander Kogay <>
Co-authored-by: Giteabot <>
2024-06-14 18:56:10 +02:00
KN4CK3R 4e7b067a7f
Extract and display readme and comments for Composer packages (#30927)
Related #30075

CC @thojo0

Example with rendered readme:

2024-06-14 04:45:52 +00:00
Lunny Xiao fa82a8af12
Have new announcement about docs contributions (#31364)
According to the maintainers' discussion and voting. We decide to move
docs to . Add some hints on this repository
to not make contributors confusing.
2024-06-14 11:17:05 +08:00
Lunny Xiao e4abaff7ff
Fix bug filtering issues which have no project (#31337)
Fix #31327
This is a quick patch to fix the bug.
Some parameters are using 0, some are using -1. I think it needs a
refactor to keep consistent. But that will be another PR.
2024-06-14 02:31:07 +00:00
Oleksandr Redko 1761459ebc
Refactor to use UnsafeStringToBytes (#31358)
The PR replaces all `goldmark/util.BytesToReadOnlyString` with
`util.UnsafeBytesToString`, `goldmark/util.StringToReadOnlyBytes` with
`util.UnsafeStringToBytes`. This removes one `TODO`.

Co-authored-by: wxiaoguang <>
2024-06-14 01:26:33 +00:00
GiteaBot 5b56d13e0d [skip ci] Updated translations via Crowdin 2024-06-14 00:27:38 +00:00
yp05327 e61e9a36b7
Fix PullRequestList.GetIssueIDs's logic (#31352)
fix a bug from #30490

`prs.GetIssueIDs()` will also be used in other places, e.g.
so we should not add `if pr.Issue == nil` in it, or if `pr.Issue` is
already loaded, you will not get the issueID in the results list and
this is not an expected result.

So this will caused a bug:
before calling `InvalidateCodeComments`, all `pr.Issues` in `prs` are
loaded, so `issueIDs` in this function will always be `[]`.

2024-06-13 09:42:07 +00:00
6543 bb04311b0b
[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
2024-06-13 09:13:11 +00:00
Kerwin Bryant fede3cbada
Fixed incorrect localization `explorer.go` (#31348)
2024-06-13 01:43:41 +00:00
wxiaoguang 47ca61d8ba
Improve detecting empty files (#31332)
Co-authored-by: silverwind <>
2024-06-13 01:06:46 +00:00
Lunny Xiao 7115dce773
Fix hash render end with colon (#31319)
Fix a hash render problem like `<hash>: xxxxx` which is usually used in
release notes.
2024-06-12 22:35:46 +00:00
silverwind 90bcdf9829
Fix line number widths (#31341)
Fixes regression

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"
<img width="119" alt="Screenshot 2024-06-12 at 15 07 43"
<img width="151" alt="Screenshot 2024-06-12 at 15 07 07"
<img width="141" alt="Screenshot 2024-06-12 at 15 07 14"
2024-06-12 15:23:42 +00:00
silverwind 21ba5ca03b
Fix navbar `+` menu flashing on page load (#31281)
Same method as used in All
left-opening dropdowns need to use it method.


Co-authored-by: wxiaoguang <>
Co-authored-by: Giteabot <>
2024-06-12 14:58:03 +00:00
Rowan Bohde 45dbeb5600
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
Specifying the size in both the upload and merge case reduces memory
usage of the MinIO client.

Co-authored-by: Kyle D <>
2024-06-12 11:34:35 +00:00
Yarden Shoham 130ea31d6d
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
- Fixes

Signed-off-by: Yarden Shoham <>
2024-06-12 10:27:00 +00:00
Lunny Xiao 1968c2222d
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.
2024-06-12 18:22:01 +08:00
Kerwin Bryant a975ce8d9d
Optimize profile layout to enhance visual experience (#31278)
Co-authored-by: silverwind <>
2024-06-12 04:06:12 +00:00
Zoupers Zou e25d6960b5
Fix #31185 try fix lfs download from bitbucket failed (#31201)
Fix #31185
2024-06-11 22:22:28 +00:00
silverwind fc2d75f86d
Enable `unparam` linter (#31277)
Enable [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 <>
Co-authored-by: delvh <>
2024-06-11 18:47:45 +00:00
wxiaoguang 4bf848a06b
Make template `Iif` exactly match `if` (#31322) 2024-06-11 14:52:12 +00:00
6543 61c97fdef1
update nix flake and add gofumpt (#31320)
nix flake maintenance
2024-06-11 08:47:13 -05:00
Kerwin Bryant e6ab6e637f
code optimization (#31315)
Simplifying complex if-else to existing Iif operations
2024-06-11 21:07:10 +08:00
silverwind 397930d8c1
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.
2024-06-11 04:54:39 +00:00
wxiaoguang 5342a61124
Delete legacy cookie before setting new cookie (#31306)
Try to fix #31202
2024-06-11 11:31:23 +08:00
GiteaBot 1844dc6c1d [skip ci] Updated translations via Crowdin 2024-06-11 00:26:13 +00:00
silverwind 507fbf4c3c
Use `querySelector` over alternative DOM methods (#31280)
As per,
prefer `querySelector` by enabling
and autofixing all except 10 issues.

According to
querySelector may be faster as well, so it's a win-win.


Co-authored-by: wxiaoguang <>
Co-authored-by: Giteabot <>
2024-06-10 22:49:33 +02:00
silverwind a2304cb163
Remove jQuery `.text()` (#30506)
Remove and forbid [.text()]( Tested some,
but not all functionality, but I think these are pretty safe


Co-authored-by: wxiaoguang <>
2024-06-10 18:12:31 +08:00
GiteaBot 4f7d6feab7 [skip ci] Updated translations via Crowdin 2024-06-10 00:27:20 +00:00