]> source.dussan.org Git - gitea.git/log
gitea.git
8 months agoFix incorrect action duration time when rerun the job before executed once (#28364)
yp05327 [Fri, 19 Jan 2024 14:05:49 +0000 (23:05 +0900)]
Fix incorrect action duration time when rerun the job before executed once (#28364)

Fix #28323
Reason was mentioned here:
https://github.com/go-gitea/gitea/issues/28323#issuecomment-1841867298

### Changes: (maybe breaking)
We can rerun jobs in Gitea, so there will be some problems in
calculating duration time.
In this PR, I use the exist `Started` and `Stopped` column to record the
last run time instead of the total time,
and add a new `PreviousDuration` column to record the previous duration
time.
You can also check the cost time of last run:

![image](https://github.com/go-gitea/gitea/assets/18380374/2ca39145-2c92-401a-b78b-43164f7ae061)

8 months agoFix some RPM registry flaws (#28782)
KN4CK3R [Fri, 19 Jan 2024 11:37:10 +0000 (12:37 +0100)]
Fix some RPM registry flaws (#28782)

Related #26984
(https://github.com/go-gitea/gitea/pull/26984#issuecomment-1889588912)

Fix admin cleanup message.
Fix models `Get` not respecting default values.
Rebuild RPM repository files after cleanup.
Do not add RPM group to package version name.
Force stable sorting of Alpine/Debian/RPM repository data.
Fix missing deferred `Close`.
Add tests for multiple RPM groups.
Removed non-cached `ReplaceAllStringRegex`.

If there are multiple groups available, it's stated in the package
installation screen:

![grafik](https://github.com/go-gitea/gitea/assets/1666336/8f132760-882c-4ab8-9678-77e47dfc4415)

8 months agotests: missing refs/ in bare repositories (#28844)
Adam Majer [Fri, 19 Jan 2024 07:12:21 +0000 (07:12 +0000)]
tests: missing refs/ in bare repositories (#28844)

Git 2.43.0 will not detect a git repository as valid without refs/
subdirectory present. `git gc` cleans this up and puts it in
packed-refs. We must keep refs/ non-empty.

8 months agoFix archive creating LFS hooks and breaking pull requests (#28848)
Brecht Van Lommel [Fri, 19 Jan 2024 05:49:18 +0000 (06:49 +0100)]
Fix archive creating LFS hooks and breaking pull requests (#28848)

When LFS hooks are present in gitea-repositories, operations like git
push for creating a pull request fail. These repositories are not meant
to include LFS files or git push them, that is handled separately. And
so they should not have LFS hooks.

Installing git-lfs on some systems (like Debian Linux) will
automatically set up /etc/gitconfig to create LFS hooks in repositories.
For most git commands in Gitea this is not a problem, either because
they run on a temporary clone or the git command does not create LFS
hooks.

But one case where this happens is git archive for creating repository
archives. To fix that, add a GIT_CONFIG_NOSYSTEM=1 to disable using the
system configuration for that command.

According to a comment, GIT_CONFIG_NOSYSTEM is not used for all git
commands because the system configuration can be intentionally set up
for Gitea to use.

Resolves #19810, #21148

8 months agoReturn `responseText` instead of string in some functions (#28836)
yp05327 [Fri, 19 Jan 2024 02:45:23 +0000 (11:45 +0900)]
Return `responseText` instead of string in some functions (#28836)

Follow
https://github.com/go-gitea/gitea/pull/28796#issuecomment-1891727591

8 months agoFix display latest sync time for pull mirrors on the repo page (#28841)
yp05327 [Thu, 18 Jan 2024 10:27:07 +0000 (19:27 +0900)]
Fix display latest sync time for pull mirrors on the repo page (#28841)

Follow #28712

1. Missing Locale word `mirror_sync`
2. Maybe forgot checking the conflict from #27760

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/6100d35b-7fe3-4095-9c24-7875568f7380)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/69647169-b812-45bc-a267-ab28f2df6ef6)

9 months agoAdd testing for CalcCommitStatus (#28823)
Lunny Xiao [Wed, 17 Jan 2024 13:27:59 +0000 (21:27 +0800)]
Add testing for CalcCommitStatus (#28823)

9 months agoRemove duplicated checkinit on git module (#28824)
Lunny Xiao [Wed, 17 Jan 2024 09:56:00 +0000 (17:56 +0800)]
Remove duplicated checkinit on git module (#28824)

`checkInit` has been invoked in `InitSimple`. So it's unnecessary to
invoke it twice in `InitFull`.

9 months agoAdd missing migration (#28827)
Lunny Xiao [Wed, 17 Jan 2024 09:26:45 +0000 (17:26 +0800)]
Add missing migration (#28827)

Missed from #28498

9 months agoFix uploaded artifacts should be overwritten (#28726)
FuXiaoHei [Wed, 17 Jan 2024 03:21:16 +0000 (11:21 +0800)]
Fix uploaded artifacts should be overwritten (#28726)

Fix `Uploaded artifacts should be overwritten`
https://github.com/go-gitea/gitea/issues/28549

When upload different content to uploaded artifact, it checks that
content size is not match in db record with previous artifact size, then
the new artifact is refused.

Now if it finds uploading content size is not matching db record when
receiving chunks, it updates db records to follow the latest size value.

9 months agoRetarget depending pulls when the parent branch is deleted (#28686)
Viktor Kuzmin [Wed, 17 Jan 2024 00:44:56 +0000 (03:44 +0300)]
Retarget depending pulls when the parent branch is deleted (#28686)

Sometimes you need to work on a feature which depends on another (unmerged) feature.
In this case, you may create a PR based on that feature instead of the main branch.
Currently, such PRs will be closed without the possibility to reopen in case the parent feature is merged and its branch is deleted.
Automatic target branch change make life a lot easier in such cases.
Github and Bitbucket behave in such way.

Example:
$PR_1$: main <- feature1
$PR_2$: feature1 <- feature2

Currently, merging $PR_1$ and deleting its branch leads to $PR_2$ being closed without the possibility to reopen.
This is both annoying and loses the review history when you open a new PR.

With this change, $PR_2$ will change its target branch to main ($PR_2$: main <- feature2) after $PR_1$ has been merged and its branch has been deleted.

This behavior is enabled by default but can be disabled.
For security reasons, this target branch change will not be executed when merging PRs targeting another repo.

Fixes #27062
Fixes #18408

---------

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: delvh <dev.lh@web.de>
9 months agoBump `@github/relative-time-element` to 4.3.1 (#28819)
Yarden Shoham [Tue, 16 Jan 2024 21:52:19 +0000 (23:52 +0200)]
Bump `@github/relative-time-element` to 4.3.1 (#28819)

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

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/65d8dc84-680f-4c16-9aa1-b5986102e4e7)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/7cb288e7-ebde-4e94-a10a-cac28d6bdcfd)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
9 months agoFix reverting a merge commit failing (#28794)
Mihir Joshi [Tue, 16 Jan 2024 15:06:51 +0000 (20:36 +0530)]
Fix reverting a merge commit failing (#28794)

Fixes #22236

---
Error occurring currently while trying to revert commit using read-tree
-m approach:
> 2022/12/26 16:04:43 ...rvices/pull/patch.go:240:AttemptThreeWayMerge()
[E] [63a9c61a] Unable to run read-tree -m! Error: exit status 128 -
fatal: this operation must be run in a work tree
>   - fatal: this operation must be run in a work tree

We need to clone a non-bare repository for `git read-tree -m` to work.

https://github.com/go-gitea/gitea/commit/bb371aee6ecf5e570cdf7b5f7f0d6f47a607a325
adds support to create a non-bare cloned temporary upload repository.

After cloning a non-bare temporary upload repository, we [set default
index](https://github.com/go-gitea/gitea/blob/main/services/repository/files/cherry_pick.go#L37)
(`git read-tree HEAD`).
This operation ends up resetting the git index file (see investigation
details below), due to which, we need to call `git update-index
--refresh` afterward.

Here's the diff of the index file before and after we execute
SetDefaultIndex: https://www.diffchecker.com/hyOP3eJy/

Notice the **ctime**, **mtime** are set to 0 after SetDefaultIndex.

You can reproduce the same behavior using these steps:
```bash
$ git clone https://try.gitea.io/me-heer/test.git -s -b main
$ cd test
$ git read-tree HEAD
$ git read-tree -m 1f085d7ed8 1f085d7ed8 9933caed00
error: Entry '1' not uptodate. Cannot merge.
```

After which, we can fix like this:
```
$ git update-index --refresh
$ git read-tree -m 1f085d7ed8 1f085d7ed8 9933caed00
```

9 months agoRender code block in activity tab (#28816)
JakobDev [Tue, 16 Jan 2024 14:38:09 +0000 (15:38 +0100)]
Render code block in activity tab (#28816)

This is a little bugfix. Inline code is usually rendered in issue
titles, but it is missing in the activity tab.

Before:
![Screenshot 2024-01-16 at 14-20-51
Test](https://github.com/go-gitea/gitea/assets/15185051/383370f3-0fb2-49de-81cc-014e5cf86727)
After:

![grafik](https://github.com/go-gitea/gitea/assets/15185051/83eaf973-ce9a-44ce-beea-2db49fc8bd73)

9 months agoRemove trust model selection from repository creation on web page because it can...
Lunny Xiao [Tue, 16 Jan 2024 12:54:48 +0000 (20:54 +0800)]
Remove trust model selection from repository creation on web page because it can be changed in settings later (#28814)

As more and more options can be set for creating the repository, I don't
think we should put all of them into the creation web page which will
make things look complicated and confusing.

And I think we need some rules about how to decide which should/should
not be put in creating a repository page. One rule I can imagine is if
this option can be changed later and it's not a MUST on the creation,
then it can be removed on the page. So I found trust model is the first
one.

This PR removed the trust model selections on creating a repository web
page and kept others as before.
This is also a preparation for #23894 which will add a choice about SHA1
or SHA256 that cannot be changed once the repository created.

9 months agoUse refname:strip-2 instead of refname:short when syncing tags (#28797)
Lunny Xiao [Tue, 16 Jan 2024 07:13:07 +0000 (15:13 +0800)]
Use refname:strip-2 instead of refname:short when syncing tags (#28797)

Fix #28694

Generally, `refname:short` should be equal to `refname:lstrip=2` except
`core.warnAmbiguousRefs is used to select the strict abbreviation mode.`

ref:
https://git-scm.com/docs/git-for-each-ref#Documentation/git-for-each-ref.txt-refname

9 months agoAdd gist to comparison (#28809)
crapStone [Mon, 15 Jan 2024 22:37:32 +0000 (22:37 +0000)]
Add gist to comparison (#28809)

This PR adds a section to the documentation that links to the project
[Opengist](https://github.com/thomiceli/opengist) on GitHub.

The feature was proposed in #16670 but didn't resonate well with the
maintainers.

9 months agoFix links in issue card (#28806)
Denys Konovalov [Mon, 15 Jan 2024 20:38:13 +0000 (21:38 +0100)]
Fix links in issue card (#28806)

Fixes_
https://github.com/go-gitea/gitea/issues/23318#issuecomment-1611086747

9 months agoShow latest commit for file (#28067)
JakobDev [Mon, 15 Jan 2024 16:42:15 +0000 (17:42 +0100)]
Show latest commit for file (#28067)

If you view a file, you can now see the latest commit that changed that file.

![grafik](https://github.com/go-gitea/gitea/assets/15185051/272c3120-6db7-4f88-86e1-60080c9aabe5)

---------

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
9 months agoAdd ability to see open and closed issues at the same time (#28757)
Gwyneth Morgan [Mon, 15 Jan 2024 15:07:22 +0000 (07:07 -0800)]
Add ability to see open and closed issues at the same time (#28757)

By clicking the currently active "Open" or "Closed" filter button in the
issue list, the user can toggle that filter off in order to see all
issues regardless of state. The URL "state" parameter will be set to
"all" and the "Open"/"Closed" button will not show as active.

9 months agoDisplay latest sync time for pull mirrors on the repo page (#28712)
Dmitry Sharshakov [Mon, 15 Jan 2024 14:37:14 +0000 (17:37 +0300)]
Display latest sync time for pull mirrors on the repo page (#28712)

Fixes #25168

---------

Co-authored-by: delvh <dev.lh@web.de>
9 months agoFix `GetCommitStatuses` (#28787)
KN4CK3R [Mon, 15 Jan 2024 14:07:32 +0000 (15:07 +0100)]
Fix `GetCommitStatuses` (#28787)

Fixes #28764.

9 months agoCaller should check the ResponseExtra.HasError() first to see whether the request...
wxiaoguang [Mon, 15 Jan 2024 11:15:31 +0000 (19:15 +0800)]
Caller should check the ResponseExtra.HasError() first to see whether the request fails (#28796)

`resp != nil` doesn't mean the request really succeeded. Add a comment
for requestJSONResp to clarify the behavior.

9 months agoRework markup link rendering (#26745)
KN4CK3R [Mon, 15 Jan 2024 08:49:24 +0000 (09:49 +0100)]
Rework markup link rendering (#26745)

Fixes #26548

This PR refactors the rendering of markup links. The old code uses
`strings.Replace` to change some urls while the new code uses more
context to decide which link should be generated.

The added tests should ensure the same output for the old and new
behaviour (besides the bug).

We may need to refactor the rendering a bit more to make it clear how
the different helper methods render the input string. There are lots of
options (resolve links / images / mentions / git hashes / emojis / ...)
but you don't really know what helper uses which options. For example,
we currently support images in the user description which should not be
allowed I think:

<details>
  <summary>Profile</summary>

https://try.gitea.io/KN4CK3R

![grafik](https://github.com/go-gitea/gitea/assets/1666336/109ae422-496d-4200-b52e-b3a528f553e5)

</details>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoFix nil pointer panic when exec some gitea cli command (#28791)
yp05327 [Mon, 15 Jan 2024 07:43:53 +0000 (16:43 +0900)]
Fix nil pointer panic when exec some gitea cli command (#28791)

panic:

![image](https://github.com/go-gitea/gitea/assets/18380374/7fcde2ad-1d42-4b60-b120-3b60a8926e8e)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/49d9f0ca-e590-4a35-8ca2-1317d1b7c939)

9 months agoAdd branch protection setting for ignoring stale approvals (#28498)
Jimmy Praet [Mon, 15 Jan 2024 07:20:01 +0000 (08:20 +0100)]
Add branch protection setting for ignoring stale approvals (#28498)

Fixes #27114.

* In Gitea 1.12 (#9532), a "dismiss stale approvals" branch protection
setting was introduced, for ignoring stale reviews when verifying the
approval count of a pull request.
* In Gitea 1.14 (#12674), the "dismiss review" feature was added.
* This caused confusion with users (#25858), as "dismiss" now means 2
different things.
* In Gitea 1.20 (#25882), the behavior of the "dismiss stale approvals"
branch protection was modified to actually dismiss the stale review.

For some users this new behavior of dismissing the stale reviews is not
desirable.

So this PR reintroduces the old behavior as a new "ignore stale
approvals" branch protection setting.

---------

Co-authored-by: delvh <dev.lh@web.de>
9 months agoForbid removing the last admin user (#28337)
yp05327 [Mon, 15 Jan 2024 06:51:43 +0000 (15:51 +0900)]
Forbid removing the last admin user (#28337)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
9 months agoFix when private user following user, private user will not be counted in his own...
yp05327 [Mon, 15 Jan 2024 05:43:14 +0000 (14:43 +0900)]
Fix when private user following user, private user will not be counted in his own view (#28037)

Doer: asdasasdasasdasasdasasdasasdasasdasasdas (private user)
Followed: TestUser (public user)

Before:
(From doer's view)

![image](https://github.com/go-gitea/gitea/assets/18380374/9ba16b3b-068c-43c5-a3dd-e3343b5b32f2)
(From followed user's view, can see doer)

![image](https://github.com/go-gitea/gitea/assets/18380374/dfd1b564-d689-4393-b3d3-1e6bf52c94ba)

After:
(From doer's view)

![image](https://github.com/go-gitea/gitea/assets/18380374/1c85c1d1-c9f7-40c8-948c-145f7cae9a04)

9 months agoUpdate github.com/cloudflare/circl (#28789)
Chongyi Zheng [Mon, 15 Jan 2024 03:14:26 +0000 (11:14 +0800)]
Update github.com/cloudflare/circl (#28789)

cloudflare/circl: https://github.com/advisories/GHSA-9763-4f94-gfch

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
9 months agoMove more functions to db.Find (#28419)
Lunny Xiao [Mon, 15 Jan 2024 02:19:25 +0000 (10:19 +0800)]
Move more functions to db.Find (#28419)

Following #28220

This PR move more functions to use `db.Find`.

---------

Co-authored-by: delvh <dev.lh@web.de>
9 months agoAdd non-JS fallback for reaction tooltips (#28785)
Gwyneth Morgan [Mon, 15 Jan 2024 01:42:59 +0000 (17:42 -0800)]
Add non-JS fallback for reaction tooltips (#28785)

When JavaScript is not loaded, fall back to displaying reaction tooltips
with the default browser `title` attribute. An element with a present
but empty `data-tooltip-content` will use the `title` attribute for its
tippy.js tooltip content, so when JavaScript is enabled, this functions
the same as the current behavior.

9 months agoModernize merge button (#28140)
Earl Warren [Sun, 14 Jan 2024 22:00:47 +0000 (23:00 +0100)]
Modernize merge button (#28140)

- Make use of the `form-fetch-action` for the merge button, which will
automatically prevent the action from happening multiple times and show
a nice loading indicator as user feedback while the merge request is
being processed by the server.
- Adjust the merge PR code to JSON response as this is required for the
`form-fetch-action` functionality.
- Resolves https://codeberg.org/forgejo/forgejo/issues/774
- Likely resolves the cause of
https://codeberg.org/forgejo/forgejo/issues/1688#issuecomment-1313044

(cherry picked from commit 4ec64c19507caefff7ddaad722b1b5792b97cc5a)

Co-authored-by: Gusted <postmaster@gusted.xyz>
9 months agoWarn that `DISABLE_QUERY_AUTH_TOKEN` is false only if it's explicitly defined (#28783)
Yarden Shoham [Sun, 14 Jan 2024 20:20:18 +0000 (22:20 +0200)]
Warn that `DISABLE_QUERY_AUTH_TOKEN` is false only if it's explicitly defined (#28783)

So we don't warn on default behavior

- Fixes https://github.com/go-gitea/gitea/issues/28758
- Follows https://github.com/go-gitea/gitea/pull/28390

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
9 months agoSpeed up loading the dashboard on mysql/mariadb (#28546)
Lunny Xiao [Sun, 14 Jan 2024 14:34:25 +0000 (22:34 +0800)]
Speed up loading the dashboard on mysql/mariadb (#28546)

Fixes #28155

9 months agoFix schedule tasks bugs (#28691)
Lunny Xiao [Fri, 12 Jan 2024 21:50:38 +0000 (05:50 +0800)]
Fix schedule tasks bugs (#28691)

Fix #28157

This PR fix the possible bugs about actions schedule.

## The Changes

- Move `UpdateRepositoryUnit` and `SetRepoDefaultBranch` from models to
service layer
- Remove schedules plan from database and cancel waiting & running
schedules tasks in this repository when actions unit has been disabled
or global disabled.
- Remove schedules plan from database and cancel waiting & running
schedules tasks in this repository when default branch changed.

9 months agoAdd tests for #28765 (#28773)
Jack Hay [Fri, 12 Jan 2024 17:15:42 +0000 (12:15 -0500)]
Add tests for #28765 (#28773)

Adds tests to cover changes made in #28765

9 months agoFix issue dependencies (#27736)
Nanguan Lin [Fri, 12 Jan 2024 16:49:02 +0000 (00:49 +0800)]
Fix issue dependencies (#27736)

Fix #27722
Fix #27357
Fix #25837
1. Fix the typo `BlockingByDependenciesNotPermitted`, which causes the
`not permitted message` not to show. The correct one is `Blocking` or
`BlockedBy`
2. Rewrite the perm check. The perm check uses a very tricky way to
avoid duplicate checks for a slice of issues, which is confusing. In
fact, it's also the reason causing the bug. It uses `lastRepoID` and
`lastPerm` to avoid duplicate checks, but forgets to assign the
`lastPerm` at the end of the code block. So I rewrote this to avoid this
trick.
![I U1AT{GNFY3
1HZ`6L{(2L](https://github.com/go-gitea/gitea/assets/70063547/79acd02a-a567-4316-ae0d-11c6461becf1)
3. It also reuses the `blocks` slice, which is even more confusing. So I
rewrote this too.

![UARFPXRGGZQFB7J$2`R}5_R](https://github.com/go-gitea/gitea/assets/70063547/f21cff0f-d9ac-4ce4-ae4d-adffc98ecd99)

9 months agoAssign pull request to project during creation (#28227)
Denys Konovalov [Fri, 12 Jan 2024 15:25:15 +0000 (16:25 +0100)]
Assign pull request to project during creation (#28227)

When creating a pull request, allow directly assigning it to a project,
as it is already possible for issues.

After:

![grafik](https://github.com/go-gitea/gitea/assets/47871822/01dc2b3d-d56a-4053-b2fc-138725d7633a)

9 months agoFix button size in "attached header right" (#28770)
wxiaoguang [Fri, 12 Jan 2024 14:43:40 +0000 (22:43 +0800)]
Fix button size in "attached header right" (#28770)

Before:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/c82f8615-04d4-408f-95bf-689c227a8814)

![image](https://github.com/go-gitea/gitea/assets/2114189/d01d05a7-09ca-48f3-a0e7-fec48119b426)

</details>

After:

![image](https://github.com/go-gitea/gitea/assets/2114189/e560398e-2fa4-4f46-9229-f6acc70e32ab)

![image](https://github.com/go-gitea/gitea/assets/2114189/bd18961d-0636-4584-b893-c465daaf40af)

9 months agoImprove CSS helper naming (#28769)
wxiaoguang [Fri, 12 Jan 2024 12:28:01 +0000 (20:28 +0800)]
Improve CSS helper naming (#28769)

* `gt-w-100` => `gt-w-full` to match tailwind
* clarify `gt-hidden` priority

9 months agoRevamp repo header (#27760)
Denys Konovalov [Fri, 12 Jan 2024 03:44:06 +0000 (04:44 +0100)]
Revamp repo header (#27760)

Redesign repo header with following new aspects:
- responsive & better-looking repo title
- hide repo button text instead of icons in mobile view
- use same tab style as on explore and org page

<details>
<summary>Before:</summary>

![grafik](https://github.com/go-gitea/gitea/assets/47871822/57360b77-d43c-49ac-b798-2363c03da7ec)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/d4117f79-a5f5-4f36-bf65-bbada3e7e73b)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/e26f967f-e264-4337-9925-3d942e04fd6d)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/b4683c8d-9c6a-4089-afa7-8dd219e43a46)

</details>

<details>
<summary>After:</summary>

![grafik](https://github.com/go-gitea/gitea/assets/47871822/8ddbc9f6-53c7-4e4e-bea9-704fd93524ca)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/c0588aa9-788d-469c-98a0-81484fbd220c)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/206e931e-404d-4d1b-92ce-908698addfcc)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/a508f9c8-fadc-4a85-94ba-18796f77e07b)

9 months agoSupport for grouping RPMs using paths (#26984)
Exploding Dragon [Fri, 12 Jan 2024 03:16:05 +0000 (11:16 +0800)]
Support for grouping RPMs using paths (#26984)

The current rpm repository places all packages in the same repository,
and different systems (el7,f34) may hit packages that do not belong to
this distribution ( #25304 ) , which now supports grouping of rpm.

![图片](https://github.com/go-gitea/gitea/assets/33776693/d1e1d99f-7799-4b2b-a19b-cb2a5c692914)

Fixes #25304 .
Fixes #27056 .

Refactor: [#25866](https://github.com/go-gitea/gitea/pull/25866)

9 months agoRequire token for GET subscription endpoint (#28765)
Jack Hay [Fri, 12 Jan 2024 01:57:58 +0000 (20:57 -0500)]
Require token for GET subscription endpoint (#28765)

Fixes  #28756

## Changes
- Require and check API token for `GET
/repos/{owner}/{repo}/subscription` in order to populate `ctx.Doer`.

9 months agoFix `convert.ToTeams` on empty input (#28426)
KN4CK3R [Thu, 11 Jan 2024 22:12:08 +0000 (23:12 +0100)]
Fix `convert.ToTeams` on empty input (#28426)

Fixes #28420

Don't return `nil` if the input was empty.

9 months agoShow description as tooltip instead of title for labels (#28754)
delvh [Thu, 11 Jan 2024 16:21:52 +0000 (17:21 +0100)]
Show description as tooltip instead of title for labels (#28754)

Follow GitHubs behavior of showing the label description as a tooltip
instead of the browser native title.

## Before

![grafik](https://github.com/go-gitea/gitea/assets/51889757/70448327-467b-4bee-b799-40a442a5ce16)

## After

![grafik](https://github.com/go-gitea/gitea/assets/51889757/abe7d700-148b-4cef-a487-6b0f8f20b212)

9 months agoIntegration Test for Commit Search containing Square Brackets (#28751)
Mihir Joshi [Thu, 11 Jan 2024 03:04:45 +0000 (08:34 +0530)]
Integration Test for Commit Search containing Square Brackets (#28751)

Integration test for #28744

Change keywords commit search flag from `-F` to `--fixed-strings` for
readability

9 months agoHide code related setting options in repository when code unit is disabled (#28631)
Lunny Xiao [Wed, 10 Jan 2024 11:55:59 +0000 (19:55 +0800)]
Hide code related setting options in repository when code unit is disabled (#28631)

Since #20805, code can be hidden.
However, the related settings are still shown even though they don't
have any meaning then.

https://github.com/go-gitea/gitea/assets/81045/5fdee54d-ac81-418a-82f7-eadff048cedd

9 months agoAdd -F to commit search to treat keywords as strings (#28744)
Mihir Joshi [Wed, 10 Jan 2024 11:28:20 +0000 (16:58 +0530)]
Add -F to commit search to treat keywords as strings (#28744)

Fixes #28269

The [default
behavior](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp)
of --grep in git log is to interpret the keyword as a regular
expression. This causes the search to fail in the cases where the search
keyword contains a `[`, since `[` is a special character used in grep.

If we want our keywords to be interpreted as 'strings', we should use
[-F
flag](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp).

9 months agoRecommend/convert to use case-sensitive collation for MySQL/MSSQL (#28662)
wxiaoguang [Wed, 10 Jan 2024 11:03:23 +0000 (19:03 +0800)]
Recommend/convert to use case-sensitive collation for MySQL/MSSQL (#28662)

Mainly for MySQL/MSSQL.

It is important for Gitea to use case-sensitive database charset
collation. If the database is using a case-insensitive collation, Gitea
will show startup error/warning messages, and show the errors/warnings
on the admin panel's Self-Check page.

Make `gitea doctor convert` work for MySQL to convert the collations of
database & tables & columns.

* Fix #28131

## :warning: BREAKING :warning:

It is not quite breaking, but it's highly recommended to convert the
database&table&column to a consistent and case-sensitive collation.

9 months agoAdd download attribute to release attachments (#28739)
JakobDev [Tue, 9 Jan 2024 08:51:20 +0000 (09:51 +0100)]
Add download attribute to release attachments (#28739)

Fixes #28736

9 months agoConcatenate error in `checkIfPRContentChanged` (#28731)
Earl Warren [Tue, 9 Jan 2024 02:32:14 +0000 (03:32 +0100)]
Concatenate error in `checkIfPRContentChanged` (#28731)

- If there's a error with the Git command in `checkIfPRContentChanged`
the stderr wasn't concatendated to the error, which results in still not
knowing why an error happend.
- Adds concatenation for stderr to the returned error.
- Ref: https://codeberg.org/forgejo/forgejo/issues/2077

Co-authored-by: Gusted <postmaster@gusted.xyz>
9 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 8 Jan 2024 00:26:06 +0000 (00:26 +0000)]
[skip ci] Updated licenses and gitignores

9 months agoMove the captcha script loader to the template which really needs it (#28718)
wxiaoguang [Sun, 7 Jan 2024 15:41:46 +0000 (23:41 +0800)]
Move the captcha script loader to the template which really needs it (#28718)

It improves the maintainability for the templates.

Now `base/footer.tmpl` doesn't need to depend on "captcha" feature.

9 months agoSuggest to use Type=simple for systemd service (#28717)
wxiaoguang [Sun, 7 Jan 2024 15:18:04 +0000 (23:18 +0800)]
Suggest to use Type=simple for systemd service (#28717)

Although the systemd notify support was added, it seems that there are
some problems (#28553, for the "non-installed" instance)

9 months agoFix incorrect URL for "Reference in New Issue" (#28716)
wxiaoguang [Sun, 7 Jan 2024 10:50:03 +0000 (18:50 +0800)]
Fix incorrect URL for "Reference in New Issue" (#28716)

Gitea prefers to use relative URLs in code (to make multiple domain work
for some users)

So it needs to use `toAbsoluteUrl` to generate a full URL when click
"Reference in New Issues"

And add some comments in the test code

9 months agoAvoid unnecessary 500 panic when a commit doesn't exist (#28719)
wxiaoguang [Sun, 7 Jan 2024 10:20:22 +0000 (18:20 +0800)]
Avoid unnecessary 500 panic when a commit doesn't exist (#28719)

In #26851, it assumed that `Commit` always exists when
`PageIsDiff==true`.

But for a 404 page, the `Commit` doesn't exist, so the following code
would cause panic because nil value can't be passed as string parameter
to `IsMultilineCommitMessage(string)` (or the StringUtils.Cut in later
PRs)

9 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 7 Jan 2024 00:27:22 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

9 months agoImprove frontend guideline (#28711)
wxiaoguang [Sat, 6 Jan 2024 17:14:10 +0000 (01:14 +0800)]
Improve frontend guideline (#28711)

It has been a consensus for long time during reviewing: "avoiding inline
styles as much as possible".

9 months agoFix panic when parsing empty pgsql host (#28708)
wxiaoguang [Sat, 6 Jan 2024 09:30:03 +0000 (17:30 +0800)]
Fix panic when parsing empty pgsql host (#28708)

Regression of #27723
Fix #28705

9 months agoAdd merge arrow direction and update styling (#28523)
Kyle D [Fri, 5 Jan 2024 17:38:56 +0000 (09:38 -0800)]
Add merge arrow direction and update styling (#28523)

Close https://github.com/go-gitea/gitea/issues/28522

~Adds some [negative
margin](https://tailwindcss.com/docs/margin#using-negative-values)
helper css classes using tailwind's [prefix
syntax](https://tailwindcss.com/docs/configuration#prefix)~

### Before

![image](https://github.com/go-gitea/gitea/assets/12700993/5bdabf91-facd-41c8-8e36-e1535beb9409)

### After

![image](https://github.com/go-gitea/gitea/assets/12700993/a6f11f6f-9e64-45b6-b9d7-dfea53fbc6d7)

9 months agoAdd links to owner home page in explore (#28341)
yp05327 [Fri, 5 Jan 2024 03:34:35 +0000 (11:34 +0800)]
Add links to owner home page in explore (#28341)

User can select access repo or owner's home page.

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/f40a833f-8560-4585-b047-3a225be2e6ee)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/7893bf3a-5050-4bcb-af99-d56d6c7925f8)

9 months agoApply min-height in wiki only on preview pane (#28687)
Earl Warren [Thu, 4 Jan 2024 02:48:55 +0000 (03:48 +0100)]
Apply min-height in wiki only on preview pane (#28687)

In the commit 5a56f9699c (3.) the min-height was applied to all wiki
elements. This resulted in huge blank spaces when viewing the wiki.

This fixes this by only applying the min-height to the preview when
editing.

Refs: https://codeberg.org/forgejo/forgejo/pulls/2080

(cherry picked from commit 8f0baefe5dadc929fe7456c36c8b205e96f228f0)

Co-authored-by: Fl1tzi <git@fl1tzi.com>
9 months agoNormalize oauth email username (#28561)
Kyle D [Thu, 4 Jan 2024 00:48:20 +0000 (16:48 -0800)]
Normalize oauth email username (#28561)

9 months agoFix wrapping of label list (#28684)
Denys Konovalov [Wed, 3 Jan 2024 12:33:55 +0000 (13:33 +0100)]
Fix wrapping of label list (#28684)

The label list needs to wrap the items to avoid unnecessary overflow / incorrect text wrapping.

9 months agoFix grammar in `actions.variables.id_not_exist` (en-US) (#28680)
wackbyte [Wed, 3 Jan 2024 10:43:38 +0000 (05:43 -0500)]
Fix grammar in `actions.variables.id_not_exist` (en-US) (#28680)

Fixes the capitalization and grammar of the key.

9 months agoFix grammar issues on the repository Actions page (en-US) (#28679)
wackbyte [Wed, 3 Jan 2024 10:42:56 +0000 (05:42 -0500)]
Fix grammar issues on the repository Actions page (en-US) (#28679)

Fixes a few grammar issues in the en-US localization of the repository
Actions page.

9 months agoFix tooltip of variable edit button (#28681)
wackbyte [Wed, 3 Jan 2024 06:25:19 +0000 (01:25 -0500)]
Fix tooltip of variable edit button (#28681)

The `variables.edit` key does not exist.

![image](https://github.com/go-gitea/gitea/assets/29505620/462a1c6c-775c-466a-8398-37115b2af47a)

9 months agoMake cross-reference issue links work in markdown documents again (#28682)
Brecht Van Lommel [Wed, 3 Jan 2024 06:01:12 +0000 (07:01 +0100)]
Make cross-reference issue links work in markdown documents again (#28682)

In #26365 issue references were disabled entirely for documents,
intending to match GitHub behavior. However cross-references do appear
to work in documents on GitHub.

This is useful for example to write release notes in a markdown document
and reference issues. While the simpler syntax may create links when not
intended, hopefully the cross-reference syntax is unique enough to avoid
it.

9 months agoMake template `DateTime` show proper tooltip (#28677)
wxiaoguang [Tue, 2 Jan 2024 19:09:18 +0000 (03:09 +0800)]
Make template `DateTime` show proper tooltip (#28677)

There was a question about "how to improve the datetime display for
SSH/PGP/WebAuthn"
https://github.com/go-gitea/gitea/pull/28262#issuecomment-1831141611

The root problem is that `DateTime` misses the "data-tooltip-content"
attribute, which should be used to make the tooltip popup smoothly.

Now the UI is consistent and the end users could see the detailed
hour/minute/second easily by hovering the element.

![image](https://github.com/go-gitea/gitea/assets/2114189/2211336f-d59d-4f64-a83b-099f8ef6d29b)

![image](https://github.com/go-gitea/gitea/assets/2114189/f02a9c86-476d-48d6-aece-85a800235fbd)

9 months agoAdd global setting how timestamps should be rendered (#28657)
Yarden Shoham [Tue, 2 Jan 2024 01:25:30 +0000 (03:25 +0200)]
Add global setting how timestamps should be rendered (#28657)

- Resolves https://github.com/go-gitea/gitea/issues/22493
- Related to https://github.com/go-gitea/gitea/issues/4520

Some admins prefer all timestamps to display the full date instead of
relative time. They can do that now by setting

```ini
[ui]
PREFERRED_TIMESTAMP_TENSE = absolute
```

This setting is set to `mixed` by default, allowing dates to render as
"5 hours ago". Here are some screenshots of the UI with this setting set
to `absolute`:

![image](https://github.com/go-gitea/gitea/assets/20454870/f496457f-6afa-44be-a1e7-249ee5fe0706)

![image](https://github.com/go-gitea/gitea/assets/20454870/c03b14f5-063d-4e13-9780-76ab002d76a9)

![image](https://github.com/go-gitea/gitea/assets/20454870/f4b34e28-1546-4374-9199-c43348844edd)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: delvh <dev.lh@web.de>
9 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 1 Jan 2024 00:27:55 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

9 months agoUpgrade xorm to new version which supported update join for all supported databases...
Lunny Xiao [Sun, 31 Dec 2023 05:00:35 +0000 (13:00 +0800)]
Upgrade xorm to new version which supported update join for all supported databases (#28590)

Fix https://github.com/go-gitea/gitea/pull/28547#issuecomment-1867740842

Since https://gitea.com/xorm/xorm/pulls/2383 merged, xorm now supports
UPDATE JOIN.
To keep consistent from different databases, xorm use
`engine.Join().Update`, but the actural generated SQL are different
between different databases.

For MySQL, it's `UPDATE talbe1 JOIN table2 ON join_conditions SET xxx
Where xxx`.

For MSSQL, it's `UPDATE table1 SET xxx FROM TABLE1, TABLE2 WHERE
join_conditions`.

For SQLITE per https://www.sqlite.org/lang_update.html, sqlite support
`UPDATE table1 SET xxx FROM table2 WHERE join conditions` from
3.33.0(2020-8-14).

POSTGRES is the same as SQLITE.

9 months agoFix: system webhooks API bug (#28531)
vincent [Sun, 31 Dec 2023 04:31:50 +0000 (12:31 +0800)]
Fix: system webhooks API bug (#28531)

- Fix the bug about admin/hooks API that `GET /admin/hooks` can only
fetch system_hooks, `POST /admin/hooks` can only create default_hooks.

9 months agoFix alpine package files are not rebuilt (#28638)
Nanguan Lin [Sun, 31 Dec 2023 04:08:46 +0000 (12:08 +0800)]
Fix alpine package files are not rebuilt (#28638)

I noticed the `BuildAllRepositoryFiles` function under the Alpine folder
is unused and I thought it was a bug.
But I'm not sure about this. Was it on purpose?

9 months agoFix migration test (#28659)
Lunny Xiao [Sat, 30 Dec 2023 13:54:48 +0000 (21:54 +0800)]
Fix migration test (#28659)

9 months agoAvoid cycle-redirecting user/login page (#28636)
wxiaoguang [Sat, 30 Dec 2023 08:48:34 +0000 (16:48 +0800)]
Avoid cycle-redirecting user/login page (#28636)

Fix #28231, and remove some unused code. The `db.HasEngine` doesn't seem
useful because the db engine is always initialized before web route.

9 months agoFix long package version names overflowing (#28619)
Mihir Joshi [Sat, 30 Dec 2023 07:42:16 +0000 (13:12 +0530)]
Fix long package version names overflowing (#28619)

Fixes #28534

---
Before:

![image](https://github.com/go-gitea/gitea/assets/50193156/b229551c-0a7d-4a99-9553-1f11b994876a)

After:
<img width="304" alt="image"
src="https://github.com/go-gitea/gitea/assets/50193156/53d04ad0-6d5c-47e2-8a7d-30a4d5dd9959">

Should we also apply this for long filenames in Assets?
It looks like this currently:
<img width="285" alt="image"
src="https://github.com/go-gitea/gitea/assets/50193156/e2dcbb2e-30d5-4e35-b304-6274ef60bda7">

---------

Co-authored-by: Mihir <mihir.joshi@senpiper.com>
9 months agoUpdate JS dependencies (#28537)
silverwind [Sat, 30 Dec 2023 05:29:03 +0000 (06:29 +0100)]
Update JS dependencies (#28537)

- Update all JS dependencies excluding mcaptcha (breaking changes) and
stylelint (plugin not compatible with v16)
- Regenerate SVGs
- Update markdownlint rule names
- Fix one issue of heading in markdown discovered during lint
- Update for monaco options renames
- Fix stylelint rule length-zero-no-unit for custom properties
- Tested editor, swagger, sorting, vue, lint

9 months agoImprove document for ARTIFACT_RETENTION_DAYS (#28646)
wxiaoguang [Fri, 29 Dec 2023 06:44:58 +0000 (14:44 +0800)]
Improve document for ARTIFACT_RETENTION_DAYS (#28646)

Follow #28626

9 months agofix empty ref for cron workflow runs (#28640)
Denys Konovalov [Fri, 29 Dec 2023 06:18:57 +0000 (07:18 +0100)]
fix empty ref for cron workflow runs (#28640)

Fix #27678
Please see
https://github.com/go-gitea/gitea/issues/27678#issuecomment-1871445853
for details.

9 months agoImprove 1.22 document for Database Preparation (#28643)
wxiaoguang [Fri, 29 Dec 2023 05:42:22 +0000 (13:42 +0800)]
Improve 1.22 document for Database Preparation (#28643)

Fix #28247

9 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 29 Dec 2023 00:20:25 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

9 months agoswitch destination directory for apt signing keys (#28639)
Denys Konovalov [Thu, 28 Dec 2023 21:08:59 +0000 (22:08 +0100)]
switch destination directory for apt signing keys (#28639)

According to [Debian
docs](https://wiki.debian.org/DebianRepository/UseThirdParty):

> The certificate MUST NOT be placed in /etc/apt/trusted.gpg.d or loaded
by apt-key add.
> ...
> If future updates to the certificate will be managed by an apt/dpkg
package as recommended below, then it SHOULD be downloaded into
/usr/share/keyrings using the same filename that will be provided by the
package. If it will be managed locally , it SHOULD be downloaded into
/etc/apt/keyrings instead.
> ...
> A sources.list entry SHOULD have the signed-by option set.

9 months agoExtend description for ARTIFACT_RETENTION_DAYS (#28626)
Gerd Katzenbeisser [Thu, 28 Dec 2023 10:11:44 +0000 (11:11 +0100)]
Extend description for ARTIFACT_RETENTION_DAYS (#28626)

Make it clear that this value is just a default value and that every
artifact can have it's own value.

9 months agoRefactor timeutil package (#28623)
wxiaoguang [Thu, 28 Dec 2023 10:09:57 +0000 (18:09 +0800)]
Refactor timeutil package (#28623)

1. make names more readable
2. remove unused FormatLong/FormatShort
3. use `FormatDate` instead of `Format "2006-01-02"`

9 months agoRefactor some legacy code and remove unused code (#28622)
wxiaoguang [Thu, 28 Dec 2023 09:38:59 +0000 (17:38 +0800)]
Refactor some legacy code and remove unused code (#28622)

1. use slices.Contains, remove Int64sContains
2. use HashEmail, remove base.EncodeMD5
3. remove BasicAuthEncode, IsLetter

9 months agoRemove unnecessary syncbranchToDB with tests (#28624)
Lunny Xiao [Thu, 28 Dec 2023 07:28:57 +0000 (15:28 +0800)]
Remove unnecessary syncbranchToDB with tests (#28624)

#28361 introduced `syncBranchToDB` in `CreateNewBranchFromCommit`. This
PR will revert the change because it's unnecessary. Every push will
already be checked by `syncBranchToDB`.
This PR also created a test to ensure it's right.

9 months agoDo not set `Accept` header twice (#28598)
KN4CK3R [Thu, 28 Dec 2023 03:59:00 +0000 (04:59 +0100)]
Do not set `Accept` header twice (#28598)

Revert #28550

Don't add the `Accept` header twice.

9 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 28 Dec 2023 00:24:21 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

9 months agofix wrong link in user and organization profile when using relative url (#28617)
katsu [Wed, 27 Dec 2023 08:32:27 +0000 (16:32 +0800)]
fix wrong link in user and organization profile when using relative url (#28617)

fix #28436.
the doc https://docs.gitea.com/usage/profile-readme maybe also need to
be updated to tell that
the main branch is necessary,which means the following three conditions
should be satisfied:
- repo: **.profile**
- branch: **[default branch]**
- markdown: **README.md**

9 months agoAdd get actions runner registration token for API routes, repo, org, user and global...
Lunny Xiao [Wed, 27 Dec 2023 07:57:54 +0000 (15:57 +0800)]
Add get actions runner registration token for API routes, repo, org, user and global level (#27144)

Replace #23761

---------

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
9 months agoFix session key conflict with database keyword (#28613)
Lunny Xiao [Wed, 27 Dec 2023 07:24:23 +0000 (15:24 +0800)]
Fix session key conflict with database keyword (#28613)

This is a regression from #28220 .
`builder.Cond` will not add `` ` `` automatically but xorm method
`Get/Find` adds `` ` ``.

This PR also adds tests to prevent the method from being implemented
incorrectly. The tests are added in `integrations` to test every
database.

9 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 27 Dec 2023 00:23:45 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

9 months agoUse known issue IID to generate new PR index number when migrating from GitLab (...
wxiaoguang [Tue, 26 Dec 2023 17:57:25 +0000 (01:57 +0800)]
Use known issue IID to generate new PR index number when migrating from GitLab (#28616)

Fix #13884

9 months agoUpdate repo-mirror.en-us.md (#28612)
Volodymyr Stelmashchuk [Tue, 26 Dec 2023 16:36:11 +0000 (18:36 +0200)]
Update repo-mirror.en-us.md (#28612)

Add small changes to the doc. The workflow scope require for push code
to github mirror in case the project use the github action compatibility
ui.

9 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 26 Dec 2023 00:24:05 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

9 months agoRefactor deletion (#28610)
delvh [Mon, 25 Dec 2023 20:25:29 +0000 (21:25 +0100)]
Refactor deletion (#28610)

Introduce the new generic deletion methods
- `func DeleteByID[T any](ctx context.Context, id int64) (int64, error)`
- `func DeleteByIDs[T any](ctx context.Context, ids ...int64) error`
- `func Delete[T any](ctx context.Context, opts FindOptions) (int64,
error)`

So, we no longer need any specific deletion method and can just use
the generic ones instead.

Replacement of #28450

Closes #28450

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
9 months agoRefactor CORS handler (#28587)
wxiaoguang [Mon, 25 Dec 2023 12:13:18 +0000 (20:13 +0800)]
Refactor CORS handler (#28587)

The CORS code has been unmaintained for long time, and the behavior is
not correct.

This PR tries to improve it. The key point is written as comment in
code. And add more tests.

Fix #28515
Fix #27642
Fix #17098

9 months agoAdded instance-level variables (#28115)
Jean-Baptiste Gomond [Mon, 25 Dec 2023 07:28:59 +0000 (08:28 +0100)]
Added instance-level variables (#28115)

This PR adds instance-level variables, and so closes #27726

![gitea_instance_variables_1](https://github.com/go-gitea/gitea/assets/8344487/ad409cd4-ce36-4c84-a764-34451b0fb63a)

![gitea_instance_variables_2](https://github.com/go-gitea/gitea/assets/8344487/426f0965-dec6-4560-948c-067cdeddd720)

![gitea_instance_variables_3](https://github.com/go-gitea/gitea/assets/8344487/cf1d7776-4938-4825-922e-cbbbf28a5f33)

9 months agoRevert "improve possible performance bottleneck (#28547)" (#28593)
Lunny Xiao [Mon, 25 Dec 2023 06:52:17 +0000 (14:52 +0800)]
Revert "improve possible performance bottleneck (#28547)" (#28593)

This reverts commit b35d3fddfac389a7be401a63b4e1283dd74af681.

This is totally wrong. I think `Update join` hasn't been supported well
by xorm.

I just revert the PR and will try to send another one.