]> source.dussan.org Git - gitea.git/log
gitea.git
13 days agoUpgrade some dependencies include minio-go (#32166)
Lunny Xiao [Thu, 3 Oct 2024 02:08:06 +0000 (19:08 -0700)]
Upgrade some dependencies include minio-go (#32166)

backport #32156

Co-authored-by: Manuel Valls Fernández <manuel@valls.dev>
2 weeks agoEnsure `GetCSRF` doesn't return an empty token (#32130) (#32157)
Giteabot [Tue, 1 Oct 2024 05:27:37 +0000 (13:27 +0800)]
Ensure `GetCSRF` doesn't return an empty token (#32130) (#32157)

Backport #32130 by @wolfogre

Since page templates keep changing, some pages that contained forms with
CSRF token no longer have them.

It leads to some calls of `GetCSRF` returning an empty string, which
fails the tests. Like

https://github.com/go-gitea/gitea/blob/3269b04d61ffe6a7ce462cd05ee150e4491124e8/tests/integration/attachment_test.go#L62-L63

The test did try to get the CSRF token and provided it, but it was
empty.

Co-authored-by: Jason Song <i@wolfogre.com>
2 weeks agoFix the logic of finding the latest pull review commit ID (#32139) (#32165)
Giteabot [Tue, 1 Oct 2024 04:10:03 +0000 (12:10 +0800)]
Fix the logic of finding the latest pull review commit ID (#32139) (#32165)

Backport #32139 by @Zettat123

Fix #31423

Co-authored-by: Zettat123 <zettat123@gmail.com>
2 weeks agoDon't join repository when loading action table data (#32127) (#32143)
Lunny Xiao [Mon, 30 Sep 2024 03:04:08 +0000 (11:04 +0800)]
Don't join repository when loading action table data (#32127) (#32143)

backport #32127

3 weeks agoFix wrong status of `Set up Job` when first step is skipped (#32120) (#32125) 32164/head
Giteabot [Wed, 25 Sep 2024 02:19:35 +0000 (10:19 +0800)]
Fix wrong status of `Set up Job` when first step is skipped (#32120) (#32125)

Backport #32120 by @yp05327

Fix #32089

Co-authored-by: yp05327 <576951401@qq.com>
3 weeks agoFix bug in getting merged pull request by commit (#32079) (#32117)
Zettat123 [Tue, 24 Sep 2024 16:12:02 +0000 (00:12 +0800)]
Fix bug in getting merged pull request by commit (#32079) (#32117)

Backport #32079

Fix #32027

3 weeks agoFix bug when deleting a migrated branch (#32075) (#32123)
Giteabot [Tue, 24 Sep 2024 09:01:05 +0000 (17:01 +0800)]
Fix bug when deleting a migrated branch (#32075) (#32123)

Backport #32075 by @lunny

After migrating a repository with pull request, the branch is missed and
after the pull request merged, the branch cannot be deleted.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 weeks agoInclude collaboration repositories on dashboard source/forks/mirrors list (#31946...
Giteabot [Tue, 24 Sep 2024 07:17:30 +0000 (15:17 +0800)]
Include collaboration repositories on dashboard source/forks/mirrors list (#31946) (#32122)

Backport #31946 by @lunny

Fix #13489

In the original implementation, only `All` will display your owned and
collaborated repositories. For other filters like `Source`, `Mirrors`
and etc. will only display your owned repositories.

This PR removed the limitations. Now except `collbrations`, other
filters will always display your owned and collaborated repositories.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 weeks agoTruncate commit message during Discord webhook push events (#31970) (#32121)
Giteabot [Tue, 24 Sep 2024 05:28:01 +0000 (13:28 +0800)]
Truncate commit message during Discord webhook push events (#31970) (#32121)

Backport #31970 by @kemzeb

Resolves #31668.

Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
3 weeks agoAllow set branch protection in an empty repository (#32095) (#32119)
Giteabot [Tue, 24 Sep 2024 02:42:52 +0000 (10:42 +0800)]
Allow set branch protection in an empty repository (#32095) (#32119)

Backport #32095 by @lunny

Resolve #32093

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 weeks agoFix panic when cloning with wrong ssh format. (#32076) (#32118)
Giteabot [Tue, 24 Sep 2024 01:58:58 +0000 (09:58 +0800)]
Fix panic when cloning with wrong ssh format. (#32076) (#32118)

Backport #32076 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 weeks agoFix Bug in Issue/pulls list (#32081) (#32115)
Giteabot [Tue, 24 Sep 2024 01:26:10 +0000 (09:26 +0800)]
Fix Bug in Issue/pulls list (#32081) (#32115)

3 weeks agouse rebuilt mssql-2017 image (#32109) (#32114)
Giteabot [Mon, 23 Sep 2024 21:23:04 +0000 (05:23 +0800)]
use rebuilt mssql-2017 image (#32109) (#32114)

Backport #32109 by @techknowlogick

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
3 weeks agoFix rename branch permission bug (#32066) (#32108)
Giteabot [Sun, 22 Sep 2024 19:43:13 +0000 (03:43 +0800)]
Fix rename branch permission bug (#32066) (#32108)

Backport #32066 by @lunny

The previous implementation requires admin permission to rename branches
which should be write permission.

Fix #31993

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 weeks agoFix wrong last modify time (#32102) (#32104)
Giteabot [Sun, 22 Sep 2024 19:12:57 +0000 (03:12 +0800)]
Fix wrong last modify time (#32102) (#32104)

Backport #32102 by @lunny

Fix #31930 and more places which use `http.TimeFormat` wrongly.
`http.TimeFormat` requires a UTC time. refer to
https://pkg.go.dev/net/http#TimeFormat

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 weeks agoAdd bin to Composer Metadata (#32099) (#32106)
Giteabot [Sun, 22 Sep 2024 18:42:02 +0000 (02:42 +0800)]
Add bin to Composer Metadata (#32099) (#32106)

Backport #32099 by @maantje

This PR addresses the missing `bin` field in Composer metadata, which
currently causes vendor-provided binaries to not be symlinked to
`vendor/bin` during installation.

In the current implementation, running `composer install` does not
publish the binaries, leading to issues where expected binaries are not
available.

By properly declaring the `bin` field, this PR ensures that binaries are
correctly symlinked upon installation, as described in the [Composer
documentation](https://getcomposer.org/doc/articles/vendor-binaries.md).

Co-authored-by: Jamie Schouten <j4mie@hey.com>
3 weeks agoFix incorrect `/tokens` api (#32085) (#32092)
Giteabot [Sun, 22 Sep 2024 18:02:09 +0000 (02:02 +0800)]
Fix incorrect `/tokens` api (#32085) (#32092)

Backport #32085 by @KN4CK3R

Fixes #32078

- Add missing scopes output.
- Disallow empty scope.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
3 weeks agoFix mssql ci with a new mssql version on ci (#32094)
Lunny Xiao [Sun, 22 Sep 2024 17:32:26 +0000 (01:32 +0800)]
Fix mssql ci with a new mssql version on ci (#32094)

backport from https://github.com/go-gitea/gitea/pull/32060

3 weeks agoFix: database not update release when using `git push --tags --force` (#32040) (...
Giteabot [Wed, 18 Sep 2024 23:57:28 +0000 (07:57 +0800)]
Fix: database not update release when using `git push --tags --force` (#32040) (#32074)

Backport #32040 by @ExplodingDragon

link: https://codeberg.org/forgejo/forgejo/issues/4274
Co-authored-by: Exploding Dragon <explodingfkl@gmail.com>
3 weeks agoRefactor CSRF protector (#32057) (#32069)
wxiaoguang [Wed, 18 Sep 2024 17:02:45 +0000 (01:02 +0800)]
Refactor CSRF protector (#32057) (#32069)

#32057 improves the CSRF handling and is worth to backport

4 weeks agoAdd missing comment reply handling (#32050) (#32065)
Giteabot [Wed, 18 Sep 2024 09:23:28 +0000 (17:23 +0800)]
Add missing comment reply handling (#32050) (#32065)

Backport #32050 by @KN4CK3R

Fixes #31937

- Add missing comment reply handling
- Use `onGiteaRun` in the test because the fixtures are not present
otherwise (did this behaviour change?)

Compare without whitespaces.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
4 weeks agoLazy load avatar images (#32051) (#32063)
Giteabot [Wed, 18 Sep 2024 08:52:44 +0000 (16:52 +0800)]
Lazy load avatar images (#32051) (#32063)

Backport #32051 by @hiifong

Before:

https://github.com/user-attachments/assets/7b1681ba-4781-432a-ae20-c07e94c1dbb6

After:

https://github.com/user-attachments/assets/5154e160-e22c-460e-b0d9-28768486c178

Co-authored-by: hiifong <i@hiif.ong>
4 weeks agoHandle invalid target when creating releases using API (#31841) (#32043)
Giteabot [Tue, 17 Sep 2024 02:23:40 +0000 (10:23 +0800)]
Handle invalid target when creating releases using API (#31841) (#32043)

Backport #31841 by @kemzeb

A 500 status code was thrown when passing a non-existent target to the
create release API. This snapshot handles this error and instead throws
a 404 status code.

Discovered while working on #31840.

Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
4 weeks agoDo not escape relative path in RPM primary index (#32038) (#32054)
Giteabot [Tue, 17 Sep 2024 00:19:35 +0000 (08:19 +0800)]
Do not escape relative path in RPM primary index (#32038) (#32054)

Backport #32038 by @KN4CK3R

Fixes #32021

Do not escape the relative path.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
4 weeks agoCheck if the `due_date` is nil when editing issues (#32035) (#32042)
Giteabot [Sat, 14 Sep 2024 17:31:34 +0000 (01:31 +0800)]
Check if the `due_date` is nil when editing issues (#32035) (#32042)

Backport #32035 by @Zettat123

Fix #32030

Co-authored-by: Zettat123 <zettat123@gmail.com>
4 weeks agoFix container parallel upload bugs (#32022)
Lunny Xiao [Thu, 12 Sep 2024 03:11:03 +0000 (11:11 +0800)]
Fix container parallel upload bugs (#32022)

This PR should be replaced by #31860 in v1.23. The aim of creating this
PR is to fix it in 1.22 because globallock hasn't been introduced.

Fix #27640
Fix #29563
Fix #31215

4 weeks agoFix `/repos/{owner}/{repo}/pulls/{index}/files` endpoint not populating `previous_fil...
Giteabot [Wed, 11 Sep 2024 23:58:43 +0000 (07:58 +0800)]
Fix `/repos/{owner}/{repo}/pulls/{index}/files` endpoint not populating `previous_filename` (#32017) (#32028)

Backport #32017 by @charles-plutohealth

---
`status == "rename"` should have read `status == "renamed"`. The typo
means that file.PreviousFilename would never be populated, which e.g.
breaks usage of the Github Action at
https://github.com/dorny/paths-filter.

Co-authored-by: charles-plutohealth <143208583+charles-plutohealth@users.noreply.github.com>
5 weeks agoSupport allowed hosts for migrations to work with proxy (#32025) (#32026)
Giteabot [Wed, 11 Sep 2024 06:54:19 +0000 (14:54 +0800)]
Support allowed hosts for migrations to work with proxy (#32025) (#32026)

Backport #32025 by @wolfogre

Fix #32024. Follow #27655.

After this PR, all usage of "new dial context" needs to provide a proxy,
so I dropped the old `NewDialContext` and renamed
`NewDialContextWithProxy` to `NewDialContext`.

Co-authored-by: Jason Song <i@wolfogre.com>
5 weeks agoIncrease `cacheContextLifetime` to reduce false reports (#32011) (#32023)
Giteabot [Wed, 11 Sep 2024 03:14:40 +0000 (11:14 +0800)]
Increase `cacheContextLifetime` to reduce false reports (#32011) (#32023)

Backport #32011 by @wolfogre

Replace #32001.

To prevent the context cache from being misused for long-term work
(which would result in using invalid cache without awareness), the
context cache is designed to exist for a maximum of 10 seconds. This
leads to many false reports, especially in the case of slow SQL.

This PR increases it to 5 minutes to reduce false reports.

5 minutes is not a very safe value, as a lot of changes may have
occurred within that time frame. However, as far as I know, there has
not been a case of misuse of context cache discovered so far, so I think
5 minutes should be OK.

Please note that after this PR, if warning logs are found again, it
should get attention, at that time it can be almost 100% certain that it
is a misuse.

Co-authored-by: Jason Song <i@wolfogre.com>
5 weeks agoUpgrade cache to v0.2.1 (#32003) (#32009)
Lunny Xiao [Sat, 7 Sep 2024 21:44:28 +0000 (05:44 +0800)]
Upgrade cache to v0.2.1 (#32003) (#32009)

Fix #31757
Backport #32003

5 weeks agoUse forum.gitea.com instead of old URL (#31989) (#31992)
Giteabot [Fri, 6 Sep 2024 19:47:23 +0000 (03:47 +0800)]
Use forum.gitea.com instead of old URL (#31989) (#31992)

Backport #31989 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
5 weeks agoAdd changelog for 1.22.2 (#31935) v1.22.2
Lunny Xiao [Thu, 5 Sep 2024 16:16:54 +0000 (00:16 +0800)]
Add changelog for 1.22.2 (#31935)

5 weeks agoFix nuget/conan/container packages upload bugs (#31967) (#31982)
Giteabot [Thu, 5 Sep 2024 07:34:41 +0000 (15:34 +0800)]
Fix nuget/conan/container packages upload bugs (#31967) (#31982)

Backport #31967 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
5 weeks agoReplace v-html with v-text in search inputbox (#31966) (#31973) (#31975)
Lunny Xiao [Thu, 5 Sep 2024 01:59:57 +0000 (09:59 +0800)]
Replace v-html with v-text in search inputbox (#31966) (#31973) (#31975)

Backport #31966, #31973
Cherry-pick 30da734f37f0bd60d13044374c1d5af54f2eb416,
74b1c589c6c1a4261556e1a1a868bbcb2964a5d3
Replace #31972

---------

Co-authored-by: techknowlogick <techknowlogick@noreply.gitea.com>
6 weeks agoAdd lock for parallel maven upload (#31954)
Lunny Xiao [Tue, 3 Sep 2024 06:33:28 +0000 (14:33 +0800)]
Add lock for parallel maven upload (#31954)

Backport #31851
Fix #30171

6 weeks agoFix index too many file names bug (#31903) (#31953)
Lunny Xiao [Tue, 3 Sep 2024 01:15:30 +0000 (09:15 +0800)]
Fix index too many file names bug (#31903) (#31953)

Try to fix #31884
Fix #28584
Backport #31903

6 weeks agoPrevent update pull refs manually and will not affect other refs update (#31931)...
Giteabot [Mon, 2 Sep 2024 10:28:00 +0000 (18:28 +0800)]
Prevent update pull refs manually and will not affect other refs update (#31931) (#31955)

Backport #31931 by @lunny

All refs under `refs/pull` should only be changed from Gitea inside but
not by pushing from outside of Gitea.
This PR will prevent the pull refs update but allow other refs to be
updated on the same pushing with `--mirror` operations.

The main changes are to add checks on `update` hook but not
`pre-receive` because `update` will be invoked by every ref but
`pre-receive` will revert all changes once one ref update fails.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
6 weeks agoFix sort order for organization home and user profile page (#31921) (#31922)
yp05327 [Mon, 2 Sep 2024 07:58:18 +0000 (16:58 +0900)]
Fix sort order for organization home and user profile page (#31921) (#31922)

Backport #31921

6 weeks agoFix 500 error when `state` params is set when editing issue/PR by API (#31880) (...
Giteabot [Sun, 1 Sep 2024 18:38:10 +0000 (02:38 +0800)]
Fix 500 error when `state` params is set when editing issue/PR by API (#31880) (#31952)

Backport #31880 by @yp05327

A quick fix for #31871

Co-authored-by: yp05327 <576951401@qq.com>
6 weeks agoUpgrade micromatch to 4.0.8 (#31944)
Lunny Xiao [Fri, 30 Aug 2024 02:36:49 +0000 (10:36 +0800)]
Upgrade micromatch to 4.0.8 (#31944)

backport #31939

6 weeks agoUpdate webpack to 5.94.0 (#31941)
silverwind [Thu, 29 Aug 2024 16:10:25 +0000 (18:10 +0200)]
Update webpack to 5.94.0 (#31941)

Update webpack on v1.22 branch because of
https://github.com/go-gitea/gitea/security/dependabot/70.

6 weeks agoFix search team (#31923) (#31942)
Giteabot [Thu, 29 Aug 2024 16:05:21 +0000 (00:05 +0800)]
Fix search team (#31923) (#31942)

Backport #31923 by @lunny

Fix #20658

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
7 weeks agoRemove "dsa-1024" testcases from Test_SSHParsePublicKey and Test_calcFingerprint...
Giteabot [Sun, 25 Aug 2024 12:39:00 +0000 (20:39 +0800)]
Remove "dsa-1024" testcases from Test_SSHParsePublicKey and Test_calcFingerprint (#31905) (#31914)

Backport #31905 by @s4uliu5

DSA is considered inherently insecure and is already disabled/removed in
OpenSSH 9.8.

Therefore "dsa-1024" tescases are failing.

```
--- FAIL: Test_calcFingerprint (0.02s)
    --- FAIL: Test_calcFingerprint/dsa-1024 (0.00s)
        --- FAIL: Test_calcFingerprint/dsa-1024/SSHKeygen (0.00s)
            ssh_key_test.go:196:
                        Error Trace:    /src/gitea/models/asymkey/ssh_key_test.go:196
                        Error:          Received unexpected error:
                                        Unable to verify key content [result: /tmp/gitea_keytest1239408114 is not a public key file.
                                        ]
                        Test:           Test_calcFingerprint/dsa-1024/SSHKeygen
            ssh_key_test.go:197:
                        Error Trace:    /src/gitea/models/asymkey/ssh_key_test.go:197
                        Error:          Not equal:
                                        expected: "SHA256:fSIHQlpKMDsGPVAXI8BPYfRp+e2sfvSt1sMrPsFiXrc"
                                        actual  : ""

                                        Diff:
                                        --- Expected
                                        +++ Actual
                                        @@ -1 +1 @@
                                        -SHA256:fSIHQlpKMDsGPVAXI8BPYfRp+e2sfvSt1sMrPsFiXrc
                                        +
                        Test:           Test_calcFingerprint/dsa-1024/SSHKeygen
FAIL
```

Fix #31624

Co-authored-by: Saulius Gurklys <s4uliu5@gmail.com>
7 weeks agoDon't return 500 if mirror url contains special chars (#31859) (#31895)
Lunny Xiao [Wed, 21 Aug 2024 16:10:50 +0000 (00:10 +0800)]
Don't return 500 if mirror url contains special chars (#31859) (#31895)

Backport #31859

8 weeks agoUpgrade bleve to 2.4.2 (#31894)
Lunny Xiao [Wed, 21 Aug 2024 05:13:59 +0000 (13:13 +0800)]
Upgrade bleve to 2.4.2 (#31894)

backport #31762

8 weeks agobug fix for translation in ru (#31892)
Lunny Xiao [Wed, 21 Aug 2024 02:01:36 +0000 (10:01 +0800)]
bug fix for translation in ru (#31892)

Fix #31891

8 weeks agoRefactor the usage of batch catfile (#31754) (#31889)
Giteabot [Tue, 20 Aug 2024 17:55:14 +0000 (01:55 +0800)]
Refactor the usage of batch catfile (#31754) (#31889)

Backport #31754 by @lunny

When opening a repository, it will call `ensureValidRepository` and also
`CatFileBatch`. But sometimes these will not be used until repository
closed. So it's a waste of CPU to invoke 3 times git command for every
open repository.

This PR removed all of these from `OpenRepository` but only kept
checking whether the folder exists. When a batch is necessary, the
necessary functions will be invoked.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
8 weeks agoFix agit automerge (#31207) (#31881)
Giteabot [Tue, 20 Aug 2024 16:20:58 +0000 (00:20 +0800)]
Fix agit automerge (#31207) (#31881)

Backport #31207 by @lunny

Fix #31134

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
8 weeks agoadd CfTurnstileSitekey context data to all captcha templates (#31874) (#31876)
Giteabot [Tue, 20 Aug 2024 14:45:08 +0000 (22:45 +0800)]
add CfTurnstileSitekey context data to all captcha templates (#31874) (#31876)

Backport #31874 by @bohde

In the OpenID flows, the "CfTurnstileSitekey" wasn't populated, which
caused those flows to fail if using Turnstile as the Captcha
implementation.

This adds the missing context variables, allowing Turnstile to be used
in the OpenID flows.

Co-authored-by: Rowan Bohde <rowan.bohde@gmail.com>
8 weeks agoFix actions notify bug (#31866) (#31875)
Giteabot [Mon, 19 Aug 2024 18:14:29 +0000 (02:14 +0800)]
Fix actions notify bug (#31866) (#31875)

Backport #31866 by @lunny

Try to fix
https://github.com/go-gitea/gitea/issues/31757#issuecomment-2295131062

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
8 weeks agofix the component of access token list not mounted (#31824) (#31868)
sillyguodong [Mon, 19 Aug 2024 16:56:17 +0000 (00:56 +0800)]
fix the component of access token list not mounted (#31824) (#31868)

8 weeks agoFix overflowing content in action run log (#31842) (#31853)
Giteabot [Sun, 18 Aug 2024 00:34:05 +0000 (08:34 +0800)]
Fix overflowing content in action run log (#31842) (#31853)

Backport #31842 by @Adrian-Hirt

When a long line with characters such as dots is returned by a step in
an action (e.g. by the output of the Ruby on Rails test runner), it
overflows the log container, causing the page to scroll sideways (see
first screenshot):

![before](https://github.com/user-attachments/assets/d71a8446-2c81-42d7-ad20-92514884365a)

This PR adds the CSS `overflow-wrap: anywhere;` to the
`.job-step-section .job-step-logs .job-log-line .log-msg` selector,
which causes such lines to wrap as well (see second screenshot in which
the line wraps nicely):

![after](https://github.com/user-attachments/assets/ba9abaec-dc0b-4fab-8129-b9341d4bf784)

Co-authored-by: Adrian Hirt <13788379+Adrian-Hirt@users.noreply.github.com>
8 weeks agoFix raw wiki links (#31825) (#31845)
Giteabot [Sat, 17 Aug 2024 03:19:26 +0000 (11:19 +0800)]
Fix raw wiki links (#31825) (#31845)

Backport #31825 by @Zettat123

Fix #31395

This regression is introduced by #30273. To find out how GitHub handles
this case, I did [some
tests](https://github.com/go-gitea/gitea/issues/31395#issuecomment-2278929115).

I use redirect in this PR instead of checking if the corresponding `.md`
file exists when rendering the link because GitHub also uses redirect.
With this PR, there is no need to resolve the raw wiki link when
rendering a wiki page. If a wiki link points to a raw file, access will
be redirected to the raw link.

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
8 weeks agoAvoid returning without written ctx when posting PR (#31843) (#31848)
Giteabot [Fri, 16 Aug 2024 17:50:12 +0000 (01:50 +0800)]
Avoid returning without written ctx when posting PR (#31843) (#31848)

Backport #31843 by @wolfogre

Fix #31625.

If `pull_service.NewPullRequest` return an error which misses each `if`
check, `CompareAndPullRequestPost` will return immediately, since it
doesn't write the HTTP response, a 200 response with empty body will be
sent to clients.

```go
if err := pull_service.NewPullRequest(ctx, repo, pullIssue, labelIDs, attachments, pullRequest, assigneeIDs); err != nil {
if repo_model.IsErrUserDoesNotHaveAccessToRepo(err) {
ctx.Error(http.StatusBadRequest, "UserDoesNotHaveAccessToRepo", err.Error())
} else if git.IsErrPushRejected(err) {
// ...
ctx.JSONError(flashError)
} else if errors.Is(err, user_model.ErrBlockedUser) {
// ...
ctx.JSONError(flashError)
} else if errors.Is(err, issues_model.ErrMustCollaborator) {
// ...
ctx.JSONError(flashError)
}
return
}
```

Not sure what kind of error can cause it to happen, so this PR just
expose it. And we can fix it when users report that creating PRs failed
with error responses.

It's all my guess since I cannot reproduce the problem, but even if it's
not related, the code here needs to be improved.

Co-authored-by: Jason Song <i@wolfogre.com>
2 months agoAdd missing repository type filter parameters to pager (#31832) (#31837)
Giteabot [Fri, 16 Aug 2024 12:41:45 +0000 (20:41 +0800)]
Add missing repository type filter parameters to pager  (#31832) (#31837)

Backport #31832 by @yp05327

Fix #31807

ps: the newly added params's value will be changed.
When the first time you selected the filter, the values of params will
be `0` or `1`
But in pager it will be `true` or `false`.
So do we have `boolToInt` function?

Co-authored-by: yp05327 <576951401@qq.com>
2 months agoFix panic of ssh public key page after deletion of auth source (#31829) (#31836)
Giteabot [Thu, 15 Aug 2024 17:50:57 +0000 (01:50 +0800)]
Fix panic of ssh public key page after deletion of auth source (#31829) (#31836)

Backport #31829 by @lunny

Fix #31730

This PR rewrote the function `PublicKeysAreExternallyManaged` with a
simple test. The new function removed the loop to make it more readable.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 months agoFixes for unreachable project issues when transfer repository from organization ...
Giteabot [Wed, 14 Aug 2024 01:57:23 +0000 (09:57 +0800)]
Fixes for unreachable project issues when transfer repository from organization (#31770) (#31828)

Backport #31770 by @emrebdr

When transferring repositories that have issues linked to a project
board to another organization, the issues remain associated with the
original project board. This causes the columns in the project board to
become bugged, making it difficult to move other issues in or out of the
affected columns. As a solution, I removed the issue relations since the
other organization does not have this project table.

Fix for #31538

Co-authored-by: Edip Emre Bodur <emrebdr29@gmail.com>
Co-authored-by: Jason Song <i@wolfogre.com>
2 months agoScroll images in project issues separately from the remaining issue (#31683) (#31823)
Giteabot [Tue, 13 Aug 2024 02:43:48 +0000 (10:43 +0800)]
Scroll images in project issues separately from the remaining issue (#31683) (#31823)

Backport #31683 by @SimonPistache

As discussed in #31667 & #26561, when a card on a Project contains
images, they can overflow the card on its containing column. This aims
to fix this issue via snapping scrollbars.

---
Issue #31667 is open to discussion as there should be room for
improvement.

Co-authored-by: Simon Priet <105607989+SimonPistache@users.noreply.github.com>
2 months agoAdd `:focus-visible` style to buttons (#31799) (#31819)
Giteabot [Mon, 12 Aug 2024 04:41:13 +0000 (12:41 +0800)]
Add `:focus-visible` style to buttons (#31799) (#31819)

Backport #31799 by @silverwind

Buttons now show a focus style via
[`:focus-visible`](https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible)
when the browser deems the focus to be important, like for example when
the button is focused via keyboard navigation.

<img width="492" alt="Screenshot 2024-08-07 at 22 12 51"
src="https://github.com/user-attachments/assets/060568b1-1599-4c56-bafb-b36ebb1bec35">
<img width="479" alt="image"
src="https://github.com/user-attachments/assets/885f4e10-f496-47f0-8ae5-45827ded09f8">

Co-authored-by: silverwind <me@silverwind.io>
2 months agoShow lock owner instead of repo owner on LFS setting page (#31788) (#31817)
Giteabot [Sun, 11 Aug 2024 15:17:34 +0000 (23:17 +0800)]
Show lock owner instead of repo owner on LFS setting page (#31788) (#31817)

Backport #31788 by @wolfogre

Fix #31784.

Before:

<img width="1648" alt="image"
src="https://github.com/user-attachments/assets/03f32545-4a85-42ed-bafc-2b193a5d8023">

After:

<img width="1653" alt="image"
src="https://github.com/user-attachments/assets/e5bcaf93-49cb-421f-aac1-5122bc488b02">

Co-authored-by: Jason Song <i@wolfogre.com>
2 months agofix(api): owner ID should be zero when created repo secret (#31715) (#31811)
Bo-Yi Wu [Fri, 9 Aug 2024 16:21:51 +0000 (00:21 +0800)]
fix(api): owner ID should be zero when created repo secret (#31715) (#31811)

- Change condition to include `RepoID` equal to 0 for organization
secrets

Backport https://github.com/go-gitea/gitea/pull/31715 by @appleboy

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2 months agoFix `IsObjectExist` with gogit (#31790) (#31806)
Giteabot [Fri, 9 Aug 2024 07:43:23 +0000 (15:43 +0800)]
Fix `IsObjectExist` with gogit (#31790) (#31806)

Backport #31790 by @wolfogre

Fix #31271.

When gogit is enabled, `IsObjectExist` calls
`repo.gogitRepo.ResolveRevision`, which is not correct. It's for
checking references not objects, it could work with commit hash since
it's both a valid reference and a commit object, but it doesn't work
with blob objects.

So it causes #31271 because it reports that all blob objects do not
exist.

Co-authored-by: Jason Song <i@wolfogre.com>
2 months agoFix protected branch files detection on pre_receive hook (#31778) (#31796)
Giteabot [Thu, 8 Aug 2024 03:08:30 +0000 (11:08 +0800)]
Fix protected branch files detection on pre_receive hook (#31778) (#31796)

Backport #31778 by @lunny

Fix #31738

When pushing a new branch, the old commit is zero. Most git commands
cannot recognize the zero commit id. To get the changed files in the
push, we need to get the first diverge commit of this branch. In most
situations, we could check commits one by one until one commit is
contained by another branch. Then we will think that commit is the
diverge point.

And in a pre-receive hook, this will be more difficult because all
commits haven't been merged and they actually stored in a temporary
place by git. So we need to bring some envs to let git know the commit
exist.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 months agoAdd `TAGS` to `TEST_TAGS` and fix bugs found with gogit (#31791) (#31795)
Giteabot [Wed, 7 Aug 2024 15:58:09 +0000 (23:58 +0800)]
Add `TAGS` to `TEST_TAGS` and fix bugs found with gogit (#31791) (#31795)

Backport #31791 by @wolfogre

Found at
https://github.com/go-gitea/gitea/pull/31790#issuecomment-2272898915

`unit-tests-gogit` never work since the workflow set `TAGS` with
`gogit`, but the Makefile use `TEST_TAGS`.

<img width="690" alt="image"
src="https://github.com/user-attachments/assets/fb68df49-952b-42b9-8438-44200cefff43">

![image](https://github.com/user-attachments/assets/78ff88c7-3b5f-4d50-9c58-e607bf7b1a71)

This PR adds the values of `TAGS` to `TEST_TAGS`, ensuring that setting
`TAGS` is always acceptable and avoiding confusion about which one
should be set.

After this PR:

<img width="714" alt="image"
src="https://github.com/user-attachments/assets/54cc7f38-d95b-4dbc-a87c-daba63462b86">

Co-authored-by: Jason Song <i@wolfogre.com>
2 months agoRename head branch of pull requests when renaming a branch (#31759) (#31774)
Giteabot [Sun, 4 Aug 2024 06:37:02 +0000 (14:37 +0800)]
Rename head branch of pull requests when renaming a branch (#31759) (#31774)

2 months agoFix wiki revision pagination (#31760) (#31772)
Giteabot [Sun, 4 Aug 2024 02:45:41 +0000 (10:45 +0800)]
Fix wiki revision pagination (#31760) (#31772)

Backport #31760 by @lunny

Fix #31755

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 months agoBackport: Fix dates displaying in a wrong manner when we're close to the end of…...
aceArt-GmbH [Thu, 1 Aug 2024 18:54:30 +0000 (20:54 +0200)]
Backport: Fix dates displaying in a wrong manner when we're close to the end of… (#31750)

… the month (31331)

Backport #31331

Fix #31197 on v1.22

Co-authored-by: lukas <lukas.walter@aceart.de>
2 months agobump vue-bar-graph (#31705) (#31753)
techknowlogick [Thu, 1 Aug 2024 18:34:32 +0000 (14:34 -0400)]
bump vue-bar-graph (#31705) (#31753)

backport vue-bar-graph bump to remove gsap dep

2 months agoDistinguish LFS object errors to ignore missing objects during migration (#31702...
Giteabot [Wed, 31 Jul 2024 15:06:37 +0000 (23:06 +0800)]
Distinguish LFS object errors to ignore missing objects during migration (#31702) (#31745)

Backport #31702 by @wolfogre

Fix #31137.

Replace #31623 #31697.

When migrating LFS objects, if there's any object that failed (like some
objects are losted, which is not really critical), Gitea will stop
migrating LFS immediately but treat the migration as successful.

This PR checks the error according to the [LFS api
doc](https://github.com/git-lfs/git-lfs/blob/main/docs/api/batch.md#successful-responses).

> LFS object error codes should match HTTP status codes where possible:
>
> - 404 - The object does not exist on the server.
> - 409 - The specified hash algorithm disagrees with the server's
acceptable options.
> - 410 - The object was removed by the owner.
> - 422 - Validation error.

If the error is `404`, it's safe to ignore it and continue migration.
Otherwise, stop the migration and mark it as failed to ensure data
integrity of LFS objects.

And maybe we should also ignore others errors (maybe `410`? I'm not sure
what's the difference between "does not exist" and "removed by the
owner".), we can add it later when some users report that they have
failed to migrate LFS because of an error which should be ignored.

Co-authored-by: Jason Song <i@wolfogre.com>
2 months agoFix the display of project type for deleted projects (#31732) (#31734)
Giteabot [Tue, 30 Jul 2024 06:05:14 +0000 (14:05 +0800)]
Fix the display of project type for deleted projects (#31732) (#31734)

Backport #31732 by @yp05327

Fix: #31727
After:

![image](https://github.com/user-attachments/assets/1dfb4b31-3bd6-47f7-b126-650f33f453e2)

Co-authored-by: yp05327 <576951401@qq.com>
2 months agoSet owner id to zero when GetRegistrationToken for repo (#31725) (#31729)
Giteabot [Tue, 30 Jul 2024 01:57:43 +0000 (09:57 +0800)]
Set owner id to zero when GetRegistrationToken for repo (#31725) (#31729)

Backport #31725 by @wolfogre

Fix #31707.

It's split from #31724.

Although #31724 could also fix #31707, it has change a lot so it's not a
good idea to backport it.

Co-authored-by: Jason Song <i@wolfogre.com>
2 months agoFix API endpoint for registration-token (#31722) (#31728)
Giteabot [Mon, 29 Jul 2024 18:15:07 +0000 (02:15 +0800)]
Fix API endpoint for registration-token (#31722) (#31728)

Backport #31722 by @wolfogre

Partially fix #31707. Related to #30656.

Co-authored-by: Jason Song <i@wolfogre.com>
2 months agoAdd permission check when creating PR (#31033) (#31720)
yp05327 [Mon, 29 Jul 2024 06:11:29 +0000 (15:11 +0900)]
Add permission check when creating PR (#31033) (#31720)

Backport #31033

user should be a collaborator of the base repo to create a PR

2 months agoMake GetRepositoryByName more safer (#31712) (#31718)
Giteabot [Mon, 29 Jul 2024 03:52:34 +0000 (11:52 +0800)]
Make GetRepositoryByName more safer (#31712) (#31718)

Backport #31712 by @lunny

Fix #31708

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 months agoFix "Filter by commit" Dropdown (#31695) (#31696)
wxiaoguang [Thu, 25 Jul 2024 01:44:34 +0000 (09:44 +0800)]
Fix "Filter by commit" Dropdown (#31695) (#31696)

A separate backport of #31695 for 1.22
Fix #31673

2 months agoProperly filter issue list given no assignees filter (#31522) (#31685)
Giteabot [Wed, 24 Jul 2024 07:55:21 +0000 (15:55 +0800)]
Properly filter issue list given no assignees filter (#31522) (#31685)

Backport #31522 by @kemzeb

Quick fix #31520. This issue is related to #31337.

Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
2 months agoEnable direnv (#31672) (#31679)
Giteabot [Tue, 23 Jul 2024 15:35:28 +0000 (23:35 +0800)]
Enable direnv (#31672) (#31679)

Backport #31672 by @techknowlogick

This lets developers who have direnv enabled to load our nix flake
automatically when entering it

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2 months agofix redis deps (#31662) (#31663)
techknowlogick [Fri, 19 Jul 2024 20:14:58 +0000 (16:14 -0400)]
fix redis deps (#31662) (#31663)

fix https://github.com/go-gitea/gitea/issues/31658

backports #31662

2 months agoFix a branch divergence cache bug (#31659) (#31661)
Giteabot [Fri, 19 Jul 2024 17:12:23 +0000 (01:12 +0800)]
Fix a branch divergence cache bug (#31659) (#31661)

Backport #31659 by @Zettat123

Fix #31599
Fix #31472

A branch divergence is counted based on the default branch. If the
default branch is updated, all divergence caches of the repo need to be
deleted.

Co-authored-by: Zettat123 <zettat123@gmail.com>
2 months agoRemove unneccessary uses of `word-break: break-all` (#31637) (#31652)
Giteabot [Thu, 18 Jul 2024 10:58:11 +0000 (18:58 +0800)]
Remove unneccessary uses of `word-break: break-all` (#31637) (#31652)

Backport #31637 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/31636
1. Issue sidebar topic is disussed in
https://github.com/go-gitea/gitea/issues/31636
2. Org description already has `overflow-wrap: anywhere` to ensure no
overflow.

Co-authored-by: silverwind <me@silverwind.io>
3 months agoFix: Allow org team names of length 255 in create team form (#31564) (#31603)
Giteabot [Wed, 10 Jul 2024 16:28:27 +0000 (00:28 +0800)]
Fix: Allow org team names of length 255 in create team form (#31564) (#31603)

Backport #31564 by @tobiasbp

Gitea 1.22.1 was supposed to allow for team names of length 255 (up from
30) after the following PR was merged in:
https://github.com/go-gitea/gitea/pull/31410. However, the length of
team names was still limited to 30 as described in this issue:
https://github.com/go-gitea/gitea/issues/31554.

One more change to _gitea_ needs to be made to allow for the longer team
names, as there is a 30 character limit here:
https://github.com/go-gitea/gitea/blob/2c92c7c5226e29636a1d47a277130f477fa2037b/services/forms/org.go#L65

This PR changes that value to 255.

Co-authored-by: Tobias Balle-Petersen <tobias.petersen@unity3d.com>
3 months agoUse old behavior for telegram webhook (#31588)
wxiaoguang [Tue, 9 Jul 2024 03:23:33 +0000 (11:23 +0800)]
Use old behavior for telegram webhook (#31588)

Fix #31182

3 months agoReturn an empty string when a repo has no avatar in the repo API (#31187) (#31567)
Jimmy Praet [Fri, 5 Jul 2024 12:40:45 +0000 (14:40 +0200)]
Return an empty string when a repo has no avatar in the repo API (#31187) (#31567)

Backport #31187

Resolves #31167.

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

Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 months agoFix slow patch checking with commits that add or remove many files (#31548) (#31560)
Giteabot [Fri, 5 Jul 2024 09:24:01 +0000 (17:24 +0800)]
Fix slow patch checking with commits that add or remove many files (#31548) (#31560)

Backport #31548 by @brechtvl

Running git update-index for every individual file is slow, so add and
remove everything with a single git command.

When such a big commit lands in the default branch, it could cause PR
creation and patch checking for all open PRs to be slow, or time out
entirely. For example, a commit that removes 1383 files was measured to
take more than 60 seconds and timed out. With this change checking took
about a second.

This is related to #27967, though this will not help with commits that
change many lines in few files.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
3 months agoAdd changelog for 1.22.1 (#31517) v1.22.1
Lunny Xiao [Thu, 4 Jul 2024 02:17:07 +0000 (10:17 +0800)]
Add changelog for 1.22.1 (#31517)

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 months agoUpdate `golang.org/x/image` to v0.18.0 (#31542)
silverwind [Tue, 2 Jul 2024 23:42:16 +0000 (01:42 +0200)]
Update `golang.org/x/image` to v0.18.0 (#31542)

3 months agoremove typo (#31524)
rayden84 [Sat, 29 Jun 2024 15:54:15 +0000 (17:54 +0200)]
remove typo (#31524)

3 months agoFix avatar radius problem on the new issue page (#31506) (#31508)
Giteabot [Thu, 27 Jun 2024 15:34:40 +0000 (23:34 +0800)]
Fix avatar radius problem on the new issue page (#31506) (#31508)

Backport #31506 by charles7668

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
3 months agouse correct l10n string (#31487) (#31490)
Giteabot [Wed, 26 Jun 2024 13:45:48 +0000 (21:45 +0800)]
use correct l10n string (#31487) (#31490)

Backport #31487 by CyberFlameGO

Co-authored-by: CyberFlame <cyberflameu@gmail.com>
3 months agoUpgrade `github.com/hashicorp/go-retryablehttp` (#31499)
silverwind [Wed, 26 Jun 2024 13:15:42 +0000 (15:15 +0200)]
Upgrade `github.com/hashicorp/go-retryablehttp` (#31499)

3 months agoFix dropzone JS error when attachment is disabled (#31486)
wxiaoguang [Wed, 26 Jun 2024 10:09:25 +0000 (18:09 +0800)]
Fix dropzone JS error when attachment is disabled (#31486)

Fix #31485

3 months agoFix overflow menu flickering on mobile (#31484) (#31488)
Giteabot [Tue, 25 Jun 2024 17:13:04 +0000 (01:13 +0800)]
Fix overflow menu flickering on mobile (#31484) (#31488)

Backport #31484 by brechtvl

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
3 months agoFix poor table column width due to breaking words (#31473) (#31477)
Giteabot [Tue, 25 Jun 2024 00:00:17 +0000 (08:00 +0800)]
Fix poor table column width due to breaking words (#31473) (#31477)

Backport #31473 by brechtvl

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: silverwind <me@silverwind.io>
3 months agoFix deprecated Dockerfile ENV format (#31450) (#31452)
Giteabot [Mon, 24 Jun 2024 00:53:37 +0000 (08:53 +0800)]
Fix deprecated Dockerfile ENV format (#31450) (#31452)

Backport #31450 by @silverwind

See
https://docs.docker.com/reference/build-checks/legacy-key-value-format/.
Fixes these warnings seen during the docker build:

```
 4 warnings found (use --debug to expand):
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 5)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 9)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 75)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 76)
 ```

Introduced in: https://github.com/moby/buildkit/pull/4923

Co-authored-by: silverwind <me@silverwind.io>
3 months agoFix web notification icon not updated once you read all notifications (#31447) (...
Giteabot [Sun, 23 Jun 2024 16:08:37 +0000 (00:08 +0800)]
Fix web notification icon not updated once you read all notifications (#31447) (#31466)

Backport #31447 by kiatt210

Fix #29065
Remove status filtering from GetUIDsAndNotificationCounts sql.

Co-authored-by: kiatt210 <40639725+kiatt210@users.noreply.github.com>
Co-authored-by: kiatt210 <kiatt210@github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 months agoSwitch to upstream of `gorilla/feeds` (#31400) (#31464)
techknowlogick [Sun, 23 Jun 2024 08:47:43 +0000 (04:47 -0400)]
Switch to upstream of `gorilla/feeds` (#31400) (#31464)

backport #31400

3 months agoSwitch to "Write" tab when edit comment again (#31445) (#31461)
Giteabot [Sat, 22 Jun 2024 15:47:36 +0000 (23:47 +0800)]
Switch to "Write" tab when edit comment again (#31445) (#31461)

Backport #31445 by wxiaoguang

Fix #19031

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 months agoSupport relative paths to videos from Wiki pages (#31061) (#31453)
Giteabot [Fri, 21 Jun 2024 21:03:31 +0000 (05:03 +0800)]
Support relative paths to videos from Wiki pages (#31061) (#31453)

Backport #31061 by @sergeyvfx

This change fixes cases when a Wiki page refers to a video stored in the
Wiki repository using relative path. It follows the similar case which
has been already implemented for images.

Test plan:
- Create repository and Wiki page
- Clone the Wiki repository
- Add video to it, say `video.mp4`
- Modify the markdown file to refer to the video using `<video
src="video.mp4">`
- Commit the Wiki page
- Observe that the video is properly displayed

Co-authored-by: Sergey Sharybin <sergey.vfx@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 months agoFix the link for .git-blame-ignore-revs bypass (#31432) (#31442)
Giteabot [Fri, 21 Jun 2024 06:47:11 +0000 (14:47 +0800)]
Fix the link for .git-blame-ignore-revs bypass (#31432) (#31442)

Backport #31432 by wxiaoguang

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 months agoFix the wrong line number in the diff view page when expanded twice. (#31431) (#31440)
Giteabot [Thu, 20 Jun 2024 20:33:51 +0000 (04:33 +0800)]
Fix the wrong line number in the diff view page when expanded twice. (#31431) (#31440)

Backport #31431 by @charles7668

close #31149

The problem is caused by the `data-query=` string affecting the parsing
of the `last_left` parameter. When the page is first rendered,
`data-query=` does not exist. However, after clicking expand, the
returned HTML contains this string, causing the line numbers to start
from 1 upon expanding a second time.

before fix

![圖片](https://github.com/go-gitea/gitea/assets/30816317/36842bde-cc30-43ba-91b0-c60a50a6dc0f)

after fix

![圖片](https://github.com/go-gitea/gitea/assets/30816317/b73d7e40-ec01-48ae-9992-09c19ee477ad)

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>