19905 Commits

Author SHA1 Message Date
c4532101a4 fix(webhook): prevent tag events from bypassing branch filters targets #35449 (#35567)
Tag creation/deletion was triggering push webhooks even when branch
filters were configured, causing unintended pipeline executions.

This change modifies the branch filter logic to check the full ref
name directly instead of first determining if it's a "branch" event.

Fixes: Tag events now properly respect branch filters
- Add getPayloadRef() function to extract full ref names
- Update PrepareWebhook() to use direct ref matching
- Prevents refs/tags/* from matching refs/heads/* filters

Closes #35449

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2025-10-03 08:51:57 +02:00
efc48c36ff Added button to copy file name in PR files (#35509)
The merge request file viewer has a button for copying the file path,
but it is not always convenient. Often, you only want to copy the file
name, which is currently not possible. This change request adds this
capability.

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: a.kiselev <a.kiselev@reglab.ru>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-02 18:08:11 +00:00
340aed3982 Update JS and PY deps (#35565)
Updated all dependencies and did a quick test of the UI.
2025-10-02 08:45:56 +02:00
b907b9fb1a Enable a few more tsconfig options (#35553)
Enable a few more useful options in tsconfig. `noImplicitReturns` had
two cases which I've fixed. Also, partially sort the file.
2025-09-30 21:43:41 -07:00
c5d74e5869 Bump github.com/wneessen/go-mail from 0.6.2 to 0.7.1 (#35557) 2025-10-01 00:14:53 +00:00
c5332fdc55 add more routes to the "expensive" list (#35547)
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2025-09-29 17:33:28 +08:00
0f668145e9 Drop json-iterator dependency (#35544) 2025-09-28 22:30:28 +08:00
fbe80e6df2 Add proper error message if session provider can not be created (#35520)
the middleware that creates the session provider just panics if on
creation the config is wrong.
this is not catched and so you just get an cryptic stacktrace with no
point where to look at (as user).

## Before

```
2025/09/16 03:56:37 ...xer/stats/indexer.go:87:populateRepoIndexer() [I] Done (re)populating the repo stats indexer with existing repositories
2025/09/16 03:56:37 modules/ssh/ssh.go:387:Listen() [I] Adding SSH host key: /var/lib/gitea/data/ssh/gitea.rsa
2025/09/16 03:56:37 modules/ssh/init.go:26:Init() [I] SSH server started on :1234. Cipher list ([chacha20-poly1305@openssh.com aes128-ctr aes192-ctr aes256-ctr aes128-gcm@openssh.com aes256-gcm@openssh.com]), key exchange algorithms ([curve25519-sha256 ecdh-sha2-nistp256 ecdh-sha2-nistp384 ecdh-sha2-nistp521 diffie-hellman-group14-sha256 diffie-hellman-group14-sha1]), MACs ([hmac-sha2-256-etm@openssh.com hmac-sha2-256 hmac-sha1])
2025/09/16 03:56:37 ...s/graceful/server.go:50:NewServer() [I] Starting new SSH server: tcp::1234 on PID: 83337
2025/09/16 03:56:38 cmd/web.go:231:func1() [F] PANIC: dial tcp 127.0.0.1:6379: connect: connection refused
gitea.com/go-chi/session@v0.0.0-20240316035857-16768d98ec96/session.go:239 (0x1cdb908)
code.gitea.io/gitea/routers/common/middleware.go:108 (0x2547f5a)
code.gitea.io/gitea/routers/web/web.go:270 (0x278b8e9)
code.gitea.io/gitea/routers/init.go:185 (0x2850d89)
code.gitea.io/gitea/cmd/web.go:211 (0x295c5ad)
code.gitea.io/gitea/cmd/web.go:262 (0x295cacb)
code.gitea.io/gitea/cmd/main.go:111 (0x2953422)
github.com/urfave/cli/v2@v2.27.2/command.go:276 (0x1cc3dfd)
github.com/urfave/cli/v2@v2.27.2/command.go:269 (0x1cc4084)
github.com/urfave/cli/v2@v2.27.2/app.go:333 (0x1cc086a)
github.com/urfave/cli/v2@v2.27.2/app.go:307 (0x2953f18)
code.gitea.io/gitea/cmd/main.go:172 (0x2953efc)
code.gitea.io/gitea/main.go:46 (0x2998498)
runtime/proc.go:283 (0x4471ca)
runtime/asm_amd64.s:1700 (0x484a20)
```

## After

```
2025/09/22 22:52:35 .../templates/htmlrenderer.go:118:initHTMLRenderer() [D] Creating static HTML Renderer
2025/09/22 22:52:35 routers/web/web.go:273:Routes() [F] common.Sessioner failed: failed to create session middleware: dial tcp 127.0.0.1:6379: connect: connection refused
```

---------

Signed-off-by: 6543 <6543@obermui.de>
2025-09-28 12:24:19 +00:00
151ef80e28 use experimental go json v2 library (#35392)
details: https://pkg.go.dev/encoding/json/v2

---------

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-09-28 08:03:36 +00:00
8106d95577 Use global lock instead of status pool for cron lock (#35507) 2025-09-27 10:11:52 -07:00
1f32170060 Move some functions to gitrepo package (#35503) 2025-09-26 10:14:20 -07:00
7bf2972379 Move GetDiverging functions to gitrepo (#35524)
Extracted from #35469

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-09-26 15:15:42 +00:00
8ad2a538da [skip ci] Updated translations via Crowdin 2025-09-26 00:34:11 +00:00
53dfbbb2ee Update issue.go with labels documentation (labels content, not ids) (#35522)
For https://github.com/go-gitea/gitea/issues/35521

---------

Signed-off-by: Fabien Benetou <fabien-services@benetou.fr>
2025-09-25 16:56:49 +00:00
d83676c97a Fix markup init after issue comment editing (#35536)
Fix #35533
2025-09-25 09:29:32 -07:00
f09bea7af1 [Fix] Trigger 'unlabeled' event when label is Deleted from PR (#34316)
This pull request updates the handling of issue label events in
workflows to distinguish between label additions and deletions,
introduces corresponding test cases, and extends the `IssuePayload`
structure to support this functionality.

### Enhancements to issue label event handling:
* Updated `matchIssuesEvent` in `modules/actions/workflows.go` to
differentiate between "labeled" and "unlabeled" events based on whether
labels were added or removed.
* Added a new field, `RemovedLabels`, to the `IssuePayload` struct in
`modules/structs/hook.go` to track labels that were removed during an
issue event.

### Testing improvements:
* Added `TestMatchIssuesEvent` in `modules/actions/workflows_test.go` to
cover scenarios such as label addition, label deletion, and label
clearing, ensuring the correct event type is triggered.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
v1.26.0-dev
2025-09-24 09:45:38 -07:00
0b706b0825 [skip ci] Updated translations via Crowdin 2025-09-24 00:34:35 +00:00
198f37e33c Move updateref and removeref to gitrepo and remove unnecessary open repository (#35511)
Extracted from #35077
`UpdateRef` and `RemoveRef` will call git commands even for gogit
version.
2025-09-19 08:04:18 -07:00
9a0ec53ee3 Stream repo zip/tar.gz/bundle achives by default (#35487)
Initial implementation of linked proposal.

* Closes #29942
* Fix #34003
* Fix #30443

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-09-19 11:51:21 +08:00
90cb5f9a1f Clean up npm dependencies (#35508)
- Remove `minimatch`, was inadvertently re-introduced in
https://github.com/go-gitea/gitea/pull/35482
- Remove `postcss-nesting`, originally introduced in
https://github.com/go-gitea/gitea/pull/29746 to support some fork, but
I'm now of the opinion we should not ship dependencies that we don't use
ourselves.
- Remove `eslint-plugin-no-jquery`, plugin is currently disabled because
of compat issues with eslint 9
(https://github.com/wikimedia/eslint-plugin-no-jquery/issues/311)
2025-09-17 21:39:44 +00:00
2f3da6d6b3 Correctly override user unitmodes (#35501)
Commit 6a97ab0af4031dd1e8fb0b272218e146b5556ac6 reworked team permission
application. The introduced logic overrode the unitModes for *every*
team a user is in, max(...) the current value and the team value
together.

The logic completely fails in case the team does not have a unit for the
specific unit type defined, in which case the logic inserted the
minimumVisibility, overriding any previous aggregation of access modes
for the unit.

This is resolved by simply always merging the unit access mode of the
team as it will simply default to None in case the team does not have a
permission defined for the unit, which will be swallowed by the max(..)
call in favour of the previous aggregated permission.
2025-09-17 12:26:58 -07:00
4730bb596c [skip ci] Updated translations via Crowdin 2025-09-17 00:33:50 +00:00
6033c47f90 Enable more markdown paste features in textarea editor (#35494)
Enable the [same paste
features](https://github.com/github/paste-markdown#paste-markdown-objects)
that GitHub has, notably the ability to paste text containing HTML links
and have them automatically turn into Markdown links. As far as I can
tell, previous paste features all work as expected.

---------

Signed-off-by: silverwind <me@silverwind.io>
2025-09-16 23:55:57 +00:00
9332ff291b Move git command to git/gitcmd (#35483)
The name cmd is already used in many places and may cause conflicts, so
I chose `gitcmd` instead to minimize potential naming conflicts.
2025-09-15 23:33:12 -07:00
fe5afcb022 Exposing TimeEstimate field in the API (#35475)
Time Estimate field is not included in the issue modification webhooks
or issue API endpoints.

This PR fixes the field for the API.

---------

Signed-off-by: Gnanakeethan Balasubramaniam <gnanakeethan@users.noreply.github.com>
Signed-off-by: Gnanakeethan Balasubramaniam <gnanakeethan@cloudparallax.com>
2025-09-16 04:32:03 +00:00
8c8eb4b6f9 Clean up npm dependencies (#35484)
- `type-fest` is replaced by our own types
- `@stylistic/eslint-plugin-js` is no longer in use, it was replaced
with `@stylistic/eslint-plugin`
- `@types/license-checker-webpack-plugin` does not apply to our forked
version and has a type stub
2025-09-15 16:34:54 +02:00
69e595cdd8 Update eslint to v9 (#35485)
Update eslint and all plugins. Many plugins still do not ship type
definitions so I had to add stubs. Also, I had to put a few typescript
error expectations because if some unknown error in the types.

`eslint-plugin-no-jquery` is disabled because it's not compatible with
eslint 9 flat config
(https://github.com/wikimedia/eslint-plugin-no-jquery/issues/311).
2025-09-14 19:15:06 +03:00
e612b9744c Revert the rspack change (#35482)
Partially revert https://github.com/go-gitea/gitea/pull/35460 until
rspack supports RISC-V
(https://github.com/web-infra-dev/rspack/issues/11656).
2025-09-14 08:37:07 +02:00
4fe1066a17 Replace gobwas/glob package (#35478)
https://github.com/gobwas/glob is unmaintained and has bugs.
2025-09-13 18:01:00 +00:00
688abac5ca Fix various typos in codebase (#35480) 2025-09-13 10:34:43 -04:00
325e059a50 Fix different behavior in status check pattern matching with double stars (#35474)
Drop the minimatch dependency, use our own glob compiler.

Fix #35473
2025-09-13 11:53:27 +08:00
866c636f52 Replace webpack with rspack (#35460)
Given that this bundler is almost a drop-in replacement to webpack, it
might be worth switching. So far it seems everything is working, but
more testing is needed, so I'm setting draft.

- Dev build time is reduced from 10s to 5s
- Prod build time is reduced from 16s to 10s
- JS output size is reduced from 21.3MB to 19.8MB
- CSS output size is increased from 778kB to 818kB
2025-09-12 19:25:59 +00:00
7a474d1c95 Don't store repo archives on gitea dump (#35467)
When running `gitea dump`, don't store the contents of
`data/repo-archive` in the output.

These archives can easily be regenerated from the repository data, and
does not need to be backed up.

Fixes #35450

---

<s>Added a `--skip-repo-archive` flag to the `gitea dump` command.

Enabling this flag will exclude the contents of `data/repo-archive` from
the dump. The implementation is similar to the other `--skip-*` flags
that excludes directories from `data`.</s>

Signed-off-by: h7x4 <h7x4@nani.wtf>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2025-09-12 16:11:24 +02:00
84812e42df Fix SSH signing key path will be displayed in the pull request UI (#35381)
Closes #35361

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-09-12 03:00:18 +00:00
16e1207449 [skip ci] Updated translations via Crowdin 2025-09-12 00:33:19 +00:00
9bb08aa822 Update image name in integration README (#35465)
Followup to https://github.com/go-gitea/gitea/pull/35402.
2025-09-11 17:56:43 +02:00
f04b9aaa1c [skip ci] Updated translations via Crowdin 2025-09-11 00:34:46 +00:00
89d7929711 Fix package link setting can only list limited repositories (#35394)
Fix #24801

<img width="1123" height="503" alt="image"
src="https://github.com/user-attachments/assets/823f4214-e08a-4506-9018-057c50e7fc52"
/>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2025-09-11 01:50:17 +02:00
593a52c2f0 Vertically center date in file view latest commit (#35456) 2025-09-10 20:20:23 +00:00
4d43d85941 Bump setup-node to v5 (#35448)
See https://github.com/actions/setup-node/releases/tag/v5.0.0

Caching is now enabled by default when `packageManager` is present in
package.json, and we have that. `cache-dependency-path` is unneccesary
because the action will automatically detect it.
2025-09-10 16:11:14 +00:00
2653ac95e0 Extend comment treepath length (#35389)
Extend the maximum length of comment.treepath from 255 to 4000
characters.

All databases supported by Gitea allow VARCHAR fields of 4000, so
compatibility is ensured. Git itself does not impose a strict limit on
path length. On Windows, the `core.longpaths` setting has already been
enabled to handle long file paths.

Fix #33716

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2025-09-10 13:31:59 +00:00
b76e69fee7 Fix overflow in notifications list (#35446)
Before:

<img width="1339" height="159" alt="Screenshot 2025-09-10 at 02 29 09"
src="https://github.com/user-attachments/assets/097f0929-f387-428f-a53d-74cf88d0b013"
/>

After:

<img width="1335" height="114" alt="Screenshot 2025-09-10 at 02 29 17"
src="https://github.com/user-attachments/assets/2185c9aa-eca0-43da-b244-674e7b81aef8"
/>
2025-09-10 13:05:35 +00:00
274f4aea7e Fix a compare page 404 bug when the pull request disabled (#35441) 2025-09-09 21:04:32 -07:00
e35e724e42 Use db.WithTx/WithTx2 instead of TxContext when possible (#35428) 2025-09-10 03:15:01 +00:00
fb247f640e [skip ci] Updated translations via Crowdin 2025-09-10 00:33:42 +00:00
47df15cabc Update JS and PY dependencies (#35444)
Tested all affected dependencies.
2025-09-10 02:30:20 +02:00
2802f96e97 check user and repo for redirects when using git via SSH transport (#35416)
fixes #30565 

When using git with a gitea hosted repository, the HTTP-Transport did
honor the user and repository redirects, which are created when renaming
a user or repo and also when transferring ownership of a repo to a
different organization. This is extremely helpful, as repo URLs remain
stable and do not have to be migrated on each client's worktree and
other places, e.g. CI at once.

The SSH transport - which I favor - did not know of these redirections
and I implemented a lookup during the `serv` command.
2025-09-09 20:13:41 +00:00
b9efbe9fe6 Fix push commits comments when changing the pull request target branch (#35386)
When changing the pull request target branch, the pushed commits
comments will not be changed resulted the number are inconsistent
between commits tab number and the pushed commits comments number.

This PR will remove all the previous pushed commits comments and
calculate new comments when changing the target branch.

Before:

<img width="928" height="585" alt="image"
src="https://github.com/user-attachments/assets/35e4d31f-31a1-4d14-83b0-1786721ab0d9"
/>

After:
<img width="816" height="623" alt="image"
src="https://github.com/user-attachments/assets/24b6dafe-9238-4e7e-833d-68472457afab"
/>
2025-09-09 19:40:54 +00:00
e4cb48a7e0 Fix bug when issue disabled, pull request number in the commit message cannot be redirected (#35420)
Fix #35419

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-09-09 12:14:06 -07:00
4c369c0a92 [skip ci] Updated translations via Crowdin 2025-09-09 00:34:36 +00:00