]> source.dussan.org Git - gitea.git/log
gitea.git
8 months agoMake runs-on support variable expression (#29468) (#29782)
sillyguodong [Thu, 14 Mar 2024 02:19:01 +0000 (10:19 +0800)]
Make runs-on support variable expression (#29468) (#29782)

backport #29468

Close issue: https://gitea.com/gitea/act_runner/issues/445
Follow: https://gitea.com/gitea/act/pulls/91

Move `getSecretsOfTask` and `getVariablesOfTask` under models because of
circular dependency issues.

8 months agoFix possible NPE in ToPullReviewList (#29759) (#29775)
Giteabot [Wed, 13 Mar 2024 20:42:17 +0000 (04:42 +0800)]
Fix possible NPE in ToPullReviewList (#29759) (#29775)

Backport #29759 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
8 months agoUpdate to labeler v5 (#29721) (#29765)
Denys Konovalov [Wed, 13 Mar 2024 13:42:55 +0000 (14:42 +0100)]
Update to labeler v5 (#29721) (#29765)

Backport #29721

Updated to actions/labeler@v5

Updated labeler config accordingly, also improved the config and added
more labels.

Co-authored-by: Giteabot <teabot@gitea.io>
8 months agoFix incorrect package link method calls in templates (#29580) (#29764)
wxiaoguang [Wed, 13 Mar 2024 11:43:31 +0000 (19:43 +0800)]
Fix incorrect package link method calls in templates (#29580) (#29764)

Backport #29580
Fix #29562
Fix #29762
Follow  #29531

8 months agoSuppress error from monaco-editor (#29684) (#29758)
Giteabot [Wed, 13 Mar 2024 08:02:00 +0000 (16:02 +0800)]
Suppress error from monaco-editor (#29684) (#29758)

Backport #29684 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/29414
I see no way for us to catch this error, so downgrade it until
https://github.com/microsoft/monaco-editor/issues/4325 is fixed, which
will likely take a few weeks to propagate up from vscode.

The entries in `updates.config.js` will make
[`updates`](https://github.com/silverwind/updates) not upgrade these
anymore and I think it's good documentation as well to have the reasons
why we don't upgrade these dependencies.

Co-authored-by: silverwind <me@silverwind.io>
8 months agoAdd changelog for 1.21.8 (#29735) v1.21.8
Lunny Xiao [Wed, 13 Mar 2024 03:10:02 +0000 (11:10 +0800)]
Add changelog for 1.21.8 (#29735)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
8 months agoFix date rendering by adding `<gitea-absolute-date>` (#29725) (#29747)
Giteabot [Wed, 13 Mar 2024 00:04:58 +0000 (08:04 +0800)]
Fix date rendering by adding `<gitea-absolute-date>` (#29725) (#29747)

Backport #29725 by @silverwind

Alternative to: https://github.com/go-gitea/gitea/pull/29698
Fixes: https://github.com/go-gitea/gitea/issues/29034
<img width="278" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/12ecd967-2723-410d-8a28-a1b0f41b7bba">

It also fixes a secondary issue that we were showing timestamp tooltips
over date, which makes no sense, so these are now gone as well:

<img width="284" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/a70432f3-97b6-41e6-b202-b53b76924a66">

Co-authored-by: silverwind <me@silverwind.io>
8 months agoImprove CSV rendering (#29638) (#29744)
Giteabot [Tue, 12 Mar 2024 21:45:45 +0000 (05:45 +0800)]
Improve CSV rendering (#29638) (#29744)

Backport #29638 by @silverwind

Before:

<img width="1332" alt="Screenshot 2024-03-06 at 21 42 17"
src="https://github.com/go-gitea/gitea/assets/115237/0ea07eee-31f8-4783-bd56-37bd8396f00d">

After:
<img width="1336" alt="Screenshot 2024-03-06 at 21 41 58"
src="https://github.com/go-gitea/gitea/assets/115237/eb7f9cc9-587f-4e3b-92bd-cc67ca639963">

Co-authored-by: silverwind <me@silverwind.io>
8 months agoUse Get but not Post to get actions artifacts (#29734) (#29737)
Lunny Xiao [Tue, 12 Mar 2024 16:31:45 +0000 (00:31 +0800)]
Use Get but not Post to get actions artifacts (#29734) (#29737)

backport #29734

8 months agoFix inconsistent rendering of block mathematical expressions (#29677) (#29711)
Giteabot [Mon, 11 Mar 2024 09:10:07 +0000 (17:10 +0800)]
Fix inconsistent rendering of block mathematical expressions (#29677) (#29711)

Backport #29677 by @yp05327

Fix #28735

GitHub render `\```math\``` ` as a block now.
Add `display` class will render it as a block.

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/2a1c20c7-438e-4ab1-8c66-cf91c8343087)

![image](https://github.com/go-gitea/gitea/assets/18380374/b81b8a93-8bca-46a5-b7db-e0d2f53e1342)

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
8 months agofix: rendering internal file links in org (#29669) (#29705)
Giteabot [Sun, 10 Mar 2024 17:29:17 +0000 (01:29 +0800)]
fix: rendering internal file links in org (#29669) (#29705)

Backport #29669 by @ankitrgadiya

The internal links to other files in the repository were not rendering
with the Src Prefix (/src/branch-name/file-path). This commit fixes that
by using the `SrcLink` as base if available.

Resolves #29668

Co-authored-by: Ankit R Gadiya <git@argp.in>
8 months agoFix bug hidden on CI and make ci failed if tests failure (#29254) (#29662)
Lunny Xiao [Sat, 9 Mar 2024 09:44:02 +0000 (17:44 +0800)]
Fix bug hidden on CI and make ci failed if tests failure (#29254) (#29662)

Backport #29254

The tests on migration tests failed but CI reports successfully

https://github.com/go-gitea/gitea/actions/runs/7364373807/job/20044685969#step:8:141

This PR will fix the bug on migrations and also the CI hidden behaviour.

The reason is on the Makefile

`GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test
$(GOTESTFLAGS) -tags='$(TEST_TAGS)' $(MIGRATE_TEST_PACKAGES)` will
return the error exit code.

But

`for pkg in $(shell $(GO) list
code.gitea.io/gitea/models/migrations/...); do \
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test
$(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
done`

will not work.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
8 months agoDon't show AbortErrors on logout (#29639) (#29667)
silverwind [Sat, 9 Mar 2024 09:22:18 +0000 (10:22 +0100)]
Don't show AbortErrors on logout (#29639) (#29667)

Backport https://github.com/go-gitea/gitea/pull/29639.

When logging out of Gitea, a error toast can be seen for a split second.
I don't know why or how it happens but I found it it's an `AbortError`
(related to
[AbortController#abort](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort)),
so let's hide it.

8 months agoUse more specific selector for `name` links (#29679) (#29681)
Giteabot [Sat, 9 Mar 2024 00:40:05 +0000 (08:40 +0800)]
Use more specific selector for `name` links (#29679) (#29681)

Backport #29679 by @silverwind

Followup https://github.com/go-gitea/gitea/pull/29305. As per discussion
in https://github.com/go-gitea/gitea/pull/29666#discussion_r1517506422,
make this selector only search in the current `.markup` document, as
there can be multiples displayed at the same time.

@DanielMatiasCarvalho maybe you can review.

Co-authored-by: silverwind <me@silverwind.io>
8 months agoFix user-defined markup links targets (#29305) (#29666)
Giteabot [Fri, 8 Mar 2024 16:53:36 +0000 (00:53 +0800)]
Fix user-defined markup links targets (#29305) (#29666)

Backport #29305 by @DanielMatiasCarvalho

This seeks to fix the bug reported on issue #29196.

Cause:
ID's with custom characters (- , _ , etc.), were not linking correctly
in the Markdown file when rendered in the browser because the ID in the
respective destinies would be different than the one in anchor, while
for IDs with only letters, the ID would be the same.

Fix:
It was suggested that to fix this bug, it should more or less like
GitHub does it. While in gitea the anchors would be put in HTML like
this:
```
<p dir="auto"><a href="#user-content-_toc152597800" rel="nofollow">Review</a></p>
<p dir="auto"><a href="#user-content-_toc152597802" rel="nofollow">Staging</a></p>
<p dir="auto"><a href="#user-content-_toc152597803" rel="nofollow">Development</a></p>
<p dir="auto"><a href="#user-content-_toc152597828" rel="nofollow">Testing</a></p>
<p dir="auto"><a href="#user-content-_toc152597829" rel="nofollow">Unit-tests</a></p>

```
In GitHub, the same anchor's href properties would be the same without
"user-content-" trailing behind.

So my code made sure to change those anchors, so it would not include
"user-content-" and then add respective Event Listeners so it would
scroll into the supposed places.

Fixes: #29196
Co-authored-by: DC <106393991+DanielMatiasCarvalho@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
8 months agoFix commit_status problem when testing (#29672) (#29675)
Giteabot [Fri, 8 Mar 2024 16:04:23 +0000 (00:04 +0800)]
Fix commit_status problem when testing (#29672) (#29675)

Backport #29672 by @charles7668

Close #29661

fix #29656

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
8 months agoFix 500 when deleting account with incorrect password or unsupported login type ...
Lunny Xiao [Fri, 8 Mar 2024 14:43:57 +0000 (22:43 +0800)]
Fix 500 when deleting account with incorrect password or unsupported login type (#29579) (#29656)

Fix #26210
Backport #29579

Co-authored-by: Jason Song <i@wolfogre.com>
8 months agoAdd empty repo check in DetectAndHandleSchedules (#29606) (#29659)
yp05327 [Fri, 8 Mar 2024 09:50:04 +0000 (18:50 +0900)]
Add empty repo check in DetectAndHandleSchedules (#29606) (#29659)

Backport #29606

8 months agoFix incorrect rendering csv file when file size is larger than UI.CSV.MaxFileSize...
Giteabot [Fri, 8 Mar 2024 09:13:58 +0000 (17:13 +0800)]
Fix incorrect rendering csv file when file size is larger than UI.CSV.MaxFileSize (#29653) (#29663)

Backport #29653 by @yp05327

Fix #29506

Co-authored-by: yp05327 <576951401@qq.com>
8 months agoFixing the issue when status check per rule matches multiple actions (#29631) (#29655)
Giteabot [Fri, 8 Mar 2024 05:24:32 +0000 (13:24 +0800)]
Fixing the issue when status check per rule matches multiple actions (#29631) (#29655)

Backport #29631 by @charles7668

Close #29628
rule
```
Test / Build*
Test / Build *
Test / Build 2*
Test / Build 1*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8)
rule2
```
Test / Build*
Test / Build 1*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8)

rule3
```
Test / Build*
Test / Build 1*
NotExist*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/f6a5e832-2e1b-4049-915b-45bec5ef070c)

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
8 months agoUse strict protocol check when redirect (#29642) (#29644)
Giteabot [Thu, 7 Mar 2024 03:53:33 +0000 (11:53 +0800)]
Use strict protocol check when redirect (#29642) (#29644)

Backport #29642 by wxiaoguang

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
8 months agoUpdate Twitter Logo (#29621) (#29633)
silverwind [Wed, 6 Mar 2024 16:41:23 +0000 (17:41 +0100)]
Update Twitter Logo (#29621) (#29633)

Backport https://github.com/go-gitea/gitea/pull/29621
<img width="430" alt="image"

src="https://github.com/go-gitea/gitea/assets/115237/9cf7b0a3-406b-4dd6-ab3d-d31a96b9335a">

8 months agoAvoid issue info panic (#29625) (#29632)
Giteabot [Wed, 6 Mar 2024 13:33:29 +0000 (21:33 +0800)]
Avoid issue info panic (#29625) (#29632)

Backport #29625 by wxiaoguang

Fix #29624

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
8 months agoAvoid unexpected panic in graceful manager (#29629) (#29630)
wxiaoguang [Wed, 6 Mar 2024 11:00:21 +0000 (19:00 +0800)]
Avoid unexpected panic in graceful manager (#29629) (#29630)

Backport #29629

8 months agoFix wrong line number in code search result (#29260) (#29623)
Giteabot [Wed, 6 Mar 2024 09:05:41 +0000 (17:05 +0800)]
Fix wrong line number in code search result (#29260) (#29623)

Backport #29260 by @yp05327

Fix #29136

Before:
The result is a table and all line numbers are all in one row.

![image](https://github.com/go-gitea/gitea/assets/18380374/7a18b354-e257-4f57-a5ca-f6d37378edf6)

![image](https://github.com/go-gitea/gitea/assets/18380374/98416e11-89b5-4b4f-920b-91bcf041a87f)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/f189e436-9046-4431-926a-cd0deb58e8f1)

![image](https://github.com/go-gitea/gitea/assets/18380374/07d213ed-2401-4b7f-b951-5df7dc776af4)

~~Updated:~~
~~added `active` class to the target line.~~

![image](https://github.com/go-gitea/gitea/assets/18380374/0b274e48-048a-4c66-ba95-df515212ec08)

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
8 months agobump protobuf module (#29617) (#29619)
techknowlogick [Wed, 6 Mar 2024 05:16:35 +0000 (00:16 -0500)]
bump protobuf module (#29617) (#29619)

backport #29617

8 months agoAdd missing database transaction for new issue (#29490) (#29607)
Lunny Xiao [Tue, 5 Mar 2024 16:37:55 +0000 (00:37 +0800)]
Add missing database transaction for new issue (#29490) (#29607)

When creating an issue, inserting issue, assign users and set project
should be in the same transaction.

Backport #29490

8 months agoMake "/user/login" page redirect if the current user has signed in (#29583) (#29599)
wxiaoguang [Tue, 5 Mar 2024 13:03:45 +0000 (21:03 +0800)]
Make "/user/login" page redirect if the current user has signed in (#29583) (#29599)

Backport #29583

8 months agoAdd a trailing slash to dashboard links (#29555) (#29573)
wxiaoguang [Mon, 4 Mar 2024 05:50:55 +0000 (13:50 +0800)]
Add a trailing slash to dashboard links (#29555) (#29573)

Backport #29555

8 months agoFix workflow trigger event IssueChangeXXX bug (#29559) (#29565)
Giteabot [Sun, 3 Mar 2024 20:34:46 +0000 (04:34 +0800)]
Fix workflow trigger event IssueChangeXXX bug (#29559) (#29565)

Backport #29559 by @yp05327

Bugs from #29308
Follow #29467

partly fix #29558

Co-authored-by: yp05327 <576951401@qq.com>
8 months agoFix 500 when pushing release to an empty repo (#29554) (#29564)
Giteabot [Sun, 3 Mar 2024 17:10:22 +0000 (01:10 +0800)]
Fix 500 when pushing release to an empty repo (#29554) (#29564)

Backport #29554 by @lng2020

As title.
The former code directly used `ctx.Repo.GitRepo`, causing 500.

https://github.com/go-gitea/gitea/blob/22b4f0c09f1de5e581929bd10f39833d30d2c482/routers/api/v1/repo/release.go#L241

Co-authored-by: Nanguan Lin <nanguanlin6@gmail.com>
8 months agoOnly use supported sort order for "explore/users" page (#29430) (#29443)
wxiaoguang [Sun, 3 Mar 2024 02:28:45 +0000 (10:28 +0800)]
Only use supported sort order for "explore/users" page (#29430) (#29443)

Backport #29430

Thanks to inferenceus : some sort orders on the "explore/users" page
could list users by their lastlogintime/updatetime.

It leaks user's activity unintentionally. This PR makes that page only
use "supported" sort orders.

Removing the "sort orders" could also be a good solution, while IMO at
the moment keeping the "create time" and "name" orders is also fine, in
case some users would like to find a target user in the search result,
the "sort order" might help.

8 months agoFix incorrect cookie path for AppSubURL (#29534) (#29552)
Giteabot [Sun, 3 Mar 2024 00:54:33 +0000 (08:54 +0800)]
Fix incorrect cookie path for AppSubURL (#29534) (#29552)

Backport #29534
Regression of #24107

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
8 months agogitea.service: Remove syslog.target (#29550) (#29551)
Giteabot [Sat, 2 Mar 2024 23:57:10 +0000 (07:57 +0800)]
gitea.service: Remove syslog.target (#29550) (#29551)

Backport #29550 by @C0rn3j

Remove syslog.target from service file, this target hasn't existed for
over a decade.

https://github.com/systemd/systemd/blob/6aa8d43ade72e24c9426e604f7fc4b7582b9db7c/NEWS#L72-L73

Co-authored-by: Martin <spleefer90@gmail.com>
8 months agoFix incorrect redirection when creating a PR fails (#29537) (#29543)
Giteabot [Sat, 2 Mar 2024 20:01:19 +0000 (04:01 +0800)]
Fix incorrect redirection when creating a PR fails (#29537) (#29543)

Backport #29537 by wxiaoguang

This is only a quick fix to make it easier to backport.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
8 months agoFix queue worker incorrectly stopped when there are still more items in the queue...
Giteabot [Sat, 2 Mar 2024 19:40:06 +0000 (03:40 +0800)]
Fix queue worker incorrectly stopped when there are still more items in the queue (#29532) (#29546)

Backport #29532

Without `case <-t.C`, the workers would stop incorrectly, the test won't
pass. For the worse case, there might be only one running worker
processing the queue items for long time because other workers are
stopped. The root cause is related to the logic of doDispatchBatchToWorker.
It isn't a serious problem at the moment, so keep it as-is.

8 months agoFix incorrect relative/absolute URL usages (#29531) (#29547)
Giteabot [Sat, 2 Mar 2024 18:00:15 +0000 (02:00 +0800)]
Fix incorrect relative/absolute URL usages (#29531) (#29547)

Backport #29531 by wxiaoguang

Add two "HTMLURL" methods for PackageDescriptor.
And rename "FullWebLink" to "VersionWebLink"

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
8 months agoFix incorrect subpath in links (#29535) (#29541)
Giteabot [Sat, 2 Mar 2024 12:26:54 +0000 (20:26 +0800)]
Fix incorrect subpath in links (#29535) (#29541)

Backport #29535 by wxiaoguang

* `$referenceUrl`: it is constructed by "Issue.Link", which already has
the "AppSubURL"
* `window.location.href`: AppSubURL could be empty string, so it needs
the trailing slash

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
8 months agoFix issue link does not support quotes (#29484) (#29487) (#29536)
Giteabot [Sat, 2 Mar 2024 11:37:45 +0000 (19:37 +0800)]
Fix issue link does not support quotes (#29484) (#29487) (#29536)

Backport #29487 by @charles7668

Close #29484

![圖片](https://github.com/go-gitea/gitea/assets/30816317/b27e6e16-67e0-469c-8e04-30180c585890)

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
8 months agoFix issue & comment history bugs (#29525) (#29527)
Giteabot [Sat, 2 Mar 2024 00:45:48 +0000 (08:45 +0800)]
Fix issue & comment history bugs (#29525) (#29527)

Backport #29525 by @wxiaoguang

* Follow #17746: `HasIssueContentHistory` should use expr builder to
make sure zero value (0) be respected.
* Add "doer" check to make sure `canSoftDeleteContentHistory` only be
called by sign-in users.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
8 months agoSet pre-step status to `skipped` if job is skipped (#29489) (#29523)
Giteabot [Fri, 1 Mar 2024 13:51:54 +0000 (21:51 +0800)]
Set pre-step status to `skipped` if job is skipped (#29489) (#29523)

Backport #29489 by @sillyguodong

close #27496
1. Set pre-step (Set up job) status to `skipped` if job is skipped.
2. Apart from pre-step, the other steps should also be set to `skipped`.
The status of other steps are reported from the runner side. This will
be completed by this PR: https://gitea.com/gitea/act_runner/pulls/500

before:

![image](https://github.com/go-gitea/gitea/assets/33891828/4bac2ba9-66de-4679-b7ed-fbae459c0c54)

after:

![image](https://github.com/go-gitea/gitea/assets/33891828/ead4871a-4e0f-4bb1-9fb4-37f4fdb78dfc)

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
8 months agoUpdate FAQ about git hook problems (#29495) (#29496)
Giteabot [Thu, 29 Feb 2024 14:36:00 +0000 (22:36 +0800)]
Update FAQ about git hook problems (#29495) (#29496)

Backport #29495 by @wolfogre

Close
https://github.com/go-gitea/gitea/issues/29338#issuecomment-1970363817

Co-authored-by: Jason Song <i@wolfogre.com>
8 months agoImprove contrast on blame timestamp, fix double border (#29482) (#29485)
Giteabot [Thu, 29 Feb 2024 08:51:42 +0000 (16:51 +0800)]
Improve contrast on blame timestamp, fix double border (#29482) (#29485)

Backport #29482 by @silverwind

Before, double border on top, bad contrast on dark:
<img width="155" alt="Screenshot 2024-02-29 at 02 06 17"
src="https://github.com/go-gitea/gitea/assets/115237/fc0f1e08-a5ce-47ed-9eb6-135eed5a1abb">
<img width="126" alt="Screenshot 2024-02-29 at 02 07 28"
src="https://github.com/go-gitea/gitea/assets/115237/38ae8483-8d9b-484c-8909-d4466131ea16">

After, no double border on top, good contrast:
<img width="154" alt="Screenshot 2024-02-29 at 02 20 20"
src="https://github.com/go-gitea/gitea/assets/115237/ad91282b-e9f5-4f41-8f5e-6ba28db3beac">
<img width="147" alt="Screenshot 2024-02-29 at 02 20 38"
src="https://github.com/go-gitea/gitea/assets/115237/7ee2ec92-e72a-4981-aec3-98fc8e579bae">

Co-authored-by: silverwind <me@silverwind.io>
8 months agoFix wrong test usage of `AppSubURL` (#29459) (#29488)
Giteabot [Thu, 29 Feb 2024 06:40:35 +0000 (14:40 +0800)]
Fix wrong test usage of `AppSubURL` (#29459) (#29488)

Backport #29459 by @KN4CK3R

The tests use an invalid `setting.AppSubURL`. The wrong behaviour
disturbs other PRs like #29222 and #29427.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
8 months agoFix/Improve `processWindowErrorEvent` (#29407) (#29480)
Giteabot [Thu, 29 Feb 2024 00:22:53 +0000 (08:22 +0800)]
Fix/Improve `processWindowErrorEvent` (#29407) (#29480)

Backport #29407 by @silverwind

- `e.error` can be undefined in some cases which would raise an error
inside this error handler, fixed that.
- The displayed message mentions looking into the console, but in my
case of error from `ResizeObserver` there was nothing there, so add this
logging. I think this logging was once there but got lost during
refactoring.

Co-authored-by: silverwind <me@silverwind.io>
8 months agoFix counter display number incorrectly displayed on the page (#29448) (#29478)
Giteabot [Wed, 28 Feb 2024 22:13:49 +0000 (06:13 +0800)]
Fix counter display number incorrectly displayed on the page (#29448) (#29478)

Backport #29448 by @charles7668

issue : #28239

The counter number script uses the 'checkbox' attribute to determine
whether an item is selected or not.

However, the input event only increments the counter value, and when
more items are displayed, it does not update all previously loaded
items.

As a result, the display becomes incorrect because it triggers the
update counter script, but checkboxes that are selected without the
'checked' attribute are not counted

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
8 months agoFix workflow trigger event bugs (#29467) (#29475)
Giteabot [Wed, 28 Feb 2024 20:24:51 +0000 (04:24 +0800)]
Fix workflow trigger event bugs (#29467) (#29475)

Backport #29467 by @Zettat123

1. Fix incorrect `HookEventType` for issue-related events in
`IssueChangeAssignee`
2. Add `case "types"` in the `switch` block in `matchPullRequestEvent`
to avoid warning logs

Co-authored-by: Zettat123 <zettat123@gmail.com>
8 months agoFix URL calculation in clone input box (#29470) (#29473)
Giteabot [Wed, 28 Feb 2024 15:25:53 +0000 (23:25 +0800)]
Fix URL calculation in clone input box (#29470) (#29473)

Backport #29470 by @silverwind

Ported the function as-is and added comments so we don't forget about
this in the future.

Fixes: https://github.com/go-gitea/gitea/issues/29462
Co-authored-by: silverwind <me@silverwind.io>
8 months agoThe job should always run when `if` is `always()` (#29464) (#29469)
Giteabot [Wed, 28 Feb 2024 11:22:31 +0000 (19:22 +0800)]
The job should always run when `if` is `always()` (#29464) (#29469)

Backport #29464 by @Zettat123

Fix #27906

According to GitHub's
[documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds),
a job should always run when its `if` is `always()`

> If you would like a job to run even if a job it is dependent on did
not succeed, use the `always()` conditional expression in
`jobs.<job_id>.if`.

Co-authored-by: Zettat123 <zettat123@gmail.com>
8 months agoFix missed return (#29450) (#29453)
Giteabot [Tue, 27 Feb 2024 15:33:03 +0000 (23:33 +0800)]
Fix missed return (#29450) (#29453)

Backport #29450 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
8 months agoFix template bug (#27581) (#29446)
Lunny Xiao [Tue, 27 Feb 2024 11:11:38 +0000 (19:11 +0800)]
Fix template bug (#27581) (#29446)

Fix #29152
Backport #27581

8 months agoUpdate docs about `DEFAULT_ACTIONS_URL` (#29442) (#29445)
Jason Song [Tue, 27 Feb 2024 10:16:08 +0000 (18:16 +0800)]
Update docs about `DEFAULT_ACTIONS_URL` (#29442) (#29445)

Backport #29442.

Follow #25581.

9 months agoNot trigger all jobs any more, when re-running the first job (#29439) (#29441)
Giteabot [Tue, 27 Feb 2024 08:18:49 +0000 (16:18 +0800)]
Not trigger all jobs any more, when re-running the first job (#29439) (#29441)

Backport #29439 by @sillyguodong

Previously, it will be treated as "re-run all jobs" when `jobIndex ==
0`. So when you click re-run button on the first job, it triggers all
the jobs actually.

Caused by #26535.

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
9 months agoIgnore empty repo for CreateRepository in action notifier (#29416) (#29424)
Giteabot [Mon, 26 Feb 2024 09:59:12 +0000 (17:59 +0800)]
Ignore empty repo for CreateRepository in action notifier (#29416) (#29424)

Backport #29416 by @yp05327

Fix #29415

Co-authored-by: yp05327 <576951401@qq.com>
9 months agoFix incorrect tree path value for patch editor (#29377) (#29421)
Giteabot [Mon, 26 Feb 2024 09:26:23 +0000 (17:26 +0800)]
Fix incorrect tree path value for patch editor (#29377) (#29421)

Backport #29377 by wxiaoguang

Regression of #18718. When submitting the form,
EditRepoFileForm.TreePath is marked as "Required", so the value can't be
empty. The value is not used by backend, so use a meaningful dummy value
for it.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoChange log for 1.21.7 (#29411) v1.21.7
Lunny Xiao [Mon, 26 Feb 2024 07:39:21 +0000 (15:39 +0800)]
Change log for 1.21.7 (#29411)

This is an emergency release to fix the bug #29402.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoAdd missing space (#29393) (#29399)
Giteabot [Sun, 25 Feb 2024 16:08:44 +0000 (00:08 +0800)]
Add missing space (#29393) (#29399)

Backport #29393 by @KN4CK3R

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
9 months agoenforce maxlength in frontend (#29389) (#29396)
Giteabot [Sun, 25 Feb 2024 14:56:44 +0000 (22:56 +0800)]
enforce maxlength in frontend (#29389) (#29396)

Backport #29389 by @zokkis

Set maxlength attribute in frontend

to long file-name

![image](https://github.com/go-gitea/gitea/assets/72873130/15111614-55ab-4583-acb2-15c25997601d)

![image](https://github.com/go-gitea/gitea/assets/72873130/4105ddd8-4973-4da8-b3ab-4cfae1b45554)
(same for branch-name and commit-summary)

Co-authored-by: Tim-Niclas Oelschläger <72873130+zokkis@users.noreply.github.com>
9 months agoUsers with `read` permission of pull requests can be assigned too (#27263) (#29372)
Giteabot [Sat, 24 Feb 2024 16:42:33 +0000 (00:42 +0800)]
Users with `read` permission of pull requests can be assigned too (#27263) (#29372)

Backport #27263 by @lunny

This PR will also keep the consistent between list assigned users and
check assigned users.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
9 months agoDo not double close reader (#29354) (#29370)
Giteabot [Sat, 24 Feb 2024 12:08:06 +0000 (20:08 +0800)]
Do not double close reader (#29354) (#29370)

Backport #29354 by @KN4CK3R

Fixes #29346

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoDisplay friendly error message (#29105) (#29363)
Lunny Xiao [Sat, 24 Feb 2024 11:01:18 +0000 (19:01 +0800)]
Display friendly error message (#29105) (#29363)

Backport #29105

`ctx.Error` only displays the text but `ctx.ServerError` renders the
usual error page.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
9 months agoDocker Tag Information in Docs (#29047) (#29362)
Lunny Xiao [Sat, 24 Feb 2024 10:41:10 +0000 (18:41 +0800)]
Docker Tag Information in Docs (#29047) (#29362)

Backport #29047

Add more details for the docker tag when using container registry.

Co-authored-by: wienans <40465543+wienans@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
9 months agoFix validity of the FROM email address not being checked (#29347) (#29360)
Giteabot [Sat, 24 Feb 2024 08:23:21 +0000 (16:23 +0800)]
Fix validity of the FROM email address not being checked (#29347) (#29360)

Backport #29347 by @carlosfelgueiras

Fixes #27188.
Introduces a check on the installation that tries to parse the FROM
address. If it fails, shows a new error message to the user.

Co-authored-by: Carlos Felgueiras <carlosfelgueiras@tecnico.ulisboa.pt>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
9 months agoFix project counter in organization/individual profile (#28068) (#29361)
Lunny Xiao [Sat, 24 Feb 2024 07:58:43 +0000 (15:58 +0800)]
Fix project counter in organization/individual profile (#28068) (#29361)

Fix #28052
Backport #28068
Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/5f299983-4b38-4d68-ac0e-4be3c62c0558)

![image](https://github.com/go-gitea/gitea/assets/18380374/f0e12afd-483b-4882-80e9-0261beb3fe0c)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/47cccb7b-bb35-4a7d-9c5b-83133be0323a)

![image](https://github.com/go-gitea/gitea/assets/18380374/77825c0c-4bf2-4762-83a2-1a5a173cc22d)

Co-authored-by: yp05327 <576951401@qq.com>
9 months agoFix incorrect tests in 1.21 (#29366)
wxiaoguang [Sat, 24 Feb 2024 07:27:47 +0000 (15:27 +0800)]
Fix incorrect tests in 1.21 (#29366)

The submitted tests in the patch for the XSS fix is not right.

To test, it should test "what should happen", but not "what doesn't
exist" or "what is processed/decoded".

9 months agoFix tarball/zipball download bug (#29342) (#29352)
Giteabot [Fri, 23 Feb 2024 22:47:11 +0000 (06:47 +0800)]
Fix tarball/zipball download bug (#29342) (#29352)

Backport #29342 by @Zettat123

Fix #29249

~~Use the `/repos/{owner}/{repo}/archive/{archive}` API to download.~~

Apply #26430 to archive download URLs.

Co-authored-by: Zettat123 <zettat123@gmail.com>
9 months agoAdjust changelog for v1.21.6 to move prs to correct labels (#29339)
Lunny Xiao [Fri, 23 Feb 2024 07:46:56 +0000 (15:46 +0800)]
Adjust changelog for v1.21.6 to move prs to correct labels (#29339)

When releasing, the releaser should read all the pull requests carefully
and do some adjustments because some of pull requests' labels are not
right when it's merged.

And the changelog tool needs to be adjusted. If one pull request has
both `bug` and `API`, it should mark it as `bug` but not `API`.

9 months agoAdd Changelog v1.21.6 (#29335) v1.21.6
6543 [Thu, 22 Feb 2024 22:42:29 +0000 (23:42 +0100)]
Add Changelog v1.21.6 (#29335)

9 months agoFix XSS vulnerabilities (#29336)
6543 [Thu, 22 Feb 2024 22:37:21 +0000 (23:37 +0100)]
Fix XSS vulnerabilities (#29336)

- The Wiki page did not sanitize author name
- the reviewer name on a "dismiss review" comment is also affected
- the migration page has some spots

---------

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: jolheiser <john.olheiser@gmail.com>
9 months agoDon't show third-party JS errors in production builds (#29303) (#29333)
Giteabot [Thu, 22 Feb 2024 21:49:07 +0000 (05:49 +0800)]
Don't show third-party JS errors in production builds (#29303) (#29333)

Backport #29303 by @silverwind

So we don't get issues like
https://github.com/go-gitea/gitea/issues/29080 and
https://github.com/go-gitea/gitea/issues/29273 any more. Only active in
[production
builds](https://webpack.js.org/guides/production/#specify-the-mode), in
non-production the errors will still show.

Co-authored-by: silverwind <me@silverwind.io>
9 months agoRemove SSH workaround (#27893) (#29332)
6543 [Thu, 22 Feb 2024 20:45:31 +0000 (21:45 +0100)]
Remove SSH workaround (#27893) (#29332)

Backport #27893

- Update github.com/gliderlabs/ssh to include
https://github.com/gliderlabs/ssh/commit/02f9d573009f8c13755b6b90fa14a4f549b17b22.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1230

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
9 months agoOnly log error when tag sync fails (#29295) (#29327)
Giteabot [Thu, 22 Feb 2024 19:52:54 +0000 (03:52 +0800)]
Only log error when tag sync fails (#29295) (#29327)

Backport #29295 by @lunny

Fix #28843

This PR will bypass the pushUpdateTag to database failure when
syncAllTags. An error log will be recorded.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoUse general token signing secret (#29205) (#29325)
wxiaoguang [Thu, 22 Feb 2024 17:07:41 +0000 (01:07 +0800)]
Use general token signing secret (#29205) (#29325)

Backport #29205 (including #29172)

Use a clearly defined "signing secret" for token signing.

9 months agoFix SSPI user creation (#28948) (#29323)
Lunny Xiao [Thu, 22 Feb 2024 16:42:14 +0000 (00:42 +0800)]
Fix SSPI user creation (#28948) (#29323)

Fixes #28945
Backport #28948

Setting the avatar is wrong and creating a random password is equal to
leave it empty.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
9 months agoImprove the `issue_comment` workflow trigger event (#29277) (#29322)
Giteabot [Thu, 22 Feb 2024 16:19:48 +0000 (00:19 +0800)]
Improve the `issue_comment` workflow trigger event (#29277) (#29322)

Backport #29277 by @Zettat123

Fix #29175
Replace #29207

This PR makes some improvements to the `issue_comment` workflow trigger
event.

1. Fix the bug that pull requests cannot trigger `issue_comment`
workflows
2. Previously the `issue_comment` event only supported the `created`
activity type. This PR adds support for the missing `edited` and
`deleted` activity types.
3. Some events (including `issue_comment`, `issues`, etc. ) only trigger
workflows that belong to the workflow file on the default branch. This
PR introduces the `IsDefaultBranchWorkflow` function to check for these
events.

Co-authored-by: Zettat123 <zettat123@gmail.com>
9 months agoDiscard unread data of `git cat-file` (#29297) (#29310)
Giteabot [Thu, 22 Feb 2024 04:23:38 +0000 (12:23 +0800)]
Discard unread data of `git cat-file` (#29297) (#29310)

Backport #29297 by @KN4CK3R

Fixes #29101
Related #29298

Discard all read data to prevent misinterpreting existing data. Some
discard calls were missing in error cases.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: yp05327 <576951401@qq.com>
9 months agoImplement some action notifier functions (#29173) (#29308)
yp05327 [Thu, 22 Feb 2024 03:55:03 +0000 (12:55 +0900)]
Implement some action notifier functions (#29173) (#29308)

Backport #29173

Fix #29166

Add support for the following activity types of `pull_request`
- assigned
- unassigned
- review_requested
- review_request_removed
- milestoned
- demilestoned

9 months agoPrevent double use of `git cat-file` session. (#29298) (#29301)
KN4CK3R [Thu, 22 Feb 2024 03:20:20 +0000 (04:20 +0100)]
Prevent double use of `git cat-file` session. (#29298) (#29301)

Backport #29298
Fixes the reason why #29101 is hard to replicate.
Related #29297

Create a repo with a file with minimum size 4097 bytes (I use 10000) and
execute the following code:
```go
gitRepo, err := gitrepo.OpenRepository(db.DefaultContext, <repo>)
assert.NoError(t, err)

commit, err := gitRepo.GetCommit(<sha>)
assert.NoError(t, err)

entry, err := commit.GetTreeEntryByPath(<file>)
assert.NoError(t, err)

b := entry.Blob()

// Create a reader
r, err := b.DataAsync()
assert.NoError(t, err)
defer r.Close()

// Create a second reader
r2, err := b.DataAsync()
assert.NoError(t, err) // Should be no error but is ErrNotExist
defer r2.Close()
```

The problem is the check in `CatFileBatch`:

https://github.com/go-gitea/gitea/blob/79217ea63c1f77de7ca79813ae45950724e63d02/modules/git/repo_base_nogogit.go#L81-L87
`Buffered() > 0` is used to check if there is a "operation" in progress
at the moment. This is a problem because we can't control the internal
buffer in the `bufio.Reader`. The code above demonstrates a sequence
which initiates an operation for which the code thinks there is no
active processing. The second call to `DataAsync()` therefore reuses the
existing instances instead of creating a new batch reader.

9 months agoFix gitea-action user avatar broken on edited menu (#29190) (#29307)
yp05327 [Thu, 22 Feb 2024 02:53:38 +0000 (11:53 +0900)]
Fix gitea-action user avatar broken on edited menu (#29190) (#29307)

Backport #29190

Fix #29178

9 months agoFix error display when merging PRs (#29288) (#29309)
Zettat123 [Thu, 22 Feb 2024 02:32:54 +0000 (10:32 +0800)]
Fix error display when merging PRs (#29288) (#29309)

Backport #29288
Partially fix #29071, regression of Modernize merge button #28140

Fix some missing `Redirect` -> `JSONRedirect`.

Thanks @yp05327 for the help in
https://github.com/go-gitea/gitea/issues/29071#issuecomment-1931261075

9 months agoFix missing link on outgoing new release notifications (#29079) (#29300)
wxiaoguang [Wed, 21 Feb 2024 19:01:48 +0000 (03:01 +0800)]
Fix missing link on outgoing new release notifications (#29079) (#29300)

Backport #29079

Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
Co-authored-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
9 months agoFix debian InRelease Acquire-By-Hash newline (#29204) (#29299)
wxiaoguang [Wed, 21 Feb 2024 18:40:16 +0000 (02:40 +0800)]
Fix debian InRelease Acquire-By-Hash newline (#29204) (#29299)

Backport #29204

Co-authored-by: Robin Schoonover <robin@cornhooves.org>
9 months agoAlways write proc-receive hook for all git versions (#29287) (#29291)
wxiaoguang [Wed, 21 Feb 2024 11:08:34 +0000 (19:08 +0800)]
Always write proc-receive hook for all git versions (#29287) (#29291)

Backport #29287

9 months agoDo not show delete button when time tracker is disabled (#29257) (#29279)
Zettat123 [Tue, 20 Feb 2024 09:11:01 +0000 (17:11 +0800)]
Do not show delete button when time tracker is disabled (#29257) (#29279)

Backport #29257
Fix #29233

The delete button of time logs won't be shown when the time tracker is
disabled.

![image](https://github.com/go-gitea/gitea/assets/15528715/5cc4e0c9-d2f9-4b8f-a2f5-fe202b94c191)

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
9 months agoFix missed edit issues event for actions (#29237) (#29251)
Lunny Xiao [Tue, 20 Feb 2024 03:13:05 +0000 (11:13 +0800)]
Fix missed edit issues event for actions (#29237) (#29251)

Fix #29213
Backport #29237

9 months agoDisallow merge when required checked are missing (#29143) (#29268)
Markus Amshove [Mon, 19 Feb 2024 20:48:17 +0000 (21:48 +0100)]
Disallow merge when required checked are missing (#29143) (#29268)

backport #29143

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoWorkaround to clean up old reviews on creating a new one (#28554) (#29264)
6543 [Mon, 19 Feb 2024 16:48:58 +0000 (17:48 +0100)]
Workaround to clean up old reviews on creating a new one (#28554) (#29264)

close  #28542
backport #28554

---
*Sponsored by Kithara Software GmbH*

9 months agoFix bug when the linked account was disactived and list the linked accounts (#29263)
Lunny Xiao [Mon, 19 Feb 2024 15:23:47 +0000 (23:23 +0800)]
Fix bug when the linked account was disactived and list the linked accounts (#29263)

The bug has been fixed on v1.22 but not backport to v1.21.
This original PR have many refactors so I don't think it's necessary to
backport all of them.

Fix #28667

9 months agoExplained where create issue/PR template (#29035)
Km [Mon, 19 Feb 2024 14:57:25 +0000 (15:57 +0100)]
Explained where create issue/PR template (#29035)

For some user (as me), documentation lack of precision about where to
store issue/pr template.

I propose an enhancement about this point. With bold exergue and
precision about server itself.

I've found some user with same interrogation as :
https://forum.gitea.com/t/issue-template-directory/3328

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
9 months agoDo not use lower tag names to find releases/tags (#29261) (#29262)
Jason Song [Mon, 19 Feb 2024 10:09:36 +0000 (18:09 +0800)]
Do not use lower tag names to find releases/tags (#29261) (#29262)

Backport #29261.

Fix #26090, see
https://github.com/go-gitea/gitea/issues/26090#issuecomment-1952013206

Since `TagName` stores the original tag name and `LowerTagName` stores
the lower tag name, it doesn't make sense to use lowercase tags as
`TagNames` in `FindReleasesOptions`.

https://github.com/go-gitea/gitea/blob/5e72526da4e915791f03af056890e16821bde052/services/repository/push.go#L396-L397

While the only other usage looks correct:

https://github.com/go-gitea/gitea/blob/5e72526da4e915791f03af056890e16821bde052/routers/web/repo/repo.go#L416

9 months agoConvert visibility to number (#29226) (#29244)
Tim-Nicas Oelschläger [Sun, 18 Feb 2024 18:51:00 +0000 (19:51 +0100)]
Convert visibility to number (#29226) (#29244)

Backport #29226

Don't throw error while creating user (Fixes #29218)

---

The backport info from Giteabot
https://github.com/go-gitea/gitea/pull/29226#issuecomment-1951341322
needs to specify the version, because the default is v1.18

9 months agoLoad outdated comments when (un)resolving conversation on PR timeline (#29203) (...
Jimmy Praet [Sun, 18 Feb 2024 06:58:26 +0000 (07:58 +0100)]
Load outdated comments when (un)resolving conversation on PR timeline (#29203) (#29221)

Backport #29203

Relates to #28654, #29039 and #29050.

The "show outdated comments" flag should only apply to the file diff
view.
On the PR timeline, outdated comments are always shown. So they should
also be loaded when (un)resolving a conversation on the timeline page.

9 months agoMake submit event code work with both jQuery event and native event (#29223) (#29234)
wxiaoguang [Sun, 18 Feb 2024 06:36:41 +0000 (14:36 +0800)]
Make submit event code work with both jQuery event and native event (#29223) (#29234)

Backport #29223 (no conflict)

9 months agoOnly delete scheduled workflows when needed (#29091) (#29235)
Zettat123 [Sun, 18 Feb 2024 06:31:05 +0000 (14:31 +0800)]
Only delete scheduled workflows when needed (#29091) (#29235)

Backport #29091

Fix #29040

`handleSchedules` should be called only if `DetectWorkflows` should
detect schedule workflows

9 months agoFix push to create with capitalize repo name (#29090) (#29206)
Lunny Xiao [Sat, 17 Feb 2024 12:06:55 +0000 (20:06 +0800)]
Fix push to create with capitalize repo name (#29090) (#29206)

Fix #29073
Backport #29090

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
9 months agorm outdated docs from some languages (#27530) (#29208)
Lunny Xiao [Sat, 17 Feb 2024 11:44:33 +0000 (19:44 +0800)]
rm outdated docs from some languages (#27530) (#29208)

backport #27530 to make pull request lint happy
https://github.com/go-gitea/gitea/actions/runs/7939560756/job/21679856929?pr=29206
since #29106

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
9 months agoRefactor git version functions and check compatibility (#29155) (#29157)
wxiaoguang [Sat, 17 Feb 2024 02:47:18 +0000 (10:47 +0800)]
Refactor git version functions and check compatibility (#29155) (#29157)

Backport #29155 with an extra change: tolerate the git 2.43.1 GIT_FLUSH
bug in Gitea 1.21.x, more details in the comment of repo_attribute.go

Manually tested with git 2.43.1 and an old git (2.39.2)

9 months agoRework spellchecking, add lint-spell (#29112)
silverwind [Fri, 16 Feb 2024 02:42:26 +0000 (03:42 +0100)]
Rework spellchecking, add lint-spell (#29112)

Backport clean cherry-picks of
https://github.com/go-gitea/gitea/commit/9c39f8515fa88d644736c6773d7a05d070a02e82
and
https://github.com/go-gitea/gitea/commit/c7a21cbb0c5f8302495fa24baf218dc3462de2c5
onto 1.21.

- Use maintained fork https://github.com/golangci/misspell
- Rename `mispell-check` to `lint-spell`, add `lint-spell-fix`
- Run `lint-spell` in separate actions step
- Lint more files, fix discovered issues
- Remove inaccurate and outdated info in docs (we do not need GOPATH for
tools anymore)

Maybe later we can add more spellchecking tools, but I have not found
any good ones yet.

9 months agoUse ghost user if user was not found (#29161) (#29169)
KN4CK3R [Wed, 14 Feb 2024 17:51:51 +0000 (18:51 +0100)]
Use ghost user if user was not found (#29161) (#29169)

Backport #29161

9 months agoRefactor issue template parsing and fix API endpoint (#29069) (#29140)
wxiaoguang [Wed, 14 Feb 2024 01:32:31 +0000 (09:32 +0800)]
Refactor issue template parsing and fix API endpoint (#29069) (#29140)

Backport #29069

The old code `GetTemplatesFromDefaultBranch(...) ([]*api.IssueTemplate,
map[string]error)` doesn't really follow Golang's habits, then the
second returned value might be misused. For example, the API function
`GetIssueTemplates` incorrectly checked the second returned value and
always responds 500 error.

This PR refactors GetTemplatesFromDefaultBranch to
ParseTemplatesFromDefaultBranch and clarifies its behavior, and fixes
the API endpoint bug, and adds some tests.

And by the way, add proper prefix `X-` for the header generated in
`checkDeprecatedAuthMethods`, because non-standard HTTP headers should
have `X-` prefix, and it is also consistent with the new code in
`GetIssueTemplates`