Commit Graph
100 Commits
Author SHA1 Message Date
26a618ac1a pull: Fix CODEOWNERS absolute path matching. (#37244) (#37264)
Backport #37244 by @JoeGruffins

Patterns starting with "/" (e.g. /docs/.*\.md) never matched because git
returns relative paths without a leading slash. Strip the leading "/"
before compiling the regex since the ^...$ anchoring already provides
root-relative semantics.

closes #28107

Co-authored-by: JoeGruffins <34998433+JoeGruffins@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-04-17 23:02:28 +00:00
Giteabotandwxiaoguang b191cf7e77 Fix user ssh key exporting and tests (#37256) (#37258)
Backport #37256 by wxiaoguang

1. Make sure OmitEmail won't panic
2. SSH principal keys are not for signing or authentication

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-04-18 03:13:41 +08:00
4de12baf9b Fix commit title rendering in action run and blame (#37243) (#37251)
Backport #37243 by @silverwind

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com>
2026-04-17 15:25:42 +02:00
2aca966c5f Fix incorrect concurrency check (#37205) (#37215)
Backport #37205 by @Zettat123

This bug was identified in
https://github.com/go-gitea/gitea/pull/37119/changes#diff-37655a02d5a44d5c0e3e19c75fb58adb47a8e7835cbd619345d5b556292935a7L180

Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2026-04-14 17:58:31 +00:00
Giteabotandwxiaoguang df0ad4e8c1 Fix UI regression (#37218) (#37219)
Backport #37218 by wxiaoguang

Fix  #37213

Also fix the misaligned tags, remove unused classes, etc.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-04-14 23:59:31 +08:00
68f5e40e46 fix(api): handle missing base branch in PR commits API (#37193) (#37203)
Backport #37193 by @Mohit25022005

fix(api): handle missing base branch in PR commits API

Closes #36366

Previously, the PR commits API returned a 500 Internal Server Error
when the base branch was missing due to an unhandled git "bad revision"
error.

This change:
- Checks for base branch existence before performing git operations
- Returns 404 when the base branch does not exist
- Prevents git errors from surfacing as 500 responses

This improves API robustness and aligns behavior with expected error
handling.

Tested locally by:
- Creating a pull request
- Deleting the base branch
- Verifying that the API returns 404 instead of 500

Co-authored-by: Mohit Swarnkar <mohitswarnkar13@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2026-04-13 23:42:11 +02:00
d1be5c3612 Fix encoding for Matrix Webhooks (#37190) (#37201)
Backport #37190 by @bircni

`url.PathEscape` unnecessarily encodes ! to %21, causing Matrix
homeservers to reject the request with 401. Replace %21 back to ! after
escaping.

Fixes #36012

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Nicolas <bircni@icloud.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-04-13 22:26:32 +02:00
8687faaf3a Always show owner/repo name in compare page dropdowns (#37172) (#37200)
Backport #37172 by @xingxing21

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

The fix is a template-only change in
[templates/repo/diff/compare.tmpl:16-25](vscode-webview://1ca9j6f1e3qtaf59o0cr4ind65ulf8mevvbbbq88int1gg2lncar/templates/repo/diff/compare.tmpl#L16-L25).

Before, the display names were built with conditional logic:

All four variables defaulted to just the owner name (Examples)
$HeadCompareName was only upgraded to owner/repo format in two narrow
cases:
Same org, different repos
A root repo exists with the same owner as the head repo
All other cases (same-repo PRs, cross-org PRs) got owner-only labels
After, all four variables are unconditionally set to owner/repo format
using printf "%s/%s":

```
- {{$BaseCompareName := printf "%s/%s" $.BaseName $.Repository.Name -}}
- {{- $HeadCompareName := printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}}
- {{- $OwnForkCompareName := "" -}}
- {{- if .OwnForkRepo -}}
-	{{- $OwnForkCompareName = printf "%s/%s" .OwnForkRepo.OwnerName .OwnForkRepo.Name -}}
- {{- end -}}
- {{- $RootRepoCompareName := "" -}}
- {{- if .RootRepo -}}
-	{{- $RootRepoCompareName = printf "%s/%s" .RootRepo.OwnerName .RootRepo.Name -}}
- {{- end -}}

+ {{$BaseCompareName := $.Repository.FullName -}}
+ {{$HeadCompareName := $.HeadRepo.FullName -}}
+ {{$OwnForkCompareName := "" -}}
+ {{if $.OwnForkRepo -}}
+	{{$OwnForkCompareName = $.OwnForkRepo.FullName -}}
+ {{end -}}
+ {{$RootRepoCompareName := "" -}}
+ {{if $.RootRepo -}}
+	{{$RootRepoCompareName = $.RootRepo.FullName -}}
+ {{end -}}
```

These variables drive the labels in the base and head branch selector
buttons and their dropdown items. No backend changes were needed —
$.BaseName, $.Repository.Name, $.HeadRepo.OwnerName, and $.HeadRepo.Name
were already available in the template context.

Co-authored-by: Xing Hong <39619359+xingxing21@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-04-13 18:42:56 +00:00
789a3d3a4d fix(api): handle fork-only commits in compare API (#37185) (#37199)
Backport #37185 by @Mohit25022005

Fix 500 error when comparing branches across fork repositories

## Problem

The compare API returns a 500 Internal Server Error when comparing
branches where the head commit exists only in the fork repository.

## Cause

The API was using the base repository's GitRepo and repository context
when converting commits. This fails when the commit does not exist in
the base repository, resulting in a "fatal: bad object" error.

## Solution

Use the head repository and HeadGitRepo when available to ensure commits
are resolved in the correct repository context.

## Result

* Fixes "fatal: bad object" error
* Enables proper comparison between base and fork repositories
* Prevents 500 Internal Server Error

Fixes #37168

Co-authored-by: Mohit Swarnkar <mohitswarnkar13@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-04-13 18:01:44 +00:00
b37e098ff0 Indicate form field readonly via background, fix RunUser config (#37175, #37180) (#37184)
Backport #37175 by @silverwind

The `Run As Username` field on the install page was a `readonly` input
that looked editable but wasn't, confusing users. Style `readonly`
inputs with a subtle background, matching other frameworks.

<img width="735" height="131" alt="image"
src="https://github.com/user-attachments/assets/cb76ce71-faab-4300-811e-e4c503b59f9a"
/>

Backport #37180

The comment "so just use current one if config says default" is not
right anymore: "git" isn't the "default" value of RunUser (Comment out
app.example.ini #15807). The RunUser's value is from current session's
username.

Fixes #37174

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-04-12 18:53:09 -07:00
f9b808a8d2 Remove dead CSS rules (#37173) (#37177)
Backport #37173 by @silverwind

Remove CSS rules whose HTML classes/IDs are no longer referenced in any
template, Go source, or JavaScript/TypeScript file:

- `.archived-icon`: removed from templates in c85bb62635
- `.bottom-line`: removed from blame rendering in 9c6aeb47f7
- `.commit-status-link`: removed from templates in f3c4baa84b
- `.instruct-toggle`: removed from templates in 75e85c25c1
- `.runner-new-text`, `#runner-new`: never referenced outside CSS
- `.ap-terminal`: stale, asciinema-player uses `.ap-term`, still not
needed
- `.scrolling.dimmable.dimmed`: dimmer stand-in never adds this class
- `.markup span.align-center/align-right/float-left/float-right`: never
produced by any renderer, sanitizer strips class attributes
- `.markup ul.no-list`, `.markup ol.no-list`: same as above

---
This PR was written with the help of Claude Opus 4.6

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-04-11 11:16:20 +00:00
0112ec9b34 Fix flaky TestCatFileBatch/QueryTerminated test (#37159) (#37178)
Backport #37159 by @silverwind

`TestCatFileBatch/QueryTerminated` relied on timing to distinguish
`os.ErrClosed` vs `io.EOF` error paths. Replace `time.Sleep`-based
synchronization with a channel-based hook on pipe close, making both
error paths fully deterministic regardless of CI runner speed.

Ref:
https://github.com/go-gitea/gitea/actions/runs/24193070536/job/70615366804

---
This PR was written with the help of Claude Opus 4.6

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-04-11 13:14:35 +02:00
7a7376dfc8 Implement logout redirection for reverse proxy auth setups (#36085) (#37171)
Backport #36085 by @eliroca

When authentication is handled externally by a reverse proxy SSO
provider, users can be redirected to an external logout URL or relative
path defined on the reverse proxy.

Co-authored-by: Elisei Roca <eroca@suse.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-04-10 16:49:55 +00:00
fc5e0ec877 Add missing //nolint:depguard (#37162) (#37170)
Backport #37162 by @silverwind

When running `golangci-lint` without `GOEXPERIMENT=jsonv2`, a lint error
`import 'encoding/json' is not allowed` is seen.

All other files in the module that import `encodings/json` have
`//nolint` already, so add it.

---
This PR was written with the help of Claude Opus 4.6

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
2026-04-10 16:18:18 +02:00
4eca71d6d4 Report structurally invalid workflows to users (#37116) (#37164)
Backport #37116 by @bircni

`model.ReadWorkflow` succeeds for YAML that is syntactically valid but
fails deeper parsing in `jobparser.Parse` (e.g. blank lines inside `run:
|` blocks cause a SetJob round-trip error). Add
`ValidateWorkflowContent` which runs the full `jobparser.Parse` to catch
these cases, and use it in the file view, the actions workflow list, and
the workflow detection loop so users see the error instead of silently
getting a 500 or a dropped workflow.

Fixes #37115

Signed-off-by: Nicolas <bircni@icloud.com>
Co-authored-by: Nicolas <bircni@icloud.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-04-09 20:57:04 +00:00
a2283a0c03 Clean up and improve non-gitea js error filter (#37148) (#37155)
Backport #37148 by @silverwind

1. Filter out errors that contain `chrome-extension://` etc protocols
2. Extract filtering into its own function and test it
3. Fix the `window.config.assetUrlPrefix` mock, guaranteed to end with
`/assets`
4. Remove useless `??` and `?.` for properties that always exist

---
This PR was written with the help of Claude Opus 4.6

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
2026-04-09 14:35:07 +02:00
3e6b9e5312 Bump min go version to 1.26.2 (#37139) (#37143)
Backport #37139 by @silverwind

Update Go from 1.26.1 to 1.26.2 to fix 6 stdlib vulnerabilities:
- GO-2026-4947: `crypto/x509` chain building
- GO-2026-4946: `crypto/x509` policy validation
- GO-2026-4870: `crypto/tls` KeyUpdate DoS
- GO-2026-4869: `archive/tar` unbounded allocation
- GO-2026-4866: `crypto/x509` name constraints bypass
- GO-2026-4865: `html/template` XSS

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
2026-04-08 16:27:32 +00:00
GiteaBot c9669594a8 [skip ci] Updated translations via Crowdin 2026-04-05 00:57:43 +00:00
GiteaBot 4fa319b9dc [skip ci] Updated translations via Crowdin 2026-04-03 00:53:56 +00:00
GiteaBot 12737883ba [skip ci] Updated translations via Crowdin 2026-03-27 00:53:48 +00:00
GiteaBot ffa626b585 [skip ci] Updated translations via Crowdin 2026-03-26 00:53:31 +00:00
GiteaBot c5e196dedb [skip ci] Updated translations via Crowdin 2026-03-24 00:45:32 +00:00
GiteaBot 79f96b3e24 [skip ci] Updated translations via Crowdin 2026-03-19 00:50:44 +00:00
GiteaBot d6496c6156 [skip ci] Updated translations via Crowdin 2026-03-18 00:50:32 +00:00
GiteaBot 356f589f0b [skip ci] Updated translations via Crowdin 2026-03-11 00:45:56 +00:00
GiteaBot eb020a9d27 [skip ci] Updated translations via Crowdin 2026-03-09 00:49:16 +00:00
GiteaBot f250138f57 [skip ci] Updated translations via Crowdin 2026-03-07 00:46:12 +00:00
GiteaBot b874e0d8e5 [skip ci] Updated translations via Crowdin 2026-03-04 00:47:08 +00:00
GiteaBot 48a3a47741 [skip ci] Updated translations via Crowdin 2026-03-01 00:55:03 +00:00
GiteaBot d19d4da5ce [skip ci] Updated translations via Crowdin 2026-02-25 00:51:54 +00:00
GiteaBot 4ca4217b3d [skip ci] Updated translations via Crowdin 2026-02-16 00:50:05 +00:00
GiteaBot a6282c98d7 [skip ci] Updated translations via Crowdin 2026-02-15 00:52:30 +00:00
GiteaBot ce61d6d99d [skip ci] Updated translations via Crowdin 2026-02-14 00:47:43 +00:00
GiteaBot f73e45b4ba [skip ci] Updated translations via Crowdin 2026-02-10 00:55:46 +00:00
GiteaBot 0dacd956fb [skip ci] Updated translations via Crowdin 2026-02-07 00:45:30 +00:00
GiteaBot 288d1f526a [skip ci] Updated translations via Crowdin 2026-02-02 00:49:41 +00:00
GiteaBot 8c9247e717 [skip ci] Updated translations via Crowdin 2026-01-31 00:45:54 +00:00
GiteaBot 67b457dd00 [skip ci] Updated translations via Crowdin 2026-01-29 00:46:17 +00:00
GiteaBot 125257eacf [skip ci] Updated translations via Crowdin 2026-01-27 00:42:45 +00:00
GiteaBot a3a3e581aa [skip ci] Updated translations via Crowdin 2026-01-22 00:41:46 +00:00
GiteaBot 987d82b038 [skip ci] Updated translations via Crowdin 2026-01-20 00:39:58 +00:00
GiteaBot 48d5adb39c [skip ci] Updated translations via Crowdin 2026-01-12 00:42:33 +00:00
GiteaBot 78ad28d052 [skip ci] Updated translations via Crowdin 2026-01-04 00:45:02 +00:00
GiteaBot 85dd16b3fc [skip ci] Updated translations via Crowdin 2025-12-29 00:43:22 +00:00
GiteaBot fbbed8c4c4 [skip ci] Updated translations via Crowdin 2025-12-25 21:37:43 +00:00
GiteaBot 5151e30fb7 [skip ci] Updated translations via Crowdin 2025-12-21 17:09:57 +00:00
GiteaBot bf0b377879 [skip ci] Updated translations via Crowdin 2025-12-21 00:42:41 +00:00
GiteaBot d3656ebd95 [skip ci] Updated translations via Crowdin 2025-12-20 00:37:17 +00:00
GiteaBot 0a9c09879d [skip ci] Updated translations via Crowdin 2025-12-19 00:39:05 +00:00
GiteaBot d19db18ee7 [skip ci] Updated translations via Crowdin 2025-12-17 00:37:08 +00:00
GiteaBot 01351cc6c7 [skip ci] Updated translations via Crowdin 2025-12-11 00:39:32 +00:00
GiteaBot b41ccb0627 [skip ci] Updated translations via Crowdin 2025-12-07 00:42:24 +00:00
GiteaBot 97cb4409fb [skip ci] Updated translations via Crowdin 2025-12-04 00:38:21 +00:00
GiteaBot 1e777f92c7 [skip ci] Updated translations via Crowdin 2025-12-02 00:38:36 +00:00
GiteaBot 1816c7f9c1 [skip ci] Updated translations via Crowdin 2025-11-27 00:36:53 +00:00
GiteaBot 4c51acb26b [skip ci] Updated translations via Crowdin 2025-11-21 00:37:11 +00:00
GiteaBot adece922f1 [skip ci] Updated translations via Crowdin 2025-11-20 00:36:24 +00:00
GiteaBot 1dac4d13f3 [skip ci] Updated translations via Crowdin 2025-11-02 00:39:27 +00:00
GiteaBot 73e229eb42 [skip ci] Updated translations via Crowdin 2025-10-30 00:37:08 +00:00
GiteaBot 87d670c96b [skip ci] Updated translations via Crowdin 2025-10-27 00:39:11 +00:00
GiteaBot 2a6af15448 [skip ci] Updated translations via Crowdin 2025-10-26 00:38:59 +00:00
GiteaBot c28aab6714 [skip ci] Updated translations via Crowdin 2025-10-22 00:36:55 +00:00
GiteaBot ebd88af075 [skip ci] Updated translations via Crowdin 2025-10-17 00:34:59 +00:00
GiteaBot 22b92e30ca [skip ci] Updated translations via Crowdin 2025-10-13 00:37:21 +00:00
GiteaBot 94d99c9c3c [skip ci] Updated translations via Crowdin 2025-10-10 00:34:09 +00:00
GiteaBot 851d8f9f7c [skip ci] Updated translations via Crowdin 2025-10-05 00:38:21 +00:00
GiteaBot 4e7a97dea0 [skip ci] Updated translations via Crowdin 2025-10-04 00:32:04 +00:00
GiteaBot 8ad2a538da [skip ci] Updated translations via Crowdin 2025-09-26 00:34:11 +00:00
GiteaBot 0b706b0825 [skip ci] Updated translations via Crowdin 2025-09-24 00:34:35 +00:00
GiteaBot 4730bb596c [skip ci] Updated translations via Crowdin 2025-09-17 00:33:50 +00:00
GiteaBot 16e1207449 [skip ci] Updated translations via Crowdin 2025-09-12 00:33:19 +00:00
GiteaBot f04b9aaa1c [skip ci] Updated translations via Crowdin 2025-09-11 00:34:46 +00:00
GiteaBot fb247f640e [skip ci] Updated translations via Crowdin 2025-09-10 00:33:42 +00:00
GiteaBot 4c369c0a92 [skip ci] Updated translations via Crowdin 2025-09-09 00:34:36 +00:00
GiteaBot 0c31499498 [skip ci] Updated translations via Crowdin 2025-09-07 00:37:41 +00:00
GiteaBot 1640e9a490 [skip ci] Updated translations via Crowdin 2025-09-06 00:33:13 +00:00
GiteaBot 086ff87e58 [skip ci] Updated translations via Crowdin 2025-09-03 00:32:59 +00:00
GiteaBot 8a534132c8 [skip ci] Updated translations via Crowdin 2025-09-02 00:34:51 +00:00
GiteaBot fd7ebaf427 [skip ci] Updated translations via Crowdin 2025-09-01 00:43:05 +00:00
GiteaBot fe7883c54f [skip ci] Updated translations via Crowdin 2025-08-30 00:32:53 +00:00
GiteaBot 09c3189ab7 [skip ci] Updated translations via Crowdin 2025-08-29 00:34:50 +00:00
GiteaBot 89cc9663f8 [skip ci] Updated translations via Crowdin 2025-08-28 00:34:46 +00:00
GiteaBot 4b19e292b9 [skip ci] Updated translations via Crowdin 2025-08-23 00:34:05 +00:00
GiteaBot 6619b1ed2b [skip ci] Updated translations via Crowdin 2025-08-18 00:40:58 +00:00
GiteaBot 04017f259b [skip ci] Updated translations via Crowdin 2025-08-16 00:35:49 +00:00
GiteaBot a2e8bf5261 [skip ci] Updated translations via Crowdin 2025-08-14 00:37:39 +00:00
GiteaBot d328e00775 [skip ci] Updated translations via Crowdin 2025-08-11 00:41:48 +00:00
GiteaBot a8349c4dc3 [skip ci] Updated translations via Crowdin 2025-08-10 00:43:29 +00:00
GiteaBot ee9cd03f17 [skip ci] Updated translations via Crowdin 2025-08-08 00:40:27 +00:00
GiteaBot 93cf656974 [skip ci] Updated translations via Crowdin 2025-08-06 00:40:29 +00:00
GiteaBot 1692652d65 [skip ci] Updated translations via Crowdin 2025-08-05 00:41:30 +00:00
GiteaBot 8125633aa3 [skip ci] Updated translations via Crowdin 2025-08-04 00:44:07 +00:00
GiteaBot 1f676b36b1 [skip ci] Updated translations via Crowdin 2025-08-03 00:44:31 +00:00
GiteaBot 5050976de7 [skip ci] Updated translations via Crowdin 2025-08-02 00:38:38 +00:00
GiteaBot e01c921ee4 [skip ci] Updated translations via Crowdin 2025-08-01 00:45:25 +00:00
GiteaBot b7d8fade72 [skip ci] Updated translations via Crowdin 2025-07-30 00:39:54 +00:00
GiteaBot 3778538a1c [skip ci] Updated translations via Crowdin 2025-07-29 00:43:36 +00:00
GiteaBot 1b4d0800b4 [skip ci] Updated translations via Crowdin 2025-07-28 00:42:51 +00:00
GiteaBot 2a8ecfb002 [skip ci] Updated translations via Crowdin 2025-07-27 00:44:03 +00:00
GiteaBot c72174a43d [skip ci] Updated translations via Crowdin 2025-07-24 00:40:59 +00:00