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>
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
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
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>
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>
`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>
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>
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>
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>
`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>
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
`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>
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>
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>
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>
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>
Store PAT, Actions task and runner tokens as SHA-256 instead of PBKDF2,
which 160-bit random tokens don't need, and drop the token caches and
`SUCCESSFUL_TOKENS_CACHE_SIZE` that PBKDF2 required. Legacy rows are
rehashed on first use. Older releases can't verify new or rehashed
tokens. A PAT use now writes only its last-used timestamp, at most once
a minute.
Benchmarks on M2 Max, SQLite, median of 5:
| Benchmark | 1 token | 128 tokens |
| :--- | ---: | ---: |
| PAT lookup | 29.4 → 30.7 µs | 2.24 ms → 29.7 µs |
| PAT lookup with last-used | 107 → 29.6 µs | 2.44 ms → 30.1 µs |
| Task lookup | 63.2 → 48.4 µs | 2.25 ms → 49.4 µs |
| Runner verify, no DB | 122 → 160 ns | 141 → 162 ns |
Docs: https://gitea.com/gitea/docs/pulls/607
Assisted-by: Codet
Assisted-by: Claude Code:claude-opus-5-5
---------
Co-authored-by: silverwind <me@silverwind.io>
A pull mirror copied its newest branch tip's committer date into the
repository's "Last updated" field. Commit dates are set by whoever made
the commit, so a single tip dated 2098 kept an idle mirror at the top of
Explore for decades.
Like GitHub, GitLab and Gitea's own push handling, a sync now sets the
update time to the sync time when any ref changed and leaves it
untouched otherwise.
Fixes: https://github.com/go-gitea/gitea/issues/40480
Assisted-by: Codex:GPT-6
Assisted-by: Claude Code:claude-opus-5-5
---------
Co-authored-by: silverwind <me@silverwind.io>
Queued push, create and pull request synchronize events resolved their
branch only when handled, so if it had moved on, the pushed commit got
no run and the newer one got two.
Runs now use the event's commit, and a delayed default branch push no
longer replaces newer schedules.
---------
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
`TestGitDiffTreeRespectsDiffOrderFile` fails on git older than 2.46,
such as the 2.43 that Ubuntu 24.04 ships, even though Gitea supports git
2.34 and newer. Its `GlobalDiffOrderFile` subtest sets and removes the
global `diff.orderFile` with `git config set` and `git config unset`,
which were added in git 2.46, so older git stops it at the first call
with `exit status 129 - usage: git config [<options>]`.
The test now uses `git config --global` and `git config --global
--unset`, the classic syntax that `modules/git/config.go` also uses.
With git 2.34.1 and 2.43.0 the test failed before and passes now; git
2.56.1 passes either way.
Follow-up to https://github.com/go-gitea/gitea/pull/38566
Assisted-by: Hermes Agent:claude-opus-5-5
Gitea and the runner each implemented the same GitHub Actions rules.
Workflow structure, job kind, `runs-on`, `run-name` and job condition
checks, step display names, the output and step summary limits and the
reusable workflow depth now come from actionslib, so both enforce the
same rules. Job condition and `run-name` context errors now use GitHub's
wording with the position of the expression.
The shared rules come from https://gitea.com/gitea/actionslib/pulls/34,
released in actionslib v1.7.0. The runner side is
https://gitea.com/gitea/runner/pulls/1421.
Assisted-by: Claude Code:claude-opus-5-5
Like GitHub since December 2025, `pull_request_target` workflows now run
from the default branch whatever the pull request targets, so an
outdated workflow on a release branch can't run with secrets.
`github.ref`, `github.sha` and local reusable workflows follow it, while
branch filters still match the base. Runs now record that ref, so runs
from older versions keep the base on rerun.
Breaking: pull requests targeting a non-default branch now run the
default branch's `pull_request_target` workflows, so workflows that only
exist on that branch stop running and `actions/checkout` without `ref`
checks out the default branch.
Ref:
https://github.blog/changelog/2025-11-07-actions-pull_request_target-and-environment-branch-protections-changes/
Assisted-by: Claude Code:claude-opus-5-5
The "Approve runs" button was missing on
https://gitea.com/gitea/runner/pulls/1246. The merge box only looked at
the latest commit status per context, so an older run's later update,
like its cancellation, hid a newer run still awaiting approval. It now
collects runs from all statuses of the head commit.
Assisted-by: Claude Code:claude-opus-5-5
Render user mentions like GitHub, semibold in the surrounding text
color, and highlight mentions of the signed-in user in yellow so they
stand out in long threads.
The renderer adds `user-mention` and `current-user` classes, the styling
is pure CSS. CODEOWNERS and OAuth creator links use the same class, team
mentions are unchanged.
| Before | After |
| --- | --- |
| <img width="291" height="29" alt="before"
src="https://github.com/user-attachments/assets/6c451e7a-dfce-4e95-a386-f9aa9d28c721"
/> | <img width="291" height="29" alt="after"
src="https://github.com/user-attachments/assets/6b137c71-4692-46f2-adf8-d77ee87f3077"
/> |
Assisted-by: Claude Code:claude-opus-5-5
Integration tests load fixtures after the app starts, while the indexers
still initialize and populate in the background. A slow start indexed
every fixture repo or dropped early index updates, making search tests
flaky.
The indexer startup goroutines now join a WaitGroup that only the test
harness waits on. This replaces the issue indexer's `syncReindex` flag.
Also fixes a flaky `SyncDirs` test that relied on directory listing
order.
Assisted-by: Claude Code:claude-opus-5-5
Reduce the work Go tests spend on fixture setup, without dropping any
test or covered code. Every fixture repository reset listed and stat'ed
both trees, and many packages copied repositories or created a database
they never use.
- List the fixture repository source tree once per process
- Skip the repository copy in DB-only packages and the database in
settings-only packages
- Drop the unused repository copy and git init from migration tests
- Push LFS files last in `TestGitGeneral`, so LFS hooks don't run on
every later git command
- Link the integration test binary without DWARF
Measured locally on macOS, wall and CPU time:
| | Before | After |
|---|---|---|
| Warm fixture repository reset | 127 ms | 63 ms |
| 30 affected unit packages | 13.6 s, 72 s CPU | 10.0 s, 51 s CPU |
| Migration tests | 29.9 s, 19.1 s CPU | 13.7 s, 8.8 s CPU |
| `TestGitGeneral` | 81 s, 69 s CPU | 62 s, 54 s CPU |
| 46 API integration tests | 41.7 s | 39.0 s |
| Integration test binary relink | 8.7 s, 11.6 s CPU | 3.7 s, 5.7 s CPU
|
Assisted-by: Claude Code:claude-opus-5-5
Rework the merge box after GitHub, fix auto merge edge cases, and add
`auto_merge` to the pull request API.
- Review, checks, mergeability and blocker sections that refresh while
checks run, each rendered from a `pullMergeBoxSection` instead of the
flat info item list.
- Auto merge waits out conflicts, and is canceled on close, WIP, or a
retarget or push by a non-writer.
- Bypassing branch protection needs an explicit checkbox.
- Merging follows the delete branch setting, and the timeline can
restore the deleted branch.
- Unrelated branches get their own status instead of a conflict.
- The merge API answers a merge blocked by an open dependency with 422
instead of 500.
<img width="600" alt="Merge box ready to merge"
src="https://github.com/user-attachments/assets/95dcec16-fba5-446f-81f9-5af1245c887f"
/>
<img width="600" alt="Merge box with review required and checks pending"
src="https://github.com/user-attachments/assets/640ec08e-a964-4520-85e1-5c606dfaf222"
/>
Fixes: https://github.com/go-gitea/gitea/issues/39851
Fixes: https://github.com/go-gitea/gitea/issues/24513
Assisted-by: Claude Code:claude-opus-5-5
---------
Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
On old vendor kernels like Synology's 3.10, `splice()` from a TCP socket
fails with `EBADF` instead of `EINVAL`, so Go doesn't fall back to a
normal copy and the git proxy's CONNECT relay dies at once, breaking
every HTTPS clone, mirror and migration.
The relay and the `git://` tunnel now retry with a plain copy when
splice fails with `EBADF` before anything was written, so normal kernels
keep using splice.
Fixes: https://github.com/go-gitea/gitea/issues/40367
Assisted-by: Claude Code:claude-opus-5-5
---------
Signed-off-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: TheFox0x7 <thefox0x7@gmail.com>
`raw_concurrency` on `action_run` and `action_run_job` was
`VARCHAR(255)`, so a workflow `concurrency` block longer than 255 bytes
failed to insert and no run was created. The column is now `TEXT`.
Startup sync widens it on PostgreSQL and MySQL, and migration 370
converts it on MSSQL.
The evaluated concurrency group had the same limit, so groups longer
than 255 characters are now stored as their SHA-256 hash. Run creation
failures also log the workflow and ref.
Fixes: https://github.com/go-gitea/gitea/issues/40391
Assisted-by: Claude Code:claude-opus-5-5
---------
Co-authored-by: silverwind <me@silverwind.io>
With `block_on_official_review_requests` enabled, a scheduled auto merge
stayed stuck after the last official review request was cleared, because
nothing rechecked the PR. A request can be cleared by removing a user's
request, by removing a team's request, or when the requested reviewer
submits any review, including a plain comment.
All three cases now trigger an auto merge recheck. Previously only
approvals and dismissals did. Every recheck now skips pull requests
without a scheduled auto merge before opening the git repository.
Fixes: https://github.com/go-gitea/gitea/issues/40415
Assisted-by: Claude Code:claude-opus-5-5
---------
Co-authored-by: bircni <bircni@icloud.com>
Co-authored-by: silverwind <me@silverwind.io>
Adds audit actions for security-relevant changes that were not logged at
all, and records a few remaining events on paths that skipped them:
- Account login prohibition (`user:status:prohibitlogin`) and the
organization setting that lets repository admins change team access
- Actions runner registration tokens issued, runners removed or
enabled/disabled, and Actions variables, for every scope
- Instance config changes, including maintenance mode
(`system:config:update`)
- Deploy token regeneration and pull mirror address changes
- Review deletion and dismissal, package removal, and release and tag
removal
- Repository restores via `gitea admin restore-repo`, OAuth2 secret
rotation on API update, and SSH keys added or removed by authentication
source sync
The authentication source SSH key sync moved from the asymkey model to
the asymkey service so it can record events.
Follow-up to https://github.com/go-gitea/gitea/pull/40317 and
https://github.com/go-gitea/gitea/pull/40322.
---------
Co-authored-by: silverwind <me@silverwind.io>
Several entry points change users, credentials or 2FA without writing an
audit event, while the equivalent web or service path does. This records
the existing actions on those paths:
- `user:create` for self sign-up, OAuth2 auto-registration, link-account
registration and `gitea admin user create`
- `user:accesstoken:add` for `gitea admin user generate-access-token`
and `user create --access-token`; `user:accesstoken:remove` for `DELETE
/api/v1/token`
- `user:twofactor:disable` for the admin "reset 2FA" option and `gitea
admin user disable-2fa`
- `user:key:ssh:add`, `user:key:gpg:add/remove` for the API
- `user:email:primary`, `user:email:activate`, `user:status:active` for
settings, the activation page/links and OAuth2 source sync deactivation
- `user:oauth2application:grant` when a grant's scope changes,
`user:externallogin:add` on registration via an external login
- `user:authentication:fail:twofactor` for wrong recovery codes, failed
WebAuthn assertions and 2FA during password reset
Should be backported to v28.
---------
Co-authored-by: silverwind <me@silverwind.io>
Several API and background paths change repositories without writing the
audit event the web UI writes for the same change. This records the
existing actions on those paths:
- Webhook add/update/remove via the API (repository, organization, user
and system hooks)
- Branch and tag protection add/update/remove via the API
- Deploy keys and deploy tokens via the API, and deploy tokens generated
in the web UI
- Push mirror add, archive/unarchive and default branch changes via the
API
- Project create/update/delete via the API, and closing/reopening
projects in the web UI
- `repository:create` for migrations, `pr:merge` for scheduled
auto-merges, `pr:comment:create` for reviews (with `review_id` and
`review_type`) and review code comments
- `repository:delete` for repositories removed by the missing-repository
cleanup or an owner purge
Webhook, secret and OAuth2 application events now also keep the
impersonator.
Assisted-by: Claude Code:claude-fable-5-2
---------
Signed-off-by: bircni <bircni@icloud.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
Plain repository creation marked a new repository as ready before its
git data, hooks and initial commit existed, and auto-init cloned the new
repository to build its initial commit on top of whatever it already
contained.
- Auto-init builds the initial commit in a freshly initialized temp
repository instead of a clone
- New repositories are inserted as being created and marked ready once
initialized, as fork, template generation, adoption and migrations
already do
---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
The web repo search response embedded the whole commit status model
although the dashboard only uses its state and target URL. It now
returns just those two fields.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Split repository migration into metadata and issue data stages, and
share pagination, deduplication, and comment and review batching between
issue and pull request imports, so fixes to that logic land in one
place.
Import order, batch sizes, and comment handling are unchanged. A unit
test covers page deduplication, per-item and repository-wide comments,
reviews, and the branch sync after pull requests.
Assisted-by: Claude Code:claude-opus-5-5
---------
Co-authored-by: silverwind <me@silverwind.io>
GitHub resolves `uses: $/{path}` against the repository and commit of
the job's workflow file, not the triggering ones. When those differ, as
with reusable workflows from elsewhere or owner and global workflows:
- such steps are pinned to `self:{repo}/{path}@{sha}` in the runner
payload
- `$/` steps with expressions in their path fail the run as an invalid
workflow, as they can't be pinned safely and GitHub rejects them too
Same-source jobs keep `$/`, so older runners are unaffected.
Assisted-by: Claude Code:claude-opus-5-5
---------
Co-authored-by: Zettat123 <zettat123@gmail.com>
Actions `edited` payloads omitted `changes`, so workflows could not see
previous values. Issue/PR title and body edits now carry
`changes.title`/`changes.body`, base branch changes add
`changes.base.ref`/`changes.base.sha` (and `changes.ref` now holds the
old branch, not the new one), release edits carry
`changes.name`/`changes.body`.
_Written by Claude (Opus 5.5)._
---------
Co-authored-by: Claude (Opus 5.5) <noreply@anthropic.com>
Adds GitHub-style code search endpoints and makes code search behave the
same in the web UI and the API, whether it runs on git grep, bleve or
Elasticsearch.
- `GET /repos/{owner}/{repo}/code/search` searches any branch, tag or
commit with git grep, so it works without the code indexer.
- `GET /search/code` searches the default branches of all accessible
repositories with the code indexer.
- One query syntax everywhere: every term must match a file's content or
path, case-insensitively. It supports `"phrases"`, `/regexp/` (git grep
only) and the `path:`, `language:`, `repo:`, `user:` and `org:`
qualifiers. Invalid queries return an error.
- All engines apply the same include, exclude, vendored and size rules,
and return every match. The web UI shows them as multiple snippets per
file with the matched text highlighted.
<img width="359" height="295" alt="image"
src="https://github.com/user-attachments/assets/59b7aa66-b1dc-4938-9ef9-66668ae08d7c"
/>
Fixes: https://github.com/go-gitea/gitea/issues/10706
Fixed: https://github.com/go-gitea/gitea/issues/15841
Fixes: https://github.com/go-gitea/gitea/issues/31375
Related: https://gitea.com/gitea/gitea-mcp/issues/280
Docs: https://gitea.com/gitea/docs/pulls/615
AI usage disclosure: Yes, I used AI to write code, review changes and
verify the factuality of the overview I provided. I take full
responsibility for the code in this PR.
---------
Co-authored-by: silverwind <me@silverwind.io>
Jobs that ran on ephemeral runners lose `runner_name` in the
`workflow_job` completed webhook and the jobs API, because the runner
row is deleted when the task finishes. GitHub keeps both `runner_id` and
`runner_name`, and GARM ignores completed jobs without a name, holding
the runner slot until its periodic cleanup.
The name is now stored on the task when claimed, and a migration
backfills tasks whose runner row still exists.
---------
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Updates golang.org/x/crypto to v0.59.0, which removed SSH DSA support,
so Gitea drops DSA as well. DSA was already disabled by default and
OpenSSH 10 removed it too.
- DSA keys can no longer be added, including through LDAP sync
- Existing DSA keys stop working and are dropped from `authorized_keys`
- The `DSA` option in `[ssh.minimum_key_sizes]` is removed
Assisted-by: Claude Code:claude-opus-5-5
---------
Co-authored-by: silverwind <me@silverwind.io>
1. `ctx.ServerError("LogMessage", err)` is very messy and useless. When
the log is printed, it already contains the caller's file and line
number
2. `ctx.NotFound(nil)` and `ctx.NotFound(err)` were abused a lot, now
only `ctx.NotFound()`
---------
Co-authored-by: silverwind <me@silverwind.io>