20287 Commits

Author SHA1 Message Date
silverwind
09a88fb17e Misc typescript tweaks (#36523)
Some minor refactors, disable one obsolete lint rule, fix another. The
tribute type issue is not fully fixed and I'm pretty sure it must be an
error in their types.
2026-02-10 05:09:56 +00:00
wxiaoguang
8cc8150922 Use full-file highlighting for diff sections (#36561)
* Fix #35252
* Fix #35999
* Improve diff rendering, don't add unnecessary "added"/"removed" tags for a full-line change
* Also fix a "space trimming" bug in #36539 and add tests
* Use chroma "SQL" lexer instead of "MySQL" to workaround a bug (35999)
2026-02-10 03:29:28 +00:00
Tyrone Yeh
269bc1b112 fix(diff): reprocess htmx content after loading more files (#36568)
The "Show more files" button replaces `#diff-incomplete` with newly
loaded diff file boxes.
The inserted HTML may contain htmx attributes, but they are not
processed after insertion.

### Solution
Wrap the incomplete diff placeholder with a temporary wrapper so we can
call `htmx.process()` on the newly inserted content.
After processing, unwrap the wrapper to keep the DOM structure
unchanged.

### Testing
- Open a large PR diff page where `Diff.IsIncomplete` is true
- Click "Show more files"
- Verify newly loaded file boxes behave correctly (htmx-related features
work as expected)

<img width="927" height="278" alt="image"
src="https://github.com/user-attachments/assets/54f2b4f2-c0e1-483c-9e26-79a2838e98ee"
/>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-10 01:20:20 +00:00
GiteaBot
f73e45b4ba [skip ci] Updated translations via Crowdin 2026-02-10 00:55:46 +00:00
silverwind
cf7e49ecdd Add wrap to runner label list (#36565) 2026-02-09 22:39:06 +00:00
yshyuk
94437eadd9 fix: add dnf5 command for Fedora in RPM package instructions (#36527)
Add support for Fedora 41+ which uses dnf5 with different command syntax
for adding repositories.

- **dnf4 (RHEL/Rocky):** `dnf config-manager --add-repo <URL>`
- **dnf5 (Fedora 41+):** `dnf config-manager addrepo
--from-repofile=<URL>`

Closes #35330
2026-02-09 16:14:02 +00:00
Sebastian Ertz
36ced5dc8c Enable pagination on GiteaDownloader.getIssueReactions() (#36549)
And update code.gitea.io/sdk/gitea to v0.23.2

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2026-02-09 15:49:05 +01:00
ChristopherHX
34b34d2328 Refactor merge conan and container auth preserve actions taskID (#36560)
* Remove duplicated code
* Allow further ActionsUser package permission checks

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-09 03:04:56 +00:00
Tyrone Yeh
c401cda108 Fix assignee sidebar links and empty placeholder after #32465 refactor (#36559)
Follow-up to #32465: Fix the assignee sidebar after the selector
refactor.


Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-08 21:00:18 +00:00
wxiaoguang
08b7a30867 Fix various version parsing problems (#36553)
1. handle non-release git verions (not semver)
2. fix rubygems version "0" handling (only ">=" can be omitted)
3. lazy compile the regexp to improve performance
4. make test data maintainable, use origin source code instead of compressed binary
2026-02-08 20:25:30 +00:00
wxiaoguang
2ff4f4a909 Fix highlight diff result (#36539)
Fix #36536

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-08 16:48:52 +00:00
ChristopherHX
f65df2a69b Refactor Nuget Auth to reuse Basic Auth Token Validation (#36558)
* Implicitly handle Actions Task Token for Nuget Api Keys
* Support same tokens as Basic Auth in Nuget Api Key Header

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-08 14:43:05 +00:00
Sebastian Ertz
daf0483ef2 Update go dependencies (#36548) 2026-02-08 12:01:37 +00:00
Hypo
ef529de0ac Prevent navigation keys from triggering actions during IME composition (#36540)
Fixes  #36532 

Refined the Enter key trigger logic in the repository filter to prevent
actions during IME composition.

By checking the e.isComposing property, the filter now correctly
distinguishes between "confirming an IME candidate" and "submitting the
search." This prevents premature search triggers when users press Enter
to select Chinese/Japanese characters.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-08 14:39:09 +08:00
wxiaoguang
a60201a071 Fix various mermaid bugs (#36547)
* Fix #36515
* Fix #23076
* Remove unnecessary `mermaid.parse`
* Fix data race when using `data-render-done`
* Remove unnecessary `Promise.all`
* Fix duplicate `load` event and duplicate SVG node rendering
* Remove unnecessary `IntersectionObserver`
* Add `bindFunctions` call, the old comment seems not true
2026-02-08 12:21:11 +08:00
silverwind
49e6d5f6d6 Add elk layout support to mermaid (#36486)
Fixes: https://github.com/go-gitea/gitea/issues/34769

This allows the user to opt-in to using `elk` layouts using either YAML
frontmatter or `%%{ init` directives inside the markup code block. The
default layout is not changed.

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-07 02:22:57 +00:00
Louis
e2104a1dd5 Allow configuring default PR base branch (fixes #36412) (#36425)
This adds a per-repository default PR base branch and wires it through
PR entry points. It updates compare links and recently pushed branch
prompts to respect the configured base branch, and prevents auto-merge
cleanup from deleting the configured base branch on same-repo PRs.

## Behavior changes
- New PR compare links on repo home/issue list and branch list honor the
configured default PR base branch.
- The "recently pushed new branches" prompt now compares against the
configured base branch.
- Auto-merge branch cleanup skips deleting the configured base branch
(same-repo PRs only).

---------

Signed-off-by: Louis <116039387+tototomate123@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-02-07 01:34:29 +00:00
GiteaBot
0dacd956fb [skip ci] Updated translations via Crowdin 2026-02-07 00:45:30 +00:00
silverwind
915b44810d Color command/error logs in Actions log (#36538)
Support `[command]` and `##[error]` log command

------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-06 23:05:32 +08:00
TheFox0x7
403a73dca0 Add paging headers (#36521)
Adds support for paging in admin/hooks api endpoint

fixes: https://github.com/go-gitea/gitea/issues/36516

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: techknowlogick <matti@mdranta.net>
2026-02-06 13:12:05 +00:00
Tyrone Yeh
ef9c19691d Fix issues filter dropdown showing empty label scope section (#36535)
The issues filter dropdown always rendered the label scope divider and
header, even when .ExclusiveLabelScopes was empty.

This PR wraps the label scope section with a conditional so the
divider/header and scope entries are only displayed when scopes exist.

Before

The dropdown showed a divider and “Label” header even when there were no
exclusive label scopes available.
<img width="521" height="569" alt="image"
src="https://github.com/user-attachments/assets/9766df6b-c11b-46f3-aabc-9fa5f4ca767d"
/>

After

The label scope section is hidden entirely when .ExclusiveLabelScopes is
empty, keeping the dropdown clean and consistent.
<img width="329" height="485" alt="image"
src="https://github.com/user-attachments/assets/e9586e57-2be5-43ea-8a13-9b87c951be6f"
/>

Notes

UI-only change, no behavior change to filtering logic.
2026-02-06 08:33:42 +00:00
Pascal Zimmermann
50fdd2d49a [SECURITY] fix: Adjust the toolchain version (#36537)
# Summary:

- Adjust the toolchain version to fix the security issues


```log
Vulnerability #1: GO-2026-4337
    Unexpected session resumption in crypto/tls
  More info: https://pkg.go.dev/vuln/GO-2026-4337
  Standard library
    Found in: crypto/tls@go1.25.6
    Fixed in: crypto/tls@go1.25.7
    Example traces found:
```

Signed-off-by: Pascal Zimmermann <pascal.zimmermann@theiotstudio.com>
2026-02-06 00:27:53 +01:00
Copilot
fca94bcdd7 Hide add-matcher and remove-matcher from actions job logs (#36520)
Hides `::add-matcher::`, `##[add-matcher]` and `::remove-matcher` in job
step logs. These are used to configure regex matchers to detect lines
that should trigger annotation comments on the UI, currently unsupported
by Gitea and these have no relevance to the user.

---------

Signed-off-by: silverwind <me@silverwind.io>
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-05 19:11:44 +08:00
Copilot
000d7c1ccb Improve timeline entries for WIP prefix changes in pull requests (#36518)
Add new timeline event types when the WIP prefix is added or removed,
replacing the previous ugly title change messages.

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

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-05 05:57:08 +00:00
Noel Jackson
65d93d819b fix(packages/container): data race when uploading container blobs concurrently (#36524)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-04 00:08:20 +08:00
GiteaBot
288d1f526a [skip ci] Updated translations via Crowdin 2026-02-02 00:49:41 +00:00
Copilot
7883f6dde9 Remove and forbid @ts-expect-error (#36513)
Removes `@ts-expect-error` in the code base and forbids it.

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-02 01:00:34 +08:00
Nicolas
c2dea22926 Add resolve/unresolve review comment API endpoints (#36441)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-01 12:28:28 +00:00
Copilot
584d8ef75f Fix incorrect vendored detections (#36508)
Fixes: https://github.com/go-gitea/gitea/issues/22618

`go-enry`'s `IsVendor` function marks git paths (`.gitignore`,
`.gitattributes`, `.gitmodules`), github/gitea paths (`.github/`,
`.gitea/`) as "vendored" for GitHub Linguist language statistics. This
causes these files to incorrectly display the "Vendored" tag in diff
views.

Override `go-enry`'s detection for these specific cases while preserving
its behavior for actual vendor directories.

---------

Signed-off-by: silverwind <me@silverwind.io>
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-01 10:35:51 +00:00
silverwind
9d96039027 Bump alpine to 3.23, add platforms to docker-dryrun (#36379)
- Bump alpine to 3.23 following
https://github.com/go-gitea/gitea/pull/36185 and
https://github.com/go-gitea/gitea/pull/36202.
- Enable all architectures in `docker-dryrun`.
- Tweak actions conditions to be more precise.

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2026-02-01 09:36:43 +00:00
Copilot
072de7d8cd Unify repo names in system notices (#36491)
Fixes: https://github.com/go-gitea/gitea/issues/36211

This PR fixes ensures that all system notices consistently include
repository names in the format `"Action description (owner/repo): error
message"`.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-02-01 17:06:57 +08:00
Lunny Xiao
e377da989f Allow scroll propagation outside code editor (#36502)
Fix #28479

When scrolling inside the editor and the editor has already reached the
end of its scroll area, the browser does not continue scrolling. This is
inconvenient because users must move the cursor out of the editor to
scroll the page further.

This PR enables automatic switching between the editor’s scroll and the
browser’s scroll, allowing seamless continuous scrolling.
2026-02-01 06:03:38 +00:00
wxiaoguang
7ad9bf4523 Refactor ActionsTaskID (#36503) 2026-01-31 22:01:08 -08:00
silverwind
7292ae1ed5 Update JS deps, remove knip, misc tweaks (#36499)
- Update all JS deps
- Enable a few more stylelint stylistic rules and fix issues
- Remove knip, it raised another false-positive, this tool is not worth
it when you have to babysit it like that
- Exclude @eslint/json from updating as it requires unreleased eslint 10
([ref](https://github.com/eslint/json/issues/207))
- Update labeler config for new eslint filenames
- Adjust `make help` output
- Add type checking in `stylelint.config.ts`
2026-01-31 20:58:23 +08:00
GiteaBot
8c9247e717 [skip ci] Updated translations via Crowdin 2026-01-31 00:45:54 +00:00
Copilot
0acaad1919 Fix editorconfig not respected in PR Conversation view (#36492)
Fixes: https://github.com/go-gitea/gitea/issues/24991
Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-01-30 21:41:43 +00:00
Copilot
8feabe4160 Add FOLDER_ICON_THEME configuration option (#36496)
Fixes: https://github.com/go-gitea/gitea/issues/35182
Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-01-30 20:48:56 +00:00
silverwind
a16ca3c57c Don't create self-references in merged PRs (#36490)
Fixes: https://github.com/go-gitea/gitea/issues/36488
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2026-01-30 20:12:24 +00:00
silverwind
2d1306291b Use reserved .test TLD for unit tests (#36498)
`smtp.mydomain.test` is a real domain that resolves to something and
which is being connected to while running tests. Instead, use
[.test](https://en.wikipedia.org/wiki/.test) which is guaranteed to
never be registered on the internet, so all connections to it will fail
with NXDOMAIN dns error.
2026-01-30 19:42:32 +00:00
Lunny Xiao
208cbd5a6f Fix bug when list pull request commits (#36485)
Fix #36483 

In git log/rev-list, the "..." syntax represents the symmetric
difference between two references, which is different from the meaning
of "..." in git diff (where it implies diffing from the merge base).

For listing PR commits, we must use `merge-base..head` to include only
the commits introduced by the head branch. Otherwise, commits newly
pushed to the base branch would also be included, which is incorrect.
2026-01-30 18:46:34 +00:00
silverwind
de829c7821 Update some go dependencies (#36489)
I verified the `.env.local` syntax added in
https://github.com/alecthomas/chroma/pull/1197 works as expected.
2026-01-30 11:25:30 +01:00
wxiaoguang
07ada3666b chore: add comments for "api/healthz", clean up test env (#36481)
GITEA_UNIT_TESTS_LOG_SQL is renamed to GITEA_TEST_LOG_SQL
2026-01-30 10:23:38 +08:00
Pascal Zimmermann
1adf8b3773 [SECURITY] Toolchain Update to Go 1.25.6 (#36480)
## Overview
This PR updates the Go toolchain version from `1.25.5` to `1.25.6` for
the Gitea project.

## Changes

### Toolchain Update
- **Go Toolchain**: Updated from `go1.25.5` to `go1.25.6`

This is a minor toolchain version bump that ensures the project uses the
latest patch release of Go 1.25.

## Security Improvements

While this PR primarily addresses the toolchain update, the project
maintains a strong security posture through:

### Current Security Measures
```log
Vulnerability #1: GO-2026-4342                                                                                                                                                                                                      
    Excessive CPU consumption when building archive index in archive/zip
  More info: https://pkg.go.dev/vuln/GO-2026-4342
  Standard library
    Found in: archive/zip@go1.25.5
    Fixed in: archive/zip@go1.25.6
    Example traces found:
      #1: modules/packages/nuget/metadata.go:217:25: nuget.ParseNuspecMetaData calls zip.Reader.Open                                                                                                                                

Vulnerability #2: GO-2026-4341
    Memory exhaustion in query parameter parsing in net/url
  More info: https://pkg.go.dev/vuln/GO-2026-4341
  Standard library
    Found in: net/url@go1.25.5
    Fixed in: net/url@go1.25.6
    Example traces found:
      #1: modules/storage/minio.go:284:34: storage.MinioStorage.URL calls url.ParseQuery                                                                                                                                            
      #2: routers/api/v1/repo/action.go:1640:29: repo.DownloadArtifactRaw calls url.URL.Query

Vulnerability #3: GO-2026-4340
    Handshake messages may be processed at the incorrect encryption level in
    crypto/tls
  More info: https://pkg.go.dev/vuln/GO-2026-4340
  Standard library
    Found in: crypto/tls@go1.25.5
    Fixed in: crypto/tls@go1.25.6
    Example traces found:
      #1: services/auth/source/ldap/source_search.go:129:25: ldap.dial calls ldap.Conn.StartTLS, which calls tls.Conn.Handshake                                                                                                     
      #2: modules/graceful/server.go:156:14: graceful.Server.Serve calls http.Server.Serve, which eventually calls tls.Conn.HandshakeContext
      #3: modules/lfs/content_store.go:132:27: lfs.hashingReader.Read calls tls.Conn.Read
      #4: modules/proxyprotocol/conn.go:91:21: proxyprotocol.Conn.Write calls tls.Conn.Write
      #5: modules/session/virtual.go:168:39: session.VirtualStore.Release calls couchbase.CouchbaseProvider.Exist, which eventually calls tls.Dial
      #6: services/auth/source/ldap/source_search.go:120:22: ldap.dial calls ldap.DialTLS, which calls tls.DialWithDialer
      #7: services/migrations/gogs.go:114:34: migrations.client calls http.Transport.RoundTrip, which eventually calls tls.Dialer.DialContext
```

## Breaking Changes
None expected. This is a minor toolchain patch update.
2026-01-29 07:23:11 +01:00
GiteaBot
67b457dd00 [skip ci] Updated translations via Crowdin 2026-01-29 00:46:17 +00:00
silverwind
d7dff61cbc Render merged pull request title as such in dashboard feed (#36479)
Before:

<img width="513" height="55" alt="Screenshot 2026-01-28 at 17 24 50"
src="https://github.com/user-attachments/assets/ef28d87a-9a52-4762-9ddc-c3934f5cfc7a"
/>

After:

<img width="509" height="64" alt="Screenshot 2026-01-28 at 17 24 39"
src="https://github.com/user-attachments/assets/bc55c828-7813-47be-bef8-23eeb51bd513"
/>
2026-01-29 01:40:07 +01:00
Sebastian Ertz
b500b7cfed Correct spacing between username and bot label (#36473) 2026-01-28 16:22:37 +01:00
Lunny Xiao
bf8d11bb21 Fix oauth2 s256 (#36462) 2026-01-28 06:42:07 +01:00
silverwind
224b7881d9 Forbid localStorage access in eslint (#36461)
Followup to
59f812bc1c,
enforce using our localStorage wrapper in eslint.

Also did a few tweaks in the eslint config, like removing the incomplete
list of globals, this is a non-issue with typescript.

---------

Signed-off-by: silverwind <me@silverwind.io>
2026-01-27 19:59:51 +00:00
Lunny Xiao
1463426a27 Use merge tree to detect conflicts when possible (#36400)
In Git 2.38, the `merge-tree` command introduced the `--write-tree`
option, which works directly on bare repositories. In Git 2.40, a new parameter `--merge-base` introduced so we require Git 2.40 to use the merge tree feature.

This option produces the merged tree object ID, allowing us to perform
diffs between commits without creating a temporary repository. By
avoiding the overhead of setting up and tearing down temporary repos,
this approach delivers a notable performance improvement.

It also fixes a possible situation that conflict files might be empty
but it's a conflict status according to
https://git-scm.com/docs/git-merge-tree#_mistakes_to_avoid

Replace #35542

---------

Signed-off-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-27 11:57:20 -08:00
GiteaBot
125257eacf [skip ci] Updated translations via Crowdin 2026-01-27 00:42:45 +00:00