Commit Graph
22186 Commits
Author SHA1 Message Date
techknowlogickandcopilot-swe-agent[bot] 9cb990e83b build: bump Docker images to Alpine 3.25
Assisted-by: GitHub Copilot:Auto

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-12-03 23:53:43 +00:00
TheFox0x7 41f571bf34 fix: provide hardened suggestion for asciidoc in config (#40641)
add a warning about the renderer command dealing with untrusted input
asciidoc mode based on:
https://docs.asciidoctor.org/asciidoctor/latest/safe-modes/

---

docs: https://gitea.com/gitea/docs/pulls/670
2026-12-03 20:50:10 +00:00
Jing Luandsilverwind a21860f90e enhance(ui): align the work-in-progress merge box with GitHub (#40594)
The work-in-progress state of a pull request now uses GitHub's wording:
"Draft pull requests cannot be merged.", "Ready for review", "Still in
progress? Convert to draft" and "marked the pull request as draft".

The tooltip of the blocked merge button opens below the button, so it no
longer covers the explanation. The merge style trigger takes the
disabled look of the merge button and stays usable, as on GitHub.

Before:

<img width="600" alt="Before"
src="https://github.com/user-attachments/assets/f0720a8c-d870-45e0-9ebb-9b355a3f414d">

After:

<img width="600" alt="After"
src="https://github.com/user-attachments/assets/4abfe57e-de93-4933-9717-6e533ae801c4">

Ref: https://github.com/go-gitea/gitea/issues/40588

Assisted-by: OpenAI Codex:GPT-5
Assisted-by: Claude Code:claude-fable-5-2

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-12-03 20:24:29 +00:00
0e4d804b89 feat(acme): support EAB credentials (#39511)
ACME can now register accounts with CAs that require External Account
Binding (EAB). Set `ACME_EAB_KID` and `ACME_EAB_HMAC` in `[server]`, or
`ACME_EAB_HMAC_URI` to read the MAC key from a file.

Retries for a custom `ACME_URL` no longer go to Let's Encrypt staging.

Docs: https://gitea.com/gitea/docs/pulls/669
Fixes: https://github.com/go-gitea/gitea/issues/35549

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techknowlogick <164197+techknowlogick@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-12-03 20:20:33 +00:00
47805c4151 fix(nuget): read nuspec manifests in UTF-16 (#40619)
* Fixes #40617

---------

Signed-off-by: Batianxieshen1 <280706568+Batianxieshen1@users.noreply.github.com>
Co-authored-by: Batianxieshen1 <280706568+Batianxieshen1@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: bircni <bircni@icloud.com>
2026-12-03 13:02:25 +00:00
Eshaanandwxiaoguang 70adb24626 fix(admin): config summary shows the reverse proxy auth header when it is disabled (#40618)
Showing such config options is useless.

* Fixes #31505

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-12-03 01:45:41 +00:00
GiteaBot fd8a8611ad [skip ci] Updated translations via Crowdin 2026-12-03 00:45:50 +00:00
bdee24a7d0 refactor: use data-global-init for ComboMarkdownEditor (#40479)
## TL;DR:

For custom-init markdown editors, do nothing. For non-custom-init
markdown editors, change from an imperative scan to a declarative setup.

## Longer version

As part of the `data-global-init` migration effort, this moves
ComboMarkdownEditor's automatic setup onto `data-global-init`.

### Before

`initGlobalComboMarkdownEditor()` ran a one-off startup sweep of its
own: `queryElems(document, '.combo-markdown-editor:not(.custom-init)',
...)`. The editor template relied on that page-wide selector, with the
`custom-init` class as an exclusion, rather than declaring its own
setup.

### After

- The editor template marks its root element with
`data-global-init="initComboMarkdownEditor"`, and the sweep is replaced
by a registered handler, like other migrated components.
- The attribute goes only on editors without `CustomInit`. `CustomInit`
editors are unchanged: they get no attribute, and their page code sets
them up as before.
- Setup now goes through the shared observer, so the editor follows the
same rules as every other `data-global-init` component, including
elements added after page load.

### Why

- The template now names its own setup:
`data-global-init="initComboMarkdownEditor"` leads straight to the
registered handler. Before, nothing in the template said how the editor
was set up, and the `custom-init` class only meant something because of
a selector in `common-form.ts`.
- It follows the guidance in `modules/observer.ts`, which recommends
`registerGlobalInitFunc` over selector-based setup as "less efficient
and less maintainable", and removes one of the `queryElems(document,
...)` sweeps that `utils/dom.ts` marks for refactoring.
- The editor no longer needs its own page-wide query at startup: it's
picked up by the observer's single initial pass, like the other
`data-global-init` components (55 templates use it today).

### Notes

- Editors are now set up by the observer's initial sweep, which runs
after the page-specific init code rather than before it. Every direct
editor lookup (`getComboMarkdownEditor` in `repo-release.ts`,
`repo-issue-edit.ts`, `repo-issue.ts` and the monospace toggle in
`ComboMarkdownEditor.ts`) runs on a user action, so none is affected.
- This is the first step toward removing `CustomInit` entirely. That
also needs JS-only options moved into presets and setup made idempotent,
which are separate changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-12-02 20:46:29 +00:00
GiteaBot 6775931eb4 [skip ci] Updated translations via Crowdin 2026-12-02 00:42:59 +00:00
c3e978b6ed feat(api): add API to update a review (#39865)
Adds `PUT /repos/{owner}/{repo}/pulls/{index}/reviews/{id}` to update
the body of a submitted review, like GitHub's [update a
review](https://docs.github.com/en/rest/pulls/reviews#update-a-review-for-a-pull-request).

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: Claude (Opus 5.5) <noreply@anthropic.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
2026-12-01 18:15:44 +00:00
silverwind f9c53fcabf perf: stop parsing the whole diff for each PR files API page (#40453)
`GET /repos/{owner}/{repo}/pulls/{index}/files` parsed every file's
patch on each request, then returned one page. Stop parsing after the
last file of the requested page.

Median HTTP response time in ms for a 2,414-file PR, 30 files per page:

| Page | Before | After |
|---|--:|--:|
| 1 | 567 | 319 |
| 41 | 563 | 457 |
| 81 (last) | 561 | 556 |

Assisted-by: Claude Code:claude-opus-5-5
2026-12-01 11:04:11 +00:00
3ad403dc09 fix(actions): pick waiting jobs in run order (#40441)
Runners picked the waiting job that became ready first, so a job
released by `needs` queued again behind jobs of newer runs, and a run
with several stages waited out the backlog once per stage. Runners now
pick waiting jobs in the order their runs were triggered, then by job
id, so a run keeps its place across its stages, including reusable
workflow children and dynamic matrix jobs created once their `needs`
finish. A rerun is a new trigger and queues behind. Under load, a new
push waits longer for its first job, and jobs released late by approval
or a concurrency group go ahead of newer runs. The job queue page lists
jobs in the same order, and the `pickup` index becomes `(task_id,
status, run_attempt_id, id)` to serve it.

Fixes: https://github.com/go-gitea/gitea/issues/40430
Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Zettat123 <zettat123@gmail.com>
2026-12-01 04:29:31 +00:00
GiteaBot d25a2dcaf8 [skip ci] Updated translations via Crowdin 2026-12-01 00:49:12 +00:00
semanym 2256e819c9 fix(packages): serve empty conda noarch repodata when no noarch packages exist (#40582)
Conda (and libmamba) require every valid channel to serve
`noarch/repodata.json` and `noarch/repodata.json.bz2` even when empty,
while treating 404 on platform-specific subdirs as empty. Previously
`EnumeratePackages` returned 404 whenever no package files existed for
the requested subdir, causing `conda install` to fail with a 404 on
`noarch/repodata.json` whenever a channel only contained
platform-specific packages (e.g. `linux-64`).

Return HTTP 200 with an empty `RepoData` payload when the requested
subdir is `noarch` and no files exist, while keeping 404 for empty
non-`noarch` subdirs.

Fixes: https://github.com/go-gitea/gitea/issues/25554
Assisted-by: Claude Code:gemini-4-neon
2026-11-30 16:33:01 +00:00
Dickson Wuandwxiaoguang 6ab12548be fix: show the same forgot-password response while the resend limit is active (#40579)
The forgot-password page answers an unknown email with the "reset mail
sent" confirmation, which is the right call for not revealing accounts.
But for an existing local account, a second request inside the 180
second `MailResendLimit_` window sets `ResendLimited`, and because
`IsResetRequest` is already set the template renders the reset form
again instead of the confirmation. So an anonymous client can send an
address twice and tell from the second response whether it belongs to an
account. It needs the mail service enabled, nothing else.

This makes the resend-limited branch set the same `IsResetSent` /
`ResetPwdCodeLives` data as the normal and unknown-user paths. The
resend limit still holds, so no extra mail goes out.

It's the same kind of difference #36002 removed from the login errors
(#35984), just on the reset page.

Tested on a local instance with SQLite and a dummy mailer: on v28.4.0
and on main the repeat request showed the form while an unknown address
showed the confirmation; with this change all of them show the
confirmation. The `routers/web/auth` package tests pass on main and
`release/v28` with the change. It applies to `release/v28` too if you
want it backported.

I used AI tools to help find this and draft the change; I've gone over
the diff and the code path myself.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-11-30 16:06:39 +00:00
Corey Esteyandsilverwind 95032ff039 fix(pull): link the pending pull request when reopen is blocked (#40300)
When reopening or creating a pull request is blocked by an existing one
between the same branches, the error now links to it. Previously the
reopen error only showed the number and the create error didn't mention
it. Retargeting, which already linked it, now shares the same message.

The link is built in Go instead of in the translations, under new
translation keys, so other locales fall back to English instead of
garbling the link until they are retranslated.

Before:
<img width="800" height="597" alt="before"
src="https://github.com/user-attachments/assets/9f65d65e-0c62-4f1f-93bb-9021437b0d37"
/>

After:
<img width="800" height="600" alt="after"
src="https://github.com/user-attachments/assets/2aca79d2-473d-4c4d-8435-8d2c00ded00e"
/>

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

Assisted-by: Claude Code:claude-opus-5-5

---------

Signed-off-by: Corey Estey <147874433+kernelius-glitch@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-11-30 16:02:37 +00:00
Giteabotandsilverwind 0aafa878e5 chore(deps): update dependencies (#40583)
Update dependencies. chartjs-plugin-zoom 3 drops Hammer.js, which
shrinks the contributors chart bundle by about 14 KB.

Adapt to the updates: use rolldown's `bundlerTimings` instead of the
deprecated `pluginTimings`, drop an asciinema-player style override that
3.19 makes redundant, and retry the Redis session backend's startup ping
like the cache and queue setup do, because go-redis 9.24 gives up on a
refused connection sooner.

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-11-30 10:05:46 +00:00
T Mohan Adityaandsilverwind 752b24976c fix: avoid page offset overflow in PaginateSlice and ListOptions (#40572)
A huge `page` value made `(page-1)*pageSize` wrap to a negative int.
`PaginateSlice` then panicked with a slice-bounds error (e.g. the cron
and tags APIs), and `ListOptions.GetSkipTake` caused an index panic in
the pull request commits and files APIs. `PaginateSlice` now compares
the page against `len(list)/pageSize`, and `ListOptions` caps the page
so the offset stays in range.

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-11-30 08:38:54 +00:00
GiteaBot b60bf59f09 [skip ci] Updated translations via Crowdin 2026-11-30 00:37:30 +00:00
silverwindandwxiaoguang 439598a5d2 enhance(ui): make the merge box more compact (#40562)
Compress the spacing inside the merge box check list a bit.

| Before | After |
| --- | --- |
| <img width="356" height="287" alt="Merge box before"
src="https://github.com/user-attachments/assets/de88c23c-8162-436d-9fe3-e9eb26bf34f6"
/> | <img width="356" height="287" alt="Merge box after"
src="https://github.com/user-attachments/assets/c67179c5-4500-48f4-b9af-f32916f40a15"
/> |


Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-11-29 11:02:10 +00:00
Christmasandwxiaoguang 943eb1073d fix(mirror): skip duplicate pull mirror syncs instead of blocking workers (#40550)
Switch `SyncPullMirror` to `globallock.TryLock` (matching
`services/cron/tasks.go`) so duplicate requests return immediately when
a sync for that repository is already in progress.

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

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-11-29 08:31:55 +00:00
Vu Nguyen Anh Tuanandwxiaoguang 024af0ebca enhance(repo): make Commit Graph discoverable and fix UI (#40570)
The commit graph was only discoverable from the Commits page, which made
an existing feature hard to find. Add the same "Commit Graph" button to
the Activity page header beside the period selector and keep the
original button in place.

<table><tr><td><img
src="https://raw.githubusercontent.com/TuanNancy/gitea/assets/pr-40570-screenshots/screenshots/pr-40570-before.png"
width="512" alt="Before: Activity header without Commit
Graph"></td><td><img
src="https://raw.githubusercontent.com/TuanNancy/gitea/assets/pr-40570-screenshots/screenshots/pr-40570-after.png"
width="512" alt="After: Activity header with Commit Graph
button"></td></tr></table>

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

Assisted-by: OpenCode:hy4-flash-free

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-11-29 01:16:29 +00:00
GiteaBot b22f1fed80 [skip ci] Updated translations via Crowdin 2026-11-29 00:37:01 +00:00
silverwind b08f5fad30 fix(activity): count pulse code stats from the branch's net diff (#40573)
The activity page summed per-commit `git log --numstat`, so a renamed
file counted as an extra `old => new` path and changes that landed
through merge commits were missed. Like GitHub's Pulse, the changed
files, additions and deletions now come from the default branch's net
diff over the period, so git detects renames and changes reverted within
the period no longer count.

`GetCodeActivityStats` on an M3 Max, median of 6 runs:

| Repo | Period | Before | After |
|---|---|---|---|
| gitea | week | 40 ms | 40 ms |
| gitea | year | 2.06 s | 0.51 s |
| golang/go | week | 524 ms | 155 ms |
| golang/go | year | 4.54 s | 0.75 s |

Refs:
https://github.com/go-gitea/gitea/pull/40569#issuecomment-7231088642

Assisted-by: Claude Code:claude-opus-5-5
2026-11-28 19:10:44 +00:00
silverwind 16070126c3 perf: use org_user for follower visibility (#40452)
Follower and following lists, including the counts in the profile
sidebar, filter private users through a `team_user` self-join that grows
with the number of teams a signed-in viewer shares an org with. Use
`org_user`, which holds the same memberships with one row per user and
org.

Median `GetUserFollowing` time in ms on synthetic data, before → after:

| Viewer | SQLite | MySQL | PostgreSQL |
|---|--:|--:|--:|
| In 10 teams of a large org | 485 → 25 | 758 → 29 | 204 → 35 |
| In 1 team of a large org | 23 → 13 | 0.6 → 0.6 | 13 → 8 |
| In no team | 3.1 → 3.1 | 1.3 → 1.3 | 131 → 6.5 |
| In 180 small orgs | 3.0 → 3.0 | 3.2 → 1.5 | 16 → 19 |

Assisted-by: Claude Code:claude-opus-5-5
2026-11-28 11:02:31 +00:00
silverwind 5b212a1f36 perf: reuse the doer's permission on pull request pages (#40532)
Pull request pages recomputed the doer's repository permission up to
five times per request. Reuse `ctx.Repo.Permission` and cache lookups on
other repositories, so forks are resolved once per request.

| Merge box | Queries | MariaDB | +0.5 ms DB latency |
|---|---|---|---|
| Open PR | 40 → 32 | 57 → 56 ms | 125 → 118 ms |
| Closed PR | 37 → 24 | 51 → 43 ms | 109 → 89 ms |
| Fork PR | 52 → 39 | 78 → 69 ms | 159 → 146 ms |

Assisted-by: Claude Code:claude-opus-5-5
2026-11-28 10:56:28 +00:00
silverwindandwxiaoguang 489e3b9395 fix(org): clean up repositories and access when deleting an all-repositories team (#40158)
Deleting a team that includes all repositories kept its `team_repo` and
`access` rows, so former members kept their access to the team's
repositories. `DeleteTeam` relied on `RemoveAllRepositoriesFromTeam`,
which skipped such teams.

`RemoveAllRepositoriesFromTeam` now always removes the team's
repositories, and the "remove all" action uses the new
`RemoveSpecifiedRepositoriesFromTeam`, which keeps the guard.

Regression of https://github.com/go-gitea/gitea/pull/19158

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-11-28 08:47:28 +00:00
Vu Nguyen Anh Tuanandwxiaoguang 1b073f93b2 refactor: migrate legacy RenderWithErrDeprecated code to "fetch-action" framework (#40565)
The two 2FA login forms relied on the deprecated
`RenderWithErrDeprecated` path, which re-rendered the whole page on a
wrong code and made the submit button send a duplicate request on a
second click. Migrate both forms to `form-fetch-action` and return JSON
errors from the handlers, so the framework's built-in in-flight guard
blocks duplicate submissions and errors are shown as toasts.

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

Assisted-by: OpenCode:hy4-flash-free

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-11-28 08:02:44 +00:00
silverwindandwxiaoguang 325d40903b fix(setting): resolve relative APP_TEMP_PATH against APP_DATA_PATH (#40527)
A relative `APP_TEMP_PATH` was resolved against the process working
directory, which differs between Gitea processes. `gitea hook` runs from
the bare repository, so its startup check failed and every push was
rejected. It now resolves against `APP_DATA_PATH`, like the other data
paths.

Fixes:
https://github.com/go-gitea/gitea/pull/40448#discussion_r4689040364
Docs: https://gitea.com/gitea/docs/pulls/661

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-11-28 07:22:03 +00:00
Vu Nguyen Anh Tuanandsilverwind 5be2141de0 fix(api): declare archive endpoint as octet-stream in swagger (#40571)
`repoGetArchive` declared `application/json` in the Swagger 2 spec while
actually serving an archive, which made generated API clients fail on
content-type validation. Declare it as `application/octet-stream` with a
file schema, as already done for `repoGetRawFile`, so the body also
appears in the OpenAPI 3 spec.

The shared `error` response described its `message` and `url` fields as
headers, so clients could not decode error bodies. Declare it as a JSON
body using the `APIError` struct.

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

Assisted-by: OpenCode:hy4-flash-free
Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-11-28 04:25:08 +00:00
GiteaBot f9a13b6ce2 [skip ci] Updated translations via Crowdin 2026-11-28 00:32:46 +00:00
3edd96b2a1 fix(auth)!: disable query-token authentication by default (#40297)
Query-string tokens end up in proxy and access logs, so
`DISABLE_QUERY_AUTH_TOKEN` now defaults to `true`. The `token` and
`access_token` query parameters are ignored on the API and on web routes
that accept tokens, like raw, media, archive and attachment downloads.

## ⚠️ BREAKING ⚠️

Clients that send a token as `?token=` or `?access_token=` are treated
as anonymous. Send it in the `Authorization: token <token>` header
instead, or as the basic auth username (`https://<token>@host/...`)
where only a URL can be configured. Admins can restore the old behavior
for now with `[security] DISABLE_QUERY_AUTH_TOKEN = false`, which logs a
deprecation warning at startup.

Docs: https://gitea.com/gitea/docs/pulls/665

Assisted-by: Codex:gpt-6-astra
Assisted-by: Claude Code:claude-opus-5-5

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-11-27 21:36:16 +00:00
32cb4740e2 fix(git): count changed file paths with spaces in code activity stats (#40569)
Git's `--numstat` output is tab-separated, but the code activity parser
split each line on whitespace. Two changed files whose names share a
first word, such as `docs/release notes.md` and `docs/release plan.md`,
were deduplicated into one entry and undercounted on the activity page.
Parse the line by its tab separators so the full path is preserved.

The contributors graph had a similar parser bug: an empty commit made it
drop the following commit, and an empty tip commit was skipped. Both
parsers now use NUL-prefixed separators that can't collide with commit
metadata.

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-11-27 20:32:50 +00:00
Vu Nguyen Anh Tuanandsilverwind 609c808150 enhance(repo): only show blame and diff unescape buttons when needed (#40563)
The blame page and the diff file menu always offered "Unescape", even
for files without escaped characters. Blame now renders the buttons only
when `EscapeStatus.Escaped` is true, like the file view. The diff menu
decides when it opens, because escape status is only known once its
lines are rendered, which also covers expanded and later loaded lines.

| Before | After |
| --- | --- |
| <img width="441" height="48" alt="Blame before"
src="https://github.com/user-attachments/assets/f36af26d-020d-4403-ad85-da7ff9125015">
| <img width="349" height="48" alt="Blame after"
src="https://github.com/user-attachments/assets/c5ee4693-e947-421c-93f1-fd9a74440dc0">
|
| <img width="146" height="175" alt="Diff menu before"
src="https://github.com/user-attachments/assets/126d507c-5d17-45b8-bb3a-81c2256a27ed">
| <img width="146" height="137" alt="Diff menu after"
src="https://github.com/user-attachments/assets/4a6b56b8-6bec-4b9d-8c3a-dc8092c3639d">
|

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

Assisted-by: OpenCode:hy4-flash-free
Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-11-27 19:45:08 +00:00
fe428123db refactor(actions): restructure run admission, settings scopes and oversized files (#39724)
Structural cleanups in the Actions code, plus fixes that align run
behaviour with GitHub Actions.

- Load a reusable caller's ancestor chain once for both expansion checks
and its dispatch inputs.
- Extract the rerun job reset and pass-through rules so they can be unit
tested.
- Share the gate a job passes once its `if:` holds (max-parallel slot,
invalid `runs-on`, concurrency group) between run insertion, rerun and
approval. The job emitter keeps its own, which also defers to groups
admitted in the same pass.
- Resolve the scope of every actions settings page, secrets included, in
one place. The variables and secrets pages dereferenced a nil context
when the org header failed to render.
- Move the API handler interface to the API router, and record runner
bulk-action audit events after the commit.
- Split the 1500 and 2200 line handler files and move the actions
converters into their own file, without code changes.
- Partial reruns load a reusable workflow at the previous attempt's
commit, full reruns resolve its ref again.
- Reject loops through the root workflow at validation.
- Compare concurrency groups case-insensitively and keep runs awaiting
approval out of them until approved.
- Fail-fast ignores failures carried over from an earlier attempt, and
reruns fail a job with an invalid `runs-on`.

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-11-27 16:30:13 +00:00
Vu Nguyen Anh Tuanandsilverwind 77c7e17d82 docs(api): clarify merge_when_checks_succeed behavior (#40541)
`merge_when_checks_succeed` sounds like it waits for all checks, but
auto-merge only waits for branch protection requirements like required
status checks and approvals, and merges right away when none apply.

Document that in the API model without changing behavior, matching
GitHub's auto-merge and Renovate's `platformAutomerge` docs, which both
rely on required checks.

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

Assisted-by: OpenCode:hy4-flash-free
Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-11-27 13:47:35 +00:00
Vu Nguyen Anh Tuanandsilverwind 35f717918a fix(settings): unify glob documentation links (#40539)
Unify the glob help texts on the protected branch, protected tag and
webhook settings pages. All glob syntax links point to the gobwas/glob
syntax section with matching link text. The file pattern examples
replace `.drone.yml` and `/docs/**/*.txt`, which never matched because
changed paths have no leading slash, with `.gitea/workflows/**` and
`CODEOWNERS` for protected files and `docs/**` and `**.md` for
unprotected files.

Links and code markup move from the translations into the templates, and
the English texts are shortened. The changed strings use new keys, so
other locales fall back to English until they are translated instead of
rendering mismatched placeholders.

<img width="838" height="465" alt="Before and after of the glob help
texts"
src="https://github.com/user-attachments/assets/beabc67d-c8be-4926-ac72-31aa4b726f5b">

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

Assisted-by: OpenCode:hy4-flash-free
Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-11-27 13:47:35 +00:00
Zhaowei Gu de28726658 test: fix unit tests on git older than 2.42 (#40557)
Gitea supports git 2.34 and newer, but with git 2.34.1 `go test
./modules/git/` panics in `TestReadingBlameOutput/sha256` (nil pointer
dereference), which aborts the rest of the package, and `services/pull`
fails its `*-MergeTree` cases with `exit status 129`. These tests use
sha256 repositories, `cat-file --batch-command` and `merge-tree
--write-tree`, which production code only uses when `DefaultFeatures()`
says git is new enough (2.42, 2.36 and 2.40).

Those cases now skip on the same `DefaultFeatures()` flags, as the
check-attr tests in `modules/git/attribute` already do. With git 2.34.1
both packages failed before; now they pass with those cases skipped, and
`make test-backend` passes as a whole. With git 2.42.0, 2.43.0 and
2.56.1 nothing is skipped; with 2.41.3 only the sha256 cases are.

Related: https://github.com/go-gitea/gitea/pull/39565

Assisted-by: Hermes Agent:claude-opus-5-5
2026-11-27 12:53:33 +00:00
e77c1c26e5 feat(diff): add rendered diff view for markup files (#40509)
Markdown, org-mode and other inline-rendered markup files get a
source/rendered toggle in commit, compare and pull request diffs, like
images and CSV. Source stays the default, matching GitHub. The rendered
diff is fetched when opened, and only offered when both the old and the
new name are markup files.

The rendered diff follows GitHub's rich diff: changed blocks get a
colored bar, words are marked inline, formatting-only changes are
underlined, code blocks are compared by line and tables by cell, with a
whole replacement when the columns of a table or row change. Math,
mermaid and emoji are shown as removed and added whole, and invisible
characters are escaped like in the source diff. A diff that takes too
long is reported like a suppressed source diff. Wiki diffs get no
toggle, and the rendered diff tab in the web editor is left for a
follow-up.

| Change | Rendered diff |
| --- | --- |
| Source stays the default | <img width="600" alt="Source stays the
default"
src="https://github.com/user-attachments/assets/87b140a6-4228-4514-8806-6897aeace766"
/> |
| Paragraphs and words | <img width="600" alt="Paragraphs and words"
src="https://github.com/user-attachments/assets/e9c3b969-fb54-43b8-a167-364a81959015"
/> |
| Formatting, links and tasks | <img width="600" alt="Formatting, links
and tasks"
src="https://github.com/user-attachments/assets/2582db39-8d28-44e1-bc19-1128f259f070"
/> |
| Lists | <img width="600" alt="Lists"
src="https://github.com/user-attachments/assets/23868a95-da05-4c41-a329-b8a06b6a94ad"
/> |
| Tables | <img width="600" alt="Tables"
src="https://github.com/user-attachments/assets/ac924a0c-33df-4d89-af2d-bb2d74309d17"
/> |
| Code blocks | <img width="600" alt="Code blocks"
src="https://github.com/user-attachments/assets/4a756005-ebf8-418f-a5a5-50520ef2ac4f"
/> |
| Math and mermaid | <img width="600" alt="Math and mermaid"
src="https://github.com/user-attachments/assets/d1c6c96f-e7f4-4ed2-9744-8677fda68bbe"
/> |

This supersedes https://github.com/go-gitea/gitea/pull/37167, whose
review raised the block-level and math/mermaid cases.

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

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: bircni <bircni@icloud.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-11-27 12:50:14 +00:00
bircniandsilverwind ef27fb70bf enhance(actions): count cancelled checks separately in the pull request merge box (#40458)
A cancelled Actions job is stored as a `failure` commit status, so the
merge box reported a job that was only stopped as failing.

The merge box now reads the live Actions job status and counts such
checks as "canceled" in the summary, with the grey stop icon. When
nothing actually failed, the header reads "Some checks haven't completed
yet" instead of "Some checks were not successful".

Like GitHub, the stored commit status stays `failure`: commits keep the
red X, required checks still block the merge, and the API is unchanged.
Cancelled checks are listed in the failing group.

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-11-27 12:48:59 +00:00
karnati praveenandsilverwind 17ac892df5 fix(glob): treat escaped characters as literals (#40516)
The glob compiler wrote a backslash followed by the escaped character
into the generated regexp, so `\d`, `\w`, `\s` and `\b` were parsed as
regexp constructs instead of the literal character. `a\d` compiled to
`^a\d$` and matched "a5" instead of "ad"; `a\b` became a zero-width word
boundary. Escaping a character Go does not recognise, e.g. `\C`, made
the pattern fail to compile, and protected branch rules then fell back
to matching the raw rule text literally.

Escape only ASCII punctuation, which Go always reads as a literal, and
write letters, digits and non-ASCII characters as-is. This matches
gobwas/glob and act. Rules that relied on `\d` matching a digit since
https://github.com/go-gitea/gitea/pull/35478 now match a literal `d`.

Assisted-by: OpenCode (DeepSeek V4.1 Flash)
Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-11-27 06:35:30 +00:00
bircniandsilverwind 372d4dc97a fix(actions): normalize legacy repository runner registration tokens (#40556)
Repository runner tokens created by `gitea actions generate-runner-token
--scope owner/repo` before 1.23, or by the repository API before 1.22.2,
kept the owner ID. Migration 314 skipped this table, so these tokens
stay valid but are hidden in the settings and survive a reset. A
migration now normalizes the active ones.

Registering a runner also wrote the token back as active, which could
undo a concurrent reset. That write and the unused `UpdateRunnerToken`
are removed.

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-11-27 06:22:43 +00:00
63b2af6f37 fix(web): clean up form data parsing (#40558)
`FormStrings` only parsed the form with `ParseMultipartForm`, which
returns `http.ErrNotMultipart` for urlencoded bodies, so it returned nil
unless something else had parsed the form first. The CSRF check used to
do that, and since it was removed the "Associate accessible OIDs" button
on the LFS pointers page sends no OIDs and fails with a 500. The global
multipart parse in the web and API contexts is also removed, form
helpers now parse on demand.

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

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-11-27 06:15:41 +00:00
T Mohan Adityaandsilverwind c6bdd3efd6 fix(markup): continue scanning text nodes after skipped matches (#40506)
Several markup processors stopped scanning a text node after skipping
one match. An external issue or code preview URL hid later local ones,
an SSH remote like `git@host:org/repo.git` hid a later email address, a
short link with a disallowed scheme hid later short links, and a text
node ending in an ellipsis left all its URLs unlinked.

The processors now continue past skipped matches. Only a URL in the last
word of a text node ending in an ellipsis is treated as truncated.

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

Assisted-by: OpenCode:gemini-4-neon
Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-11-27 05:42:42 +00:00
4f1f6d7774 fix(packages): bound decompression of uploaded package archives (#40169)
Package registries walk an uploaded archive to find its metadata,
decompressing every entry on the way with no limit, so a small crafted
archive can burn minutes of CPU. Bound the bytes read while locating
metadata to `max(512 MiB, MAX_DECOMPRESSION_RATIO × upload)`.

The ratio (default 200) scales with the upload so large regular packages
still pass, and `-1` disables the bound. The `.tar.gz` parsers open
uploads through one shared reader that applies it. Parsers already
bounded (npm, debian, helm) are left unchanged.

Docs: https://gitea.com/gitea/docs/pulls/647

Assisted-by: Claude Code:claude-opus-4-8

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: bircni <bircni@icloud.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-11-27 05:16:24 +00:00
silverwindandwxiaoguang 3df804d7b8 perf(pull): merge and squash pull requests without a temporary repository (#40160)
Merge and squash now run `git merge-tree` and `git commit-tree` in the
base repository and push the commit to itself, instead of building a
temporary repository per merge, which made merges take over 10 s on NFS
(https://github.com/go-gitea/gitea/issues/39410). Rebase styles,
fast-forward-only and git older than 2.40 are unchanged.

Commit and tag messages are cleaned up in one place like `git commit`
does, and merge-specific `[git.config]` overrides no longer apply to
merge and squash.

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-11-27 04:42:48 +00:00
Gary Wangandsilverwind d692b8d1db enhance(ui): unify all paginations into one compact style (#40514)
Server lists and the dashboard repo list rendered pagination
differently, and the server one wasted a lot of space. All pagers now
show the first, last and current page plus neighbours in seven fixed
slots, so the arrows never move. Lists with an unknown total show
Previous, Next and the current page.

<img width="672" height="383" alt="Before and after of numbered,
dashboard and previous/next pagination on first, middle and last pages,
on desktop and phone"
src="https://github.com/user-attachments/assets/c1bef79b-9579-490e-b009-d98d784b9b1c">

The pull request list now uses the same arrow between branches as the
compare page.

| Before | After |
|---|---|
| <img width="250" alt="Double chevron between branches"
src="https://github.com/user-attachments/assets/889ad911-950a-46cf-b06e-c18e06f48a29">
| <img width="250" alt="Arrow between branches"
src="https://github.com/user-attachments/assets/694ff6f9-659e-4d46-9826-b04f7cf7889a">
|

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-11-27 04:40:28 +00:00
Basavaraj S mandsilverwind 19c7e76ac3 fix(release): check protected tags against the user editing a release (#40464)
Editing or publishing a release can create its tag, and `createTag`
checked protected tag rules against the release publisher instead of the
user making the request. A release writer outside a protected tag's
allowlist could get that tag created by editing a release an allowlisted
user published, or by publishing an allowlisted user's draft.

`createTag` now uses the acting user for the protected tag check and for
the push and create-ref events, like `CreateNewTag`. GitHub likewise
checks tag rulesets against the user who publishes a release.

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-11-27 04:05:01 +00:00
Thejeshandsilverwind b6b6ef38ed fix(web): exact emoji match ranked below partial matches in autocomplete (#40493)
`matchEmoji` combined alias scores wrongly. An exact match on the main
alias scored 0, which is falsy, so a later matching alias overwrote it,
and other multi-alias matches had their scores subtracted. Typing `:car`
did not suggest 🚗 at all and `:boat` listed `rowboat` before `boat`.

Each emoji now keeps its best alias score, and an exact match on any
alias ranks first, like on GitHub, so `:uk` suggests 🇬🇧 before 🇺🇦.

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-11-27 03:59:50 +00:00
Matthew Tirtawidjajaandsilverwind 073a966227 fix(ui): wrap long unbroken text in profile card and sidebars (#40535)
- Long text without natural break points, such as email addresses, URLs
and names containing underscores, no longer overflows the profile card,
the package title and sidebar, the repository sidebar, the organization
header and the stargazer, watcher and follower cards.
- These containers use `overflow-wrap: anywhere`, because the global
`overflow-wrap: break-word` does not let flex items shrink below their
longest word.
- The profile card icon rows share one layout again, so location, email
and website align the same way.
- An empty topics row no longer adds extra space around "Manage Topics"
in the repository sidebar.
- Cancelling or saving the topic editor keeps an empty topics row
hidden, instead of showing it again until the next page load.
- The package view uses its own header class instead of borrowing the
issue title one.

<img width="688" alt="Before and after"
src="https://github.com/user-attachments/assets/d1417853-d6ce-4797-b26d-1a2ead67608c">

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-11-27 03:50:01 +00:00