Commit Graph

21428 Commits

Author SHA1 Message Date
Lunny Xiao 475e51c7e0 fix: avoid enumerating every public repository in issue search (#38992)
Both issue search endpoints resolve their repository filter with
`SearchRepositoryIDs` and pass the result to the indexer as `RepoIDs`.
They mean
to leave public repositories to the indexer, but
`SearchRepoOptions.AllPublic` is
only read when `OwnerID > 0`, so without an `owner` filter the flag does
nothing
and every public repository is enumerated, without a `LIMIT`, into
`repo_id IN (...)`.

Those IDs are redundant, as `allPublic` is passed to the indexer, which
already
matches every public repository. On a large instance this binds tens of
thousands
of parameters and can fail in the driver, making the endpoint return 500
for every
filter. Admins are worst hit, as `SearchRepositoryCondition` skips their
accessible-repository condition and enumerates the whole table.

Restrict the enumeration to private repositories. The result set is
unchanged, as
the dropped IDs are a subset of what `allPublic` matches.

Both endpoints held copies of this block, so it moves to
`routers/common`.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-08-20 16:29:54 +00:00
wxiaoguang 943f026844 refactor: deploy key and private route handlers (#38999)
clean up legacy code, fix various bugs:

* add missing "return"
2026-08-20 15:57:17 +00:00
silverwind 61be9fcdfa chore: update eslint and stylelint configs and re-sync modern-normalize (#38982)
- update the vendored `modern-normalize` to v3.0.1
- require descriptions for lint disables in TS and CSS, same as we
already have in Go.
- disable core rules covered by `regexp/*` and `unicorn/*`, and ones
that cannot fire
- stop applying vitest rules to the playwright files in `tests/e2e`
- enable 7 stylelint rules, mostly `no-unknown` and `no-invalid` checks
- drop 2 unnecessary vendor prefixes (safari v17+, chrome v120+)
- look up ids via `querySelector` with `CSS.escape` instead of
`getElementById`
- remove stale doc about `@ts-expect-error`, it's forbidden
- misc dev doc fixes

Every declaration that `modern-normalize` v3 removes was checked against
chromium, webkit and firefox defaults first. The `hr` color and the
`:-moz-focusring` outline are kept as documented deviations, dropping
those does change rendering.

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-08-20 09:57:56 -04:00
wxiaoguang c778c6c920 enhance: use browser's locale to detect week's first day for the contribution map (#38995)
fix #6058

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
2026-08-20 07:10:15 +00:00
bn-zr fa5d876171 fix(actions): Fix how jobs in matrixes are grouped (#38980)
The workflow graph decided which job rows belonged to the same matrix by
parsing display names: it stripped a trailing `" (...)"` off `name` and
grouped rows sharing the prefix. That guesses at a string the user
controls, and it fails both ways. `jobparser` only appends the `
(<combination>)` suffix when `name:` contains no `${{ }}`, so a leg
named `E2E on ${{ matrix.browser }}` never grouped, while two unrelated
jobs `build (fast)` and `build (slow)` folded into one bogus matrix
panel.

Matrix legs already have a real identity: expansion clones one row per
combination, all sharing the workflow's `JobID` and differing only in
`Name`. Group on that instead, so a matrix is whatever the backend says
it is. Matrix expansion state is keyed on the graph node id for the same
reason.

Closes https://github.com/go-gitea/gitea/issues/38975, though that
report's own example already groups on main, since `explicit (${{
matrix.leg }})` interpolates to a name that still ends in a suffix. The
interpolated shapes above are the broken ones.

Assisted-by: Claude Code:claude-opus-5
Co-authored-by: bircni <bircni@icloud.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-08-20 05:41:14 +00:00
silverwind 8f7eb9f161 enhance(ui): forced colors mode enhancements (#38991)
Improve various UI elements while in [forced color
mode](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/forced-colors).
2026-08-20 05:11:57 +00:00
silverwind ed4d7ea08d fix: resolve YAML anchors and aliases in Actions workflows (#38984)
Workflows using YAML anchors are rejected as invalid, because a workflow
is split into one document per job and an alias whose anchor lands in
another job's document no longer resolves.

Aliases are now expanded once, right after the workflow is parsed and
before anything reads or splits it, bounded like GitHub's parser so
nested aliases cannot expand without limit. Merge keys stay unsupported,
as they are upstream.

Fixes https://github.com/go-gitea/gitea/issues/38983
Signed-off-by: silverwind <me@silverwind.io>
2026-08-20 05:03:10 +00:00
GiteaBot 89b891b168 [skip ci] Updated translations via Crowdin 2026-08-20 01:44:24 +00:00
Iaroslav 35786a6ca1 fix(lfs): ensure lock listing paginates with a total order (#38850)
`GetLFSLockByRepoID` applies `LIMIT`/`OFFSET` to a query with no `ORDER
BY`. The order of such a query is unspecified (according to the SQL
standard), so the resulting queryset might be inconsistent.

These locks AFAIK are never updated, so in practice the order is
insertion-based, but that's not guaranteed.
2026-08-19 11:54:21 -07:00
silverwind 4e813a262f fix: resolve actions commit status permission per repository (#38977)
Various pages did not display the correct action run list tooltips. Fix
those tooltips like here on the `/pulls` page:

`ctx.Repo.Permission` is the zero value outside a repository route, so
on `/pulls`, `/issues`, `/notifications/subscriptions` and the dashboard
repo list the commit status "Details" link was always stripped. The live
job status is looked up from that target URL, so running checks also
rendered as a static pending dot instead of a spinner.

Resolve the Actions unit permission per repository instead.

Also drops the releases page's gate on *loading* statuses, which hid
external CI results from anyone without Actions read; it now loads them
and hides only the URL, like every other page.

Co-authored-by: bircni <bircni@icloud.com>
2026-08-19 20:09:00 +02:00
Giteabot e355c39e91 chore(deps): update dependency go to v1.26.7 (#38987) 2026-08-19 16:32:52 +00:00
wxiaoguang f261adb53f chore: form binding trim space (#38978)
Use "binding:TrimSpace" instead of fragile IsEmptyString

And fix a bug in locale's `HasKey`: it should also try the default
language if current language doesn't have the translation key, a new
test is added.
2026-08-19 12:50:06 +00:00
APZN c121f02a7e fix: honor environment variables during install (#38974)
Environment variables must be applied to the "install form" config
before the config values are used.

Fixes #38911

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-08-19 15:19:49 +08:00
wxiaoguang 6904f6480c refactor: http request binding (#38971)
Better than before, still not good enough (more work can be done in the
future)

And add the missing error handling in the PrivateContext "bind"
middleware.

By the way, picked some "TrimSpace" changes from "fix: trim whitespace
from SMTP address and port - #38934" (fix #38926)
2026-08-19 14:15:42 +08:00
GiteaBot 6c425fae6e [skip ci] Updated translations via Crowdin 2026-08-19 01:45:26 +00:00
wxiaoguang 5433c23dec enhance(ui): tint toast backgrounds by level (#38919)
Toasts now use the same tinted backgrounds and borders as the flash
messages, replacing the solid full-color style. The first commit reverts
https://github.com/go-gitea/gitea/pull/38842, the second re-applies it
with tinting.

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-08-18 21:13:30 +02:00
silverwind 83af7aa92e ci: improve caching (#38958)
- only `cache-seeder` writes caches, every other workflow restores.
Saves were being rejected once the repo went over its cache budget,
leaving main's caches stale and PR runs building cold
- seed the pnpm store and uv caches next to the go ones, so PRs
warm-start on them rather than installing from scratch
- prune keeps a single generation per key, including across go versions,
where a toolchain bump leaves the previous build cache unusable.
Reclaims ~2.6 GB immediately
- prune runs every 6h instead of daily and trims to 6 GB, since CodeQL
writes ~200 MB per push to main from outside this repo's workflows
- pull requests and release branches no longer write pnpm, uv and binfmt
caches, whose ref-scoped copies are never read again

---------

Signed-off-by: silverwind <me@silverwind.io>
2026-08-18 18:26:03 +00:00
wxiaoguang c95e3f3b00 refactor: private endpoints (#38964)
1. remove dead code (SetDefaultBranch)
2. remove useless and unsafe code (AddLogger)
2026-08-18 08:51:47 +00:00
water c082b9a5ff fix: grant limited-org unit read access to authenticated non-members (#38871)
Fixes #38870

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-08-18 06:58:37 +00:00
bircni e8e1973e16 fix: allow anonymous theme switching when REQUIRE_SIGNIN_VIEW is set (#38956)
Fixes https://github.com/go-gitea/gitea/issues/38950


Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-08-18 04:02:52 +00:00
GiteaBot 19ee791fe7 [skip ci] Updated translations via Crowdin 2026-08-18 01:43:54 +00:00
silverwind 3842e021e0 fix(actions): drop wrapper span around the action status icon (#38957)
Fixes https://github.com/go-gitea/gitea/issues/38955
2026-08-17 22:46:49 +00:00
silverwind df71d5f5e2 test: run frontend unit tests in browsers (#38860)
Run them in headless [vitest browser
mode](https://vitest.dev/guide/browser/) in chromium and firefox.
Similar UX than current tests, it's about 5 times as slow (goes from 1s
to 5s on my machine), but definitely worth it as it removes all
happy-dom problems.

---------

Signed-off-by: silverwind <me@silverwind.io>
2026-08-17 22:22:54 +00:00
Minjie Fang 55e7cafcb6 chore(maintainers): add wingsallen as maintainer (#38913)
[PRs](https://gitea.com/gitea/tea/commits/branch/main/search?q=wingsallen&all=)

@wingsallen on gitea.com
2026-08-17 22:03:18 +00:00
bircni ed4a23e893 enhance: inherit team access for all units (#38938)
Admin and write team authorize now grant that mode on every unit,
including units added later, instead of only rows present in
`team_unit`. Granular teams keep `authorize=none` and explicit unit
rows.

Closes the `TEAM-UNIT-PERMISSION` design gap from
https://github.com/go-gitea/gitea/pull/34128.

Maybe also fix #15962 (actually maybe it had been fixed before, the root
cause is out-of-sync "access" table)


## Screenshots

only writing selected:
<img width="1399" height="1007" alt="image"
src="https://github.com/user-attachments/assets/1d1b4c49-a59a-47b6-998f-0464a067395b"
/>


_Created with the help of AI_

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-08-17 20:30:24 +00:00
bircni 1cf904f101 feat(repo): add quick repository switcher to repo header (#38188)
Add a GitHub-style quick repo switcher: a caret next to the owner/repo
breadcrumb
opens a dropdown that lists and searches the current owner's
repositories and
navigates to the selected one. The current repository is marked with a
check, and
private/fork repos show an icon.

Also, fix various bugs in fomtantic dropdown remote query

## Screenshots

<img width="505" height="198" alt="image"
src="https://github.com/user-attachments/assets/9f673d1b-fe60-41f0-b9e2-b00dc43720b5"
/>

Fixes #38187

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-08-17 20:08:15 +00:00
Giteabot e223c42ee6 fix(deps): update module golang.org/x/mod to v0.40.0 [security] (#38914) 2026-08-17 19:29:07 +00:00
Hsukqi Lee 551a6bb3a4 fix(issues): sort scoped labels by exclusive order in dropdowns (#38893)
Closes #38872

Labels in the label selection dropdown (issue/PR sidebar, new issue
form) were always listed alphabetically, so a scoped set like the
default Priority labels showed up as Critical, High, Low, Medium even
though each label carries an exclusive order.

This adds `CompareLabelForDisplay`/`SortLabelsForDisplay` in
`models/issues`: labels are grouped by their exclusive scope and sorted
by exclusive order within a scope (unordered ones last), falling back to
name order. The sorting is applied to the issue page sidebar data and
the shared label filter data, so the filter dropdown on the issue list
gets the same ordering.

Unscoped labels are unaffected and still sort by name. Includes a unit
test covering the default Priority label set.
2026-08-17 18:47:28 +00:00
Mitrahsoft 7857c5f843 feat(user): Personal access tokens can be regenerated (#38907)
Lets users regenerate a personal access token's value in place, keeping
its name and scopes, instead of deleting and recreating it. Useful when
a token was shared with a third party (e.g. an AI agent) and needs to
be invalidated immediately without redoing scope selection.

Follows the same pattern already used for OAuth2 application client
secrets (`GenerateClientSecret`/`RegenerateSecret`).

**Testing**: added a model unit test and a web integration test;
manually
verified in the running dev server that the old token stops
authenticating
and the new one works immediately after regenerating.

<img width="1040" height="245" alt="image"
src="https://github.com/user-attachments/assets/4de0d8b4-1fc4-49cf-a859-95e24d0b2c0a"
/>

Fixes #38683.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-08-17 18:17:16 +00:00
silverwind 346e6bab67 ci: install node for renovate post-upgrade tasks (#38953)
Containerbase declares `node` as the parent of `pnpm`, so `install-tool
pnpm` aborts with `MissingParent` (exit 16) when node was never
installed as a containerbase tool. Renovate's npm manager installs node
itself, so this only breaks on branches without an npm update, where the
failed install blocks every post-upgrade command including `make tidy`,
leaving an untidy `go.sum` behind.

Seen on https://github.com/go-gitea/gitea/pull/38914.

Verified in `ghcr.io/renovatebot/renovate:latest`:

```
install-tool pnpm 11.22.0                    exit=16
  FATAL: parent tool not installed  tool: "pnpm"  parent: "node"
install-tool node 22.18.0 && install-tool pnpm 11.22.0   exit=0
```
2026-08-17 10:51:09 -07:00
wxiaoguang dea71bb8ba enhance: user-friendly packages setup manual (#38946)
* replace #35564
* fix #36992
2026-08-17 17:43:34 +00:00
Giteabot 596b7f7a25 chore(deps): update dependencies (#38947) 2026-08-17 15:10:17 +02:00
Mitrahsoft 1b21c8a1e6 fix(indexer): correct bleve indexer token filters (#38853)
* fix #36228
* fix #37221

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-08-17 07:59:41 +00:00
GiteaBot 3cd6672e48 [skip ci] Updated translations via Crowdin 2026-08-17 00:22:34 +00:00
wxiaoguang 63f2918336 fix: make "login_name" field optional for API edit user (#38917) 2026-08-16 13:39:28 +00:00
wxiaoguang 5e4d21acd5 chore: fix repo watch (#38921) 2026-08-16 03:00:59 +00:00
GiteaBot 56ad4689ad [skip ci] Updated translations via Crowdin 2026-08-16 00:24:11 +00:00
Giteabot 133a3b8567 fix(deps): update module golang.org/x/image to v0.45.0 [security] (#38930)
Co-authored-by: bircni <bircni@icloud.com>
2026-08-15 15:43:20 +02:00
bircni 2b8ea5476c fix(ui): respect FEED_PAGING_NUM on the dashboard feed (#38935)
The dashboard activity feed was paginated with `[ui.user]
REPO_PAGING_NUM`
instead of `[ui] FEED_PAGING_NUM`.

The wrong setting was picked up when the page size was hoisted into a
local
variable in https://github.com/go-gitea/gitea/pull/34994, most likely
copied
from the `dashboardRepoList` block a few lines above. `REPO_PAGING_NUM`
should
only control repository lists.

Fixes https://github.com/go-gitea/gitea/issues/38925
2026-08-15 19:31:10 +08:00
GiteaBot 43ace7cc8a [skip ci] Updated translations via Crowdin 2026-08-15 00:22:56 +00:00
bircni a96a73c364 docs: Update CHANGELOG for version 1.27.2 (#38923)
Signed-off-by: bircni <bircni@icloud.com>
2026-08-14 22:06:05 +02:00
Lunny Xiao 07843086c2 ci: remove AWS S3 uploads from release workflows (#38928)
Release binaries and downloads have been served from Cloudflare R2 for a
while now, so the AWS S3 upload is redundant.

This removes the `configure aws` and `upload binaries to s3` steps from
the nightly, RC and version release workflows. Since
`configure-aws-credentials` no longer runs in those jobs, the
`AWS_REGION: auto` workaround in the R2 step can be dropped as well.

The `AWS_*` secrets for S3 can be removed from the repository settings
afterwards.
2026-08-14 21:50:27 +02:00
Giteabot 5b7b00477a chore(deps): update dependency go to v1.26.6 (#38912) 2026-08-14 10:28:00 -07:00
bircni dbe311197c enhance(admin): show impersonation banner and keep password change with the user (#38924)
Follow-up to https://github.com/go-gitea/gitea/pull/38614

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-08-14 22:23:30 +08:00
wxiaoguang b6368965fb refactor: wiki edit form (#38918)
1. the fragile `document.querySelector('.repository.wiki.new
.ui.form')!` is broken (again), rewrite to "data-global-init"
    * regression from #37571 because a new form was added
3. use "form-fetch-action" and JSON response instead of
"RenderWithErrDeprecated"
2026-08-14 11:31:23 +02:00
Mitrahsoft befeacdf7d docs(api): document 401/403 responses for user key endpoints (#38711) 2026-08-14 02:55:44 +00:00
wxiaoguang 72a9debaff refactor: clean up form binding & validation (#38873)
Clarify the "validation" and "error display" logic.

All the copied&pasted `Validate` functions are removed.
2026-08-14 02:15:33 +00:00
GiteaBot 8b40df255b [skip ci] Updated translations via Crowdin 2026-08-14 00:37:15 +00:00
Ban Yongping 68feaba2ed fix(migrations): use all configured GitHub tokens (#38841)
GitHub migrations accept multiple comma-separated OAuth tokens, but
clients with unknown rate data are never selected. After the first
client is used, every later token stays unknown and can never
participate in quota-aware selection.

Select each client with unknown rate data once before falling back to
the existing highest-remaining-rate choice. The regression test covers
initial probing of all clients and then selection by remaining quota.

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

Assisted-by: Codex:GPT-5

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-08-13 14:46:45 +00:00
wxiaoguang d2be79a942 fix: update collaborator access mode (#38894)
There is already AddOrUpdateCollaborator, don't duplicate the code.
2026-08-13 09:54:33 +00:00