]> source.dussan.org Git - gitea.git/log
gitea.git
5 months agoRework and fix stopwatch (#30732) (#30787)
Giteabot [Tue, 30 Apr 2024 21:46:45 +0000 (05:46 +0800)]
Rework and fix stopwatch (#30732) (#30787)

Backport #30732 by @silverwind

Fixes https://github.com/go-gitea/gitea/issues/30721 and overhauls the
stopwatch. Time is now shown inside the "dot" icon and on both mobile
and desktop. All rendering is now done by `<relative-time>`, the
`pretty-ms` dependency is dropped.

Desktop:
<img width="557" alt="Screenshot 2024-04-29 at 22 33 27"
src="https://github.com/go-gitea/gitea/assets/115237/3a46cdbf-6af2-4bf9-b07f-021348badaac">

Mobile:
<img width="640" alt="Screenshot 2024-04-29 at 22 34 19"
src="https://github.com/go-gitea/gitea/assets/115237/8a2beea7-bd5d-473f-8fff-66f63fd50877">

Note for tippy:
Previously, tippy instances defaulted to "menu" theme, but that theme is
really only meant for `.ui.menu`, so it was not optimal for the
stopwatch popover.

This introduces a unopinionated `default` theme that has no padding and
should be suitable for all content. I reviewed all existing uses and
explicitely set the desired `theme` on all of them.

Co-authored-by: silverwind <me@silverwind.io>
5 months agoImprove logout from worker (#30775) (#30789)
Giteabot [Tue, 30 Apr 2024 21:19:13 +0000 (05:19 +0800)]
Improve logout from worker (#30775) (#30789)

Backport #30775 by wxiaoguang

A quick fix for #30756

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 months agoGet repo assignees and reviewers should ignore deactivated users (#30770) (#30782)
6543 [Tue, 30 Apr 2024 15:36:28 +0000 (17:36 +0200)]
Get repo assignees and reviewers should ignore deactivated users (#30770) (#30782)

Backport  #30770

If an user is deactivated, it should not be in the list of users who are
suggested to be assigned or review-requested.

old assignees or reviewers are not affected.

---
*Sponsored by Kithara Software GmbH*

5 months agoFix dashboard commit status null access (#30771) (#30786)
Giteabot [Tue, 30 Apr 2024 12:53:20 +0000 (20:53 +0800)]
Fix dashboard commit status null access (#30771) (#30786)

Backport #30771 by wxiaoguang

Fix #30768

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 months agoFix cross-compilation errors when CGO_CFLAGS/CGO_LDFLAGS is set (#30749) (#30774)
Giteabot [Tue, 30 Apr 2024 10:51:38 +0000 (18:51 +0800)]
Fix cross-compilation errors when CGO_CFLAGS/CGO_LDFLAGS is set (#30749) (#30774)

Backport #30749 by @sryze

When you cross-compile Gitea and you specify one of the envrionment
variables related to C flags, cgo will fail to build the generator
programs (e.g. generate-bindata) because GOOS and GOARCH are unset, but
those additional flags variables are not unset together with those.

To solve this issue, the simplest way that I've found is to disable cgo
in the `go generate` command as it's not really used there.

For example, I've had this problem with cross-compiling Gitea on FreeBSD
x86_64 to ARMv7 where it's necessary to pass `--target` to `clang` via
`CGO_CFLAGS`:
```
GOOS=freebsd \
GOARCH=arm \
GGOARM=7 \
CGO_ENABLED=1 \
SYSROOT=/usr/local/freebsd-sysroot/armv7 \
CC=clang \
CGO_CFLAGS="--target=armv7-unknown-freebsd13.2-gnueabihf" \
TAGS="bindata sqlite sqlite_unlock_notify" \
make SHELL='sh -x' build
```

```
Running go generate...
# runtime/cgo
In file included from gcc_freebsd_amd64.c:9:
In file included from /usr/include/signal.h:42:
/usr/include/sys/_ucontext.h:44:2: error: unknown type name 'mcontext_t'
modules/migration/schemas_bindata.go:8: running "go": exit status 1
# runtime/cgo
In file included from gcc_freebsd_amd64.c:9:
In file included from /usr/include/signal.h:42:
/usr/include/sys/_ucontext.h:44:2: error: unknown type name 'mcontext_t'
modules/options/options_bindata.go:8: running "go": exit status 1
# runtime/cgo
In file included from gcc_freebsd_amd64.c:9:
In file included from /usr/include/signal.h:42:
/usr/include/sys/_ucontext.h:44:2: error: unknown type name 'mcontext_t'
modules/public/public_bindata.go:8: running "go": exit status 1
# runtime/cgo
In file included from gcc_freebsd_amd64.c:9:
In file included from /usr/include/signal.h:42:
/usr/include/sys/_ucontext.h:44:2: error: unknown type name 'mcontext_t'
modules/templates/templates_bindata.go:8: running "go": exit status 1
gmake[1]: *** [Makefile:781: generate-go] Error 1
*** Error code 2

Stop.
```

But with this fix Gitea compiles successfully.

Co-authored-by: Sergey Zolotarev <4525736+sryze@users.noreply.github.com>
5 months agoFix issue label rendering in the issue popup (#30763) (#30773)
Giteabot [Tue, 30 Apr 2024 09:40:47 +0000 (17:40 +0800)]
Fix issue label rendering in the issue popup (#30763) (#30773)

Backport #30763 by wxiaoguang

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 months agoRight align the "Settings" menu item in overflow-menu (#30764) (#30777)
Giteabot [Tue, 30 Apr 2024 08:40:09 +0000 (16:40 +0800)]
Right align the "Settings" menu item in overflow-menu (#30764) (#30777)

Backport #30764 by wxiaoguang

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 months agoRename CodeIndexerEnabled to IsRepoIndexerEnabled (#30762) (#30767)
Giteabot [Mon, 29 Apr 2024 21:57:48 +0000 (05:57 +0800)]
Rename CodeIndexerEnabled to IsRepoIndexerEnabled (#30762) (#30767)

Backport #30762 by @wxiaoguang

Fix  #30761

Most places use `IsRepoIndexerEnabled` but not `CodeIndexerEnabled`, so
it should always use `IsRepoIndexerEnabled` for consistency.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 months agoFix all rounded borders, change affected tab menus to pills (#30707) (#30769)
Giteabot [Mon, 29 Apr 2024 21:19:44 +0000 (05:19 +0800)]
Fix all rounded borders, change affected tab menus to pills (#30707) (#30769)

Backport #30707 by @silverwind

Fixes https://github.com/go-gitea/gitea/issues/30673, all 23 issues.
Notes:

- Tab bar menus had to change to pills because of unsolvable issue with
the border-radius as tab bar renders a overlapping border onto the box
below. And I think pills look better.
- Added padding to code editor empty preview message
- Hide monaco's built-in blue focus border, we don't need it and it
never showed before either.
- Label add menu is simplified, removing the nested segment.

<img width="1322" alt="Screenshot 2024-04-25 at 22 26 19"
src="https://github.com/go-gitea/gitea/assets/115237/7e394e0c-b7ad-417d-8e9f-12f1dea93ed1">
<img width="1326" alt="Screenshot 2024-04-25 at 22 28 00"
src="https://github.com/go-gitea/gitea/assets/115237/66c8499f-aa9f-4d95-8cca-ef13dfa82c65">
<img width="997" alt="Screenshot 2024-04-25 at 22 36 53"
src="https://github.com/go-gitea/gitea/assets/115237/07896102-c71d-4246-8173-c2bc2e1d3cae">
<img width="832" alt="Screenshot 2024-04-25 at 22 56 09"
src="https://github.com/go-gitea/gitea/assets/115237/d83afc96-08ca-4adc-baf4-3d02804be57c">
<img width="361" alt="Screenshot 2024-04-25 at 22 57 12"
src="https://github.com/go-gitea/gitea/assets/115237/c7371a68-00b5-47d8-84d0-ddc5268b2b2c">

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 months agoFix nil dereference on error (#30740) (#30746)
wxiaoguang [Mon, 29 Apr 2024 00:23:35 +0000 (08:23 +0800)]
Fix nil dereference on error (#30740) (#30746)

Backport #30740 manually

Co-authored-by: Chongyi Zheng <git@zcy.dev>
5 months agoGitea with first upper case + typos (#30739) (#30747)
Giteabot [Sun, 28 Apr 2024 23:51:42 +0000 (07:51 +0800)]
Gitea with first upper case + typos (#30739) (#30747)

Backport #30739 by @mainboarder

* Corrected gitea to Gitea
* fixed some typos

Co-authored-by: mainboarder <git@mainboarder.de>
5 months agoFix documentation build problems because of MDX syntax conflicts (#30744) (#30745)
Giteabot [Sun, 28 Apr 2024 13:02:38 +0000 (21:02 +0800)]
Fix documentation build problems because of MDX syntax conflicts (#30744) (#30745)

Backport #30744 by @lunny

Documentation building has encountered a problem like below. This is
because MDX syntax doesn't allow `{customPath}`, we have to use
\`{customPath}\`

```
Error: Can't render static file for pathname "/next/administration/config-cheat-sheet"
            at generateStaticFile (/workspace/gitea/gitea-docusaurus/node_modules/@docusaurus/core/lib/ssg.js:119:15)
            at runNextTicks (node:internal/process/task_queues:60:5)
            at process.processImmediate (node:internal/timers:449:9)
            at async /workspace/gitea/gitea-docusaurus/node_modules/p-map/index.js:57:22 {
          [cause]: ReferenceError: CustomPath is not defined
              at _createMdxContent (server.bundle.js:4406:106)
              at MDXContent (server.bundle.js:10745:8)
              at Uc (server.bundle.js:264171:44)
              at Xc (server.bundle.js:264173:253)
              at Z (server.bundle.js:264179:89)
              at Yc (server.bundle.js:264182:98)
              at $c (server.bundle.js:264181:140)
              at Z (server.bundle.js:264179:345)
              at Xc (server.bundle.js:264177:231)
              at Z (server.bundle.js:264179:89)
```

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
5 months agoMake Ctrl+Enter work for issue/comment edit (#30720) v1.22.0-rc1
wxiaoguang [Sat, 27 Apr 2024 14:32:00 +0000 (22:32 +0800)]
Make Ctrl+Enter work for issue/comment edit (#30720)

Fix #30710

5 months agoRename migration package name for 1.22-rc1 (#30730)
wxiaoguang [Sat, 27 Apr 2024 14:02:07 +0000 (22:02 +0800)]
Rename migration package name for 1.22-rc1 (#30730)

Ref: Propose to restart 1.22 release #30501

5 months agoIssue card improvements (#30687)
silverwind [Sat, 27 Apr 2024 13:35:26 +0000 (15:35 +0200)]
Issue card improvements (#30687)

Fixes https://github.com/go-gitea/gitea/issues/30682 and does a few
improvements:

- Use gap instead of margin/padding
- Don't render empty image div
- Remove `right floated` class that did nothing

<img width="406" alt="Screenshot 2024-04-24 at 20 21 20"
src="https://github.com/go-gitea/gitea/assets/115237/2fa88707-c2c4-40df-aee7-a684c3097ed0">

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
5 months agoDon't show loading indicators when refreshing the system status (#30712)
Yarden Shoham [Sat, 27 Apr 2024 13:05:06 +0000 (16:05 +0300)]
Don't show loading indicators when refreshing the system status (#30712)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
5 months agoAdd some tests to clarify the "must-change-password" behavior (#30693)
wxiaoguang [Sat, 27 Apr 2024 12:23:37 +0000 (20:23 +0800)]
Add some tests to clarify the "must-change-password" behavior (#30693)

Follow  #30472:

When a user is created by command line `./gitea admin user create`:

Old behavior before #30472: the first user (admin or non-admin) doesn't
need to change password.

Revert to the old behavior before #30472

5 months agoPrevent allow/reject reviews on merged/closed PRs (#30686)
Kemal Zebari [Sat, 27 Apr 2024 11:55:03 +0000 (04:55 -0700)]
Prevent allow/reject reviews on merged/closed PRs (#30686)

Resolves #30675.

5 months agoUpdate JS dependencies (#30713)
silverwind [Sat, 27 Apr 2024 11:28:28 +0000 (13:28 +0200)]
Update JS dependencies (#30713)

- Update all JS dependencies
- Remove
[now-unnecessary](https://github.com/microsoft/monaco-editor/issues/4325)
monaco workaround
- Update stylelint config for new rule
- Tested Monaco, Swagger UI, Mermaid

5 months agoImprove diff stats bar (#30669)
silverwind [Sat, 27 Apr 2024 11:22:55 +0000 (13:22 +0200)]
Improve diff stats bar (#30669)

Minor tweaks:

- Remove unnecessary `item` class which was causing unwanted padding to
be added.
- Add some padding and prevent wrapping so it looks better on mobile.
- Increase width by 4px.

<img width="116" alt="Screenshot 2024-04-24 at 00 15 07"
src="https://github.com/go-gitea/gitea/assets/115237/1f1cf54c-8053-4297-b309-71d9c2ceb9ee">
<img width="441" alt="Screenshot 2024-04-24 at 00 14 57"
src="https://github.com/go-gitea/gitea/assets/115237/2f3a33dc-edad-4b97-b64c-6812aae513cb">

5 months agoRemove unused parameter for some functions in `services/mirror` (#30724)
Chongyi Zheng [Sat, 27 Apr 2024 10:44:49 +0000 (06:44 -0400)]
Remove unused parameter for some functions in `services/mirror` (#30724)

Suggested by gopls `unusedparams`

5 months agoUpdate misspell to 0.5.1 and add `misspellings.csv` (#30573)
silverwind [Sat, 27 Apr 2024 08:03:49 +0000 (10:03 +0200)]
Update misspell to 0.5.1 and add `misspellings.csv` (#30573)

Misspell 0.5.0 supports passing a csv file to extend the list of
misspellings, so I added some common ones from the codebase. There is at
least one typo in a API response so we need to decided whether to revert
that and then likely remove the dict entry.

5 months agoSuppress browserslist warning in webpack target (#30571)
silverwind [Sat, 27 Apr 2024 07:21:07 +0000 (09:21 +0200)]
Suppress browserslist warning in webpack target (#30571)

1. Set
[`BROWSERSLIST_IGNORE_OLD_DATA`](https://github.com/browserslist/browserslist/blob/c6ddf7b3870a4585822d06ec77e8dd2401b8e1ed/node.js#L400)
to avoid warning on outdated browserslist data which the end user can
likely not do anything about and which is currently visible in the v1.21
branch.
2. Suppress all command echoing and add a "Running webpack..." message
in place.

Warning in question was this:

```
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
```

5 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 27 Apr 2024 00:24:31 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

5 months agoDiff color enhancements, add line number background (#30670)
silverwind [Fri, 26 Apr 2024 19:37:21 +0000 (21:37 +0200)]
Diff color enhancements, add line number background (#30670)

1. Bring back the background on line numbers. This feature was lost a
long time ago.

<img width="457" alt="Screenshot 2024-04-24 at 01 36 09"
src="https://github.com/go-gitea/gitea/assets/115237/76a7f5a9-c22a-4c72-9f0a-ebf16a66513e">
<img width="473" alt="Screenshot 2024-04-24 at 01 22 47"
src="https://github.com/go-gitea/gitea/assets/115237/eef06cf2-f1b9-40e3-947d-dd5852ec12a3">
<img width="457" alt="Screenshot 2024-04-24 at 02 13 18"
src="https://github.com/go-gitea/gitea/assets/115237/59e317d4-76a7-468c-8a19-10d88c675cc3">
<img width="459" alt="Screenshot 2024-04-24 at 01 23 21"
src="https://github.com/go-gitea/gitea/assets/115237/f1a46f8d-8846-4d78-a9d7-8b7dc18ac6e4">

2. Expanded lines background is now full-line, including line numbers:

<img width="1303" alt="Screenshot 2024-04-24 at 01 37 12"
src="https://github.com/go-gitea/gitea/assets/115237/271eefe2-0869-424e-93fb-ccd8adc87806">

3. Sort affected colors alphabetically in the CSS

Fixes #14603

5 months agofeat(api): enhance Actions Secrets Management API for repository (#30656)
Bo-Yi Wu [Fri, 26 Apr 2024 13:11:49 +0000 (21:11 +0800)]
feat(api): enhance Actions Secrets Management API for repository (#30656)

- Add endpoint to list repository action secrets in API routes
- Implement `ListActionsSecrets` function to retrieve action secrets
from the database
- Update Swagger documentation to include the new
`/repos/{owner}/{repo}/actions/secrets` endpoint
- Add `actions` package import and define new routes for actions,
secrets, variables, and runners in `api.go`.
- Refactor action-related API functions into `Action` struct methods in
`org/action.go` and `repo/action.go`.
- Remove `actionAPI` struct and related functions, replacing them with
`NewAction()` calls.
- Rename `variables.go` to `action.go` in `org` directory.
- Delete `runners.go` and `secrets.go` in both `org` and `repo`
directories, consolidating their content into `action.go`.
- Update copyright year and add new imports in `org/action.go`.
- Implement `API` interface in `services/actions/interface.go` for
action-related methods.
- Remove individual action-related functions and replace them with
methods on the `Action` struct in `repo/action.go`.

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: appleboy <appleboy.tw@gmail.com>
5 months agoFix code search input for different views (#30678)
wxiaoguang [Fri, 26 Apr 2024 11:21:04 +0000 (19:21 +0800)]
Fix code search input for different views (#30678)

Now only show the "code search" on the repo home page, because it only
does global search.
So do not show it when viewing file or directory to avoid misleading
users (it doesn't search in a directory)

5 months agoFix incorrect object id hash function (#30708)
wxiaoguang [Fri, 26 Apr 2024 09:49:48 +0000 (17:49 +0800)]
Fix incorrect object id hash function (#30708)

Great thanks to @oliverpool for figuring out the problem and proposing a
fix.

Regression of #28138

Incorrect hash causes the user's LFS files get all deleted when running
`doctor fix all`

(by the way, remove unused/non-standard comments)

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoAdd route handler info for debugging purpose (#30705)
wxiaoguang [Fri, 26 Apr 2024 09:09:49 +0000 (17:09 +0800)]
Add route handler info for debugging purpose (#30705)

Follow #30519

5 months agoBump htmx version to 1.9.12 (#30711)
Yarden Shoham [Fri, 26 Apr 2024 07:27:34 +0000 (10:27 +0300)]
Bump htmx version to 1.9.12 (#30711)

There are no breaking changes. I tested and everything works as before.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
5 months agoDeduplicate lfs common code (#30704)
wxiaoguang [Fri, 26 Apr 2024 02:53:30 +0000 (10:53 +0800)]
Deduplicate lfs common code (#30704)

5 months agoImprove job commit description (#30579)
yp05327 [Fri, 26 Apr 2024 02:22:45 +0000 (11:22 +0900)]
Improve job commit description (#30579)

Fix https://github.com/go-gitea/gitea/issues/30567

When job is a schedule:

![image](https://github.com/go-gitea/gitea/assets/18380374/b07e9d43-e8b7-4ee2-87b3-a7050c3a8ca5)
When it is a normal one:

![image](https://github.com/go-gitea/gitea/assets/18380374/0d58dab9-74bb-421b-8952-0578cdf21a52)

also add a 'space' behind  `:`

![image](https://github.com/go-gitea/gitea/assets/18380374/4cebece0-bfe6-4ad9-b806-e5c49bb9be43)

![image](https://github.com/go-gitea/gitea/assets/18380374/02da7681-474b-4c0f-9dad-b6558f6cb484)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 months agoImprove test for TestPullCompare (#30699)
Lunny Xiao [Fri, 26 Apr 2024 01:52:28 +0000 (09:52 +0800)]
Improve test for TestPullCompare (#30699)

5 months agoAllow to save empty comment (#30706)
wxiaoguang [Fri, 26 Apr 2024 01:17:43 +0000 (09:17 +0800)]
Allow to save empty comment (#30706)

Fix #29986

5 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 26 Apr 2024 00:26:00 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

5 months agoRefactor imagediff and fix regression bug (#30694)
wxiaoguang [Thu, 25 Apr 2024 13:01:38 +0000 (21:01 +0800)]
Refactor imagediff and fix regression bug (#30694)

Fix #30683

5 months agoImprove oauth2 client "preferred username field" logic and the error handling (#30622)
wxiaoguang [Thu, 25 Apr 2024 11:22:32 +0000 (19:22 +0800)]
Improve oauth2 client "preferred username field" logic and the error handling (#30622)

Follow #30454
And fix #24957

When using "preferred_username", if no such field,
`extractUserNameFromOAuth2` (old `getUserName`) shouldn't return an
error. All other USERNAME options do not return such error.

And fine tune some logic and error messages, make code more stable and
more friendly to end users.

5 months agoFix active item in tab menu (#30690)
silverwind [Thu, 25 Apr 2024 10:53:39 +0000 (12:53 +0200)]
Fix active item in tab menu (#30690)

Before, item would also resize on hover because of font weight:
<img width="381" alt="Screenshot 2024-04-25 at 01 28 53"
src="https://github.com/go-gitea/gitea/assets/115237/4f3291fc-90be-4d66-ae8b-3c2f763cb956">

After:
<img width="381" alt="Screenshot 2024-04-25 at 01 28 40"
src="https://github.com/go-gitea/gitea/assets/115237/06145bf2-1ddd-4171-9217-d92c100ea405">

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoIf a repository return no commitstatus, then still cache it but not query it from...
Lunny Xiao [Thu, 25 Apr 2024 09:14:23 +0000 (17:14 +0800)]
If a repository return no commitstatus, then still cache it but not query it from database (#30700)

The previous repository default branch commit status cache will only
store if the commit status has value. So the repository which have no
any commit status will always be fetched from database.

This PR will store the empty state of commit status of a repository into
cache because the cache will be updated once there is a commit status
stored.

5 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 25 Apr 2024 00:26:13 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

5 months agoFix view of readme file in the home code page. (#30564)
Jiaxin Zhu [Thu, 25 Apr 2024 00:07:38 +0000 (08:07 +0800)]
Fix view of readme file in the home code page. (#30564)

Gitea attempts to display image file, pdf file, etc. named readme in the
home code page (but it cannot).
I think only the markdown and plain-text file should be displayed, which
is also the behavior of GitHub.

Co-authored-by: jxshin <zhujiaxinabc@gmail.com>
5 months agoAdd test for #30674 (#30679)
Lunny Xiao [Wed, 24 Apr 2024 14:11:49 +0000 (22:11 +0800)]
Add test for #30674 (#30679)

5 months agoFix border-radius of header+segment boxes (#30667)
silverwind [Wed, 24 Apr 2024 13:11:52 +0000 (15:11 +0200)]
Fix border-radius of header+segment boxes (#30667)

This is a very old bug with the bottom border-radiuses not being there
and the `:has` selector now makes it possible to cleanly solve it. It
affects all header+segment boxes, which there are many throughout the
UI:

<img width="1017" alt="Screenshot 2024-04-23 at 20 47 21"
src="https://github.com/go-gitea/gitea/assets/115237/870fe352-cc38-4bd6-bfe6-9fe8c3066f92">

5 months agoFix a panic bug when head repository deleting (#30674)
Lunny Xiao [Wed, 24 Apr 2024 05:26:50 +0000 (13:26 +0800)]
Fix a panic bug when head repository deleting (#30674)

When visiting a pull request files which head repository has been
deleted, it will panic because headrepo is nil.

5 months agoFix some bug on migrations (#30647)
Lunny Xiao [Wed, 24 Apr 2024 01:58:24 +0000 (09:58 +0800)]
Fix some bug on migrations (#30647)

Fix https://github.com/go-gitea/gitea/pull/23894#discussion_r1573718690

5 months agoFix checkbox field markup (#30666)
silverwind [Tue, 23 Apr 2024 21:53:57 +0000 (23:53 +0200)]
Fix checkbox field markup (#30666)

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

Previous use was not a supported way by fomantic and the misuse only
became visible after the checkbox migration.

5 months agoAvoid doubled border for the PR info segment (#30663)
wxiaoguang [Tue, 23 Apr 2024 19:24:10 +0000 (03:24 +0800)]
Avoid doubled border for the PR info segment (#30663)

5 months agoInterpolate runs-on with variables when scheduling tasks (#30640)
sillyguodong [Tue, 23 Apr 2024 18:55:25 +0000 (02:55 +0800)]
Interpolate runs-on with variables when scheduling tasks (#30640)

Follow #29468
1. Interpolate runs-on with variables when scheduling tasks.
2. The `GetVariablesOfRun` function will check if the `Repo` of the run
is nil.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoInitial support for colorblindness-friendly themes (#30625)
wxiaoguang [Tue, 23 Apr 2024 16:18:41 +0000 (00:18 +0800)]
Initial support for colorblindness-friendly themes (#30625)

Initial support for #25680

This PR only adds some simple styles from GitHub, it is big enough and
it focuses on adding the necessary framework-level supports. More styles
could be fine-tuned later.

5 months agoFix flash message for flex-container (#30657)
wxiaoguang [Tue, 23 Apr 2024 08:31:51 +0000 (16:31 +0800)]
Fix flash message for flex-container (#30657)

5 months agoPerform Newest sort type correctly when sorting issues (#30644)
Kemal Zebari [Tue, 23 Apr 2024 07:10:01 +0000 (00:10 -0700)]
Perform Newest sort type correctly when sorting issues (#30644)

Should resolve #30642.

Before this commit, we were treating an empty `?sort=` query parameter
as the correct sorting type (which is to sort issues in descending order
by their created UNIX time). But when we perform `sort=latest`, we did
not include this as a type so we would sort by the most recently updated
when reaching the `default` switch statement block.

This commit fixes this by considering the empty string, "latest", and
just any other string that is not mentioned in the switch statement as
sorting by newest.

5 months agoFix project name wrapping, remove horizontal margin on header (#30631)
silverwind [Tue, 23 Apr 2024 04:17:51 +0000 (06:17 +0200)]
Fix project name wrapping, remove horizontal margin on header (#30631)

Enable wrapping of unbroken lines:

<img width="1308" alt="Screenshot 2024-04-22 at 00 31 33"
src="https://github.com/go-gitea/gitea/assets/115237/1a28ade1-d708-4260-96a3-cf508b6dcb79">

Remove extra margin added by nested `.ui.container` on certain
viewports:

Before:
<img width="1305" alt="Screenshot 2024-04-22 at 00 40 23"
src="https://github.com/go-gitea/gitea/assets/115237/d3d8c0d1-380c-4867-b95c-4d53d70d4a93">

After:
<img width="1310" alt="Screenshot 2024-04-22 at 00 40 33"
src="https://github.com/go-gitea/gitea/assets/115237/2ba7b9f2-db2f-4bcc-8cce-5c415625ddea">

5 months agoAdd a db consistency check to remove runners that do not belong to a repository ...
Zettat123 [Tue, 23 Apr 2024 03:51:52 +0000 (11:51 +0800)]
Add a db consistency check to remove runners that do not belong to a repository (#30614)

Follow #30406

5 months agoFix wrong table name (#30557)
Lunny Xiao [Tue, 23 Apr 2024 03:00:57 +0000 (11:00 +0800)]
Fix wrong table name (#30557)

The table name should be `oauth2_application` but `o_auth2_application`

Caused by
https://github.com/go-gitea/gitea/pull/21316/files#diff-9610efbc608a41f1f2eaff5790423f0a187906f6ff0beb23a5e8d18366cc2ccfR38

5 months agoFix compare api swagger (#30648)
Lunny Xiao [Tue, 23 Apr 2024 02:22:43 +0000 (10:22 +0800)]
Fix compare api swagger (#30648)

The swagger format on #30349 is not right. This PR will fix it.

5 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 23 Apr 2024 00:24:55 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

5 months agoFix queue test (#30646)
wxiaoguang [Mon, 22 Apr 2024 23:55:43 +0000 (07:55 +0800)]
Fix queue test (#30646)

Fix #30643

The old test code is not stable due to the data-race described in the
TODO added at that time.

Make it stable, and remove a debug-only field from old test code.

5 months agoEnable jquery-related eslint rules that have no violations (#30632)
silverwind [Mon, 22 Apr 2024 14:24:47 +0000 (16:24 +0200)]
Enable jquery-related eslint rules that have no violations (#30632)

All these have no violations, so enable them.

5 months agoEnable more `revive` linter rules (#30608)
silverwind [Mon, 22 Apr 2024 11:48:42 +0000 (13:48 +0200)]
Enable more `revive` linter rules (#30608)

Noteable additions:

- `redefines-builtin-id` forbid variable names that shadow go builtins
- `empty-lines` remove unnecessary empty lines that `gofumpt` does not
remove for some reason
- `superfluous-else` eliminate more superfluous `else` branches

Rules are also sorted alphabetically and I cleaned up various parts of
`.golangci.yml`.

5 months agoRemove obsolete CSS text classes (#30576)
silverwind [Mon, 22 Apr 2024 11:21:06 +0000 (13:21 +0200)]
Remove obsolete CSS text classes (#30576)

- `.text-thin` and `.text-italic` are not present in CSS so were doing nothing and I removed them.
- `.text.middle` was unused so I removed it.
- `.text.italic` is replaced with `tw-italic`.
- `.text.normal` had exactly one use and it wasn't even needed.
- add a `muted` class to the link to `org_profile_avatar.tmpl`.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 months agoHide diff stats on empty PRs (#30629)
silverwind [Mon, 22 Apr 2024 10:48:14 +0000 (12:48 +0200)]
Hide diff stats on empty PRs (#30629)

When a PR is empty, e.g. has neither additions nor deletions, we don't
need to show this:

<img width="125" alt="Screenshot 2024-04-21 at 23 25 38"
src="https://github.com/go-gitea/gitea/assets/115237/0b987eb5-66f5-4b9b-b5aa-7e9e267e9b52">

5 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 22 Apr 2024 00:25:56 +0000 (00:25 +0000)]
[skip ci] Updated licenses and gitignores

5 months agoUse correct hash for "git update-index" (#30626)
wxiaoguang [Mon, 22 Apr 2024 00:13:44 +0000 (08:13 +0800)]
Use correct hash for "git update-index" (#30626)

5 months agoFix repo home UI when there is no repo description (#30552)
wxiaoguang [Sun, 21 Apr 2024 23:47:31 +0000 (07:47 +0800)]
Fix repo home UI when there is no repo description (#30552)

Fix #30502 by a new approach.

![image](https://github.com/go-gitea/gitea/assets/2114189/22f48bca-82d1-45cc-b1b7-ee2344b81a76)

5 months agoFix dropdown text ellipsis (#30628)
wxiaoguang [Sun, 21 Apr 2024 23:14:33 +0000 (07:14 +0800)]
Fix dropdown text ellipsis (#30628)

Follow
https://github.com/go-gitea/gitea/pull/30547#discussion_r1573866519

Fix #30624

The Fomantic UI Dropdown wasn't designed to work that way, its "text"
element might contain images. So the "overflow" shouldn't be added to
any general dropdown text.

![image](https://github.com/go-gitea/gitea/assets/2114189/f6ceaabd-bc89-4bf2-baa2-a6f0324c1962)

5 months agofix(api): refactor branch and tag existence checks (#30618)
Bo-Yi Wu [Sun, 21 Apr 2024 22:19:59 +0000 (06:19 +0800)]
fix(api): refactor branch and tag existence checks (#30618)

- Update branch existence check to also include tag existence check
- Adjust error message for branch/tag existence check

ref: https://github.com/go-gitea/gitea/pull/30349

---------

Signed-off-by: appleboy <appleboy.tw@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoAdd --skip-db option to dump command (#30613)
Kemal Zebari [Sun, 21 Apr 2024 21:32:12 +0000 (14:32 -0700)]
Add --skip-db option to dump command (#30613)

Attempts to resolve #28720.

---

Note that I am not a Gitea administrator so I don't normally use the
gitea CLI. Just saw this issue and wanted an opportunity to understand
how this subcommand works and see if I can add this feature :^)

I tested both with `--skip-db` and without and it appears to not add any
database-specific files to the generated archive i.e. I don't see a
`gitea-db.sql` or `gitea.db` file:
```console
$ TAGS="bindata sqlite sqlite_unlock_notify" make backend
Running go generate...
bindata for migration already up-to-date
bindata for options already up-to-date
bindata for public already up-to-date
bindata for templates already up-to-date
$ ./gitea dump --skip-db
2024/04/20 01:16:11 ...s/setting/session.go:77:loadSessionFrom() [I] Session Service Enabled
2024/04/20 01:16:11 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/attachments
2024/04/20 01:16:11 ...s/storage/storage.go:166:initAvatars() [I] Initialising Avatar storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/avatars
2024/04/20 01:16:11 ...s/storage/storage.go:192:initRepoAvatars() [I] Initialising Repository Avatar storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/repo-avatars
2024/04/20 01:16:11 ...s/storage/storage.go:186:initLFS() [I] Initialising LFS storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/lfs
2024/04/20 01:16:11 ...s/storage/storage.go:198:initRepoArchives() [I] Initialising Repository Archive storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/repo-archive
2024/04/20 01:16:11 ...s/storage/storage.go:208:initPackages() [I] Initialising Packages storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/packages
2024/04/20 01:16:11 ...s/storage/storage.go:219:initActions() [I] Initialising Actions storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/actions_log
2024/04/20 01:16:11 ...s/storage/storage.go:223:initActions() [I] Initialising ActionsArtifacts storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/actions_artifacts
2024/04/20 01:16:11 cmd/dump.go:172:runDump() [I] Dumping local repositories... /workspaces/gitea/data/gitea-repositories
2024/04/20 01:16:11 cmd/dump.go:195:runDump() [I] Skipping database
2024/04/20 01:16:11 cmd/dump.go:229:runDump() [I] Adding custom configuration file from /workspaces/gitea/custom/conf/app.ini
2024/04/20 01:16:11 cmd/dump.go:256:runDump() [I] Packing data directory.../workspaces/gitea/data
2024/04/20 01:16:11 cmd/dump.go:335:runDump() [I] Finish dumping in file /workspaces/gitea/gitea-dump-1713575771.zip
$ unzip /workspaces/gitea/gitea-dump-1713575771.zip -d example
Archive:  /workspaces/gitea/gitea-dump-1713575771.zip
. . .
$ ls example/
app.ini  custom  data  repos
$ ls example/data/
actions_artifacts  actions_log  avatars  home  indexers  jwt  queues  repo-archive  repo-avatars  tmp
```

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoFix flash on dashboard (#30572)
silverwind [Sun, 21 Apr 2024 20:24:56 +0000 (22:24 +0200)]
Fix flash on dashboard (#30572)

Fixes https://github.com/go-gitea/gitea/issues/30566, regression from
https://github.com/go-gitea/gitea/pull/30214.

5 months agochore: use errors.New to replace fmt.Errorf with no parameters will much better ...
Cheng [Sun, 21 Apr 2024 19:44:03 +0000 (03:44 +0800)]
chore: use errors.New to replace fmt.Errorf with no parameters will much better (#30621)

use errors.New to replace fmt.Errorf with no parameters will much better

5 months agoFix issue comment form and quick-submit (#30623)
wxiaoguang [Sun, 21 Apr 2024 17:00:04 +0000 (01:00 +0800)]
Fix issue comment form and quick-submit (#30623)

1. Rewrite initGlobalEnterQuickSubmit (by the way, remove jQuery)
2. Fix issue comment form layout

5 months agoUse maintained gziphandler (#30592)
Lunny Xiao [Sun, 21 Apr 2024 00:53:45 +0000 (08:53 +0800)]
Use maintained gziphandler (#30592)

Replace #27894

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 21 Apr 2024 00:26:57 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

5 months agoFix package list performance (#30520)
KN4CK3R [Sat, 20 Apr 2024 11:07:00 +0000 (13:07 +0200)]
Fix package list performance (#30520)

Fixes #28255

The new query uses the id field to sort by "newer". This most not be
correct (usually it is) but it's faster (see #28255).
If someone has a better idea, please propose changes.

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoClarify permission "HasAccess" behavior (#30585)
wxiaoguang [Sat, 20 Apr 2024 03:15:04 +0000 (11:15 +0800)]
Clarify permission "HasAccess" behavior (#30585)

Follow #30495

"HasAccess" behavior wasn't clear, to make it clear:

* Use a new name `HasAnyUnitAccess`, it will be easier to review related
code and permission problems.
* Separate everyone access mode to a separate field, then all calls to
HasAccess are reverted to old behavior before #30495.
* Add new tests.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoFix links in PyPI Simple Repository API page (#30594)
wxiaoguang [Sat, 20 Apr 2024 01:15:14 +0000 (09:15 +0800)]
Fix links in PyPI Simple Repository API page (#30594)

Thanks to @Zottelchen for looking into problem and proposing the fix.

Ref: https://github.com/astral-sh/uv/issues/3017 ,
https://peps.python.org/pep-0503/

This PR's change is from Zottelchen's work.

And I by the way rename the `$p` to `$pd` because `p` is used as
"package" in code, while `pd` is used as "package description".

----

Co-authored-by: Zottelchen
5 months agoUse action user as the trigger user of schedules (#30581)
yp05327 [Sat, 20 Apr 2024 00:35:29 +0000 (09:35 +0900)]
Use action user as the trigger user of schedules (#30581)

Follow https://github.com/go-gitea/gitea/pull/30357

When user push to default branch, the schedule trigger user will be the
user.
When disable then enable action units in settings, the schedule trigger
user will be action user.
When repo is a mirror, the schedule trigger user will be action user. (
before it will return error, fixed by #30357)

As scheduled job is a cron, the trigger user should be action user from
Gitea, not a real user.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoFix commit file status parser (#30602)
wxiaoguang [Fri, 19 Apr 2024 14:41:03 +0000 (22:41 +0800)]
Fix commit file status parser (#30602)

Try to fix  #30492

5 months agoFix HEAD method for robots.txt (#30603)
wxiaoguang [Fri, 19 Apr 2024 13:43:56 +0000 (21:43 +0800)]
Fix HEAD method for robots.txt (#30603)

Fix #30601

5 months agoFix project description rendering for org (#30587)
wxiaoguang [Fri, 19 Apr 2024 07:58:56 +0000 (15:58 +0800)]
Fix project description rendering for org (#30587)

Fix #30263

![image](https://github.com/go-gitea/gitea/assets/2114189/41cabe6c-f94a-4874-a26f-d01bb89bb28c)

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoFix changelog (main) (#30582)
wxiaoguang [Fri, 19 Apr 2024 06:08:30 +0000 (14:08 +0800)]
Fix changelog (main) (#30582)

1. The 1.21.11 changelog is missing
2. Split the old content to CHANGELOG-archived.md, to reduce the size of
CHANGELOG.md

5 months agoAvoid importing `modules/web/middleware` in `modules/session` (#30584)
Jason Song [Fri, 19 Apr 2024 04:03:53 +0000 (12:03 +0800)]
Avoid importing `modules/web/middleware` in `modules/session` (#30584)

Related to #30375.

It doesn't make sense to import `modules/web/middleware` and
`modules/setting` in `modules/web/session` since the last one is more
low-level.

And it looks like a workaround to call `DeleteLegacySiteCookie` in
`RegenerateSession`, so maybe we could reverse the importing by
registering hook functions.

5 months agoEnable npm cache on `setup-node` action (#30577)
silverwind [Fri, 19 Apr 2024 03:29:08 +0000 (05:29 +0200)]
Enable npm cache on `setup-node` action (#30577)

Enable npm dependency cache in
[setup-node](https://github.com/actions/setup-node). This should work
reliably and across branches as well.

5 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 19 Apr 2024 00:24:35 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

5 months agoMock queue backoff duration (#30553)
wxiaoguang [Thu, 18 Apr 2024 20:00:59 +0000 (04:00 +0800)]
Mock queue backoff duration (#30553)

During testing, the backoff duration shouldn't be longer than other
durations

5 months agoImprove "Reference in new issue" modal (#30547)
silverwind [Thu, 18 Apr 2024 19:31:53 +0000 (21:31 +0200)]
Improve "Reference in new issue" modal (#30547)

Fixes: https://github.com/go-gitea/gitea/issues/29994
Also some misc enhancements done to the form in the modal.

<img width="840" alt="Screenshot 2024-04-17 at 23 02 55"
src="https://github.com/go-gitea/gitea/assets/115237/e71fba55-55cd-4e48-a497-6b1025c36a43">

5 months agoAdd a few root files to lint-spell (#30530)
silverwind [Thu, 18 Apr 2024 18:54:40 +0000 (20:54 +0200)]
Add a few root files to lint-spell (#30530)

Files in root were not linted, add them. No new violations.

5 months agoRefactor and fix archive link bug (#30535)
wxiaoguang [Thu, 18 Apr 2024 16:45:50 +0000 (00:45 +0800)]
Refactor and fix archive link bug (#30535)

Regression of #29920
Fixes: #30569
Also this is a rewriting to eliminate the remaining jQuery usages from code.

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoFixup app.example.ini for task section, which is now queue.task (#30555)
Jerry Jacobs [Thu, 18 Apr 2024 11:22:06 +0000 (13:22 +0200)]
Fixup app.example.ini for task section, which is now queue.task (#30555)

Config section `[task]` has been deprecated in favor of `[queue.task]`

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 months agoSome following up changes for routes (#30550)
wxiaoguang [Thu, 18 Apr 2024 09:36:19 +0000 (17:36 +0800)]
Some following up changes for routes (#30550)

1. Switch back to the old order for `reqRepoAdmin, context.RepoRef()`
2. Add a routing function info for global NotFound

5 months agoAdd form field id generation, remove duplicated ids (#30546)
silverwind [Thu, 18 Apr 2024 09:01:06 +0000 (11:01 +0200)]
Add form field id generation, remove duplicated ids (#30546)

Fixes: https://github.com/go-gitea/gitea/issues/30384
On repo settings page, there id `repo_name` was used 5 times on the same
page, some in modal and such. I think we are better off just
auto-generating these IDs in the future so that labels link up with
their form element.

Ideally this id generation would be done in backend in a subtemplate,
but seeing that we already have similar JS patches for checkboxes, I
took the easy path for now.

I also checked that these `#repo_name` were not in use in JS and the
only case where this id appears in JS is on the migration page where
it's still there.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoFix border-radius on view, blame and code search (#30545)
silverwind [Thu, 18 Apr 2024 08:34:23 +0000 (10:34 +0200)]
Fix border-radius on view, blame and code search (#30545)

Fixes: https://github.com/go-gitea/gitea/issues/30540
1. Fix all these boxes by adding `bottom attached` and removing a
problematic CSS rule:

<img width="1319" alt="Screenshot 2024-04-17 at 22 25 31"
src="https://github.com/go-gitea/gitea/assets/115237/346445a4-4944-4003-a1ef-6f5b0eda624e">
<img width="643" alt="Screenshot 2024-04-17 at 22 21 18"
src="https://github.com/go-gitea/gitea/assets/115237/10f17ed3-9ad6-48de-92fa-bac6621815b9">

2. Change the "last commit" box to `ui segment` which has correct
border-radius. Also included is a tiny tweak to make author name ellipse
instead of wrap.

<img width="1331" alt="Screenshot 2024-04-17 at 22 23 23"
src="https://github.com/go-gitea/gitea/assets/115237/285fbd45-ced0-4d33-abe3-7384ffa03188">

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoDisable enter key for accepting code completion in Monaco (#30548)
silverwind [Thu, 18 Apr 2024 08:06:56 +0000 (10:06 +0200)]
Disable enter key for accepting code completion in Monaco (#30548)

Fixes https://github.com/go-gitea/gitea/issues/28114 and behaviour
matches vscode on desktop as well.

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoAdd an api test for updating user (#30539)
Lunny Xiao [Thu, 18 Apr 2024 03:16:20 +0000 (11:16 +0800)]
Add an api test for updating user (#30539)

Fix #30518

5 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 18 Apr 2024 00:26:04 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

5 months agoExpose fuzzy search for issues/pulls (#29701)
6543 [Thu, 18 Apr 2024 00:16:52 +0000 (02:16 +0200)]
Expose fuzzy search for issues/pulls (#29701)

close  #29685

---------

Signed-off-by: 6543 <6543@obermui.de>
Co-authored-by: silverwind <me@silverwind.io>
5 months agoAllow everyone to read or write a wiki by a repo unit setting (#30495)
wxiaoguang [Wed, 17 Apr 2024 15:58:37 +0000 (23:58 +0800)]
Allow everyone to read or write a wiki by a repo unit setting (#30495)

Replace #6312
Help #5833
Wiki solution for #639

5 months agoSupport nuspec manifest download for nuget packages (#28921)
Michael Kriese [Wed, 17 Apr 2024 15:30:41 +0000 (17:30 +0200)]
Support nuspec manifest download for nuget packages (#28921)

Support downloading nuget nuspec manifest[^1]. This is useful for
renovate because it uses this api to find the corresponding repository

- Store nuspec along with nupkg on upload
- allow downloading nuspec
- add doctor command to add missing nuspec files

[^1]:
https://learn.microsoft.com/en-us/nuget/api/package-base-address-resource#download-package-manifest-nuspec

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
5 months agoFix branch_protection api shows users/teams who has no readAccess (#30291)
Edward Zhang [Wed, 17 Apr 2024 13:24:07 +0000 (21:24 +0800)]
Fix branch_protection api shows users/teams who has no readAccess (#30291)

Add some logic in `convert.ToBranchProtection` to return only the names
associated with readAccess instead of returning all names. This will
ensure consistency in behavior between the frontend and backend.
Fixes: #27694
---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: wenzhuo.zhang <wenzhuo.zhang@geely.com>
Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoCorrect locale string rendering (#30522)
wxiaoguang [Wed, 17 Apr 2024 10:24:08 +0000 (18:24 +0800)]
Correct locale string rendering (#30522)

Since #29165, the translations are rendered as HTML in templates, so:

1. if the translation does contain `<>`, use `TrString`
2. use `{dummy}` instead of `<dummy>` as much as possible

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoRun `go generate` and `go vet` on all packages (#30529)
silverwind [Wed, 17 Apr 2024 09:40:35 +0000 (11:40 +0200)]
Run `go generate` and `go vet` on all packages (#30529)

Fixes: https://github.com/go-gitea/gitea/issues/30512
I think this does mean those tools would run on a potential `vendor`
directory, but I'm not sure we really support vendoring of dependencies
anymore.

`release` has a `vendor` prerequisite so likely the source tarballs
contain vendor files?