0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-02-22 21:53:17 +01:00

5081 Commits

Author SHA1 Message Date
Semenets V. Pavel
45d3e146ff
Merge branch 'main' into feature/workflow-graph 2026-02-20 20:45:17 +03:00
Jörg Thalheim
3830d488d5
actions: report commit status for pull_request_review events (#36589)
Workflows triggered by pull_request_review events (approved, rejected,
comment) complete successfully but never create a commit status on the
PR. This makes them invisible in the merge checks UI, breaking any CI
gate that re-evaluates on review submission.

The commit status handler's switch statement was missing the three
review event types, so they fell through to the default case which
returned empty strings. Additionally, review events use
PullRequestPayload but IsPullRequest() returns false for them (Event()
returns "pull_request_approved" etc. instead of "pull_request"), so
GetPullRequestEventPayload() refuses to parse their payload.

Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
Co-authored-by: silverwind <me@silverwind.io>
2026-02-20 16:12:22 +00:00
Semenets V. Pavel
4b3e863fab
Merge branch 'main' into feature/workflow-graph 2026-02-19 07:46:55 +03:00
silverwind
5e9b9b33d1
Clean up Makefile, tests and legacy code (#36638)
This simplifies the Makefile by removing the whole-file wrapping that
creates a tempdir introduced by
https://github.com/go-gitea/gitea/pull/11126. REPO_TEST_DIR is removed
as well.

Also clean up a lot of legacy code: unnecessary XSS test, incorrect test
env init, unused "_old_uid" hack, etc

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-19 01:23:32 +00:00
Semenets V. Pavel
5192f0572e
Merge branch 'main' into feature/workflow-graph 2026-02-19 03:42:58 +03:00
silverwind
147bdfce0d
Add actions.WORKFLOW_DIRS setting (#36619)
Fixes: https://github.com/go-gitea/gitea/issues/36612

This new setting controls which workflow directories are searched. The
default value matches the previous hardcoded behaviour.

This allows users for example to exclude `.github/workflows` from being
picked up by Actions in mirrored repositories by setting `WORKFLOW_DIRS
= .gitea/workflows`.

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 01:31:01 +01:00
Semenets V. Pavel
f59d768572
Merge branch 'main' into feature/workflow-graph 2026-02-18 07:59:34 +03:00
silverwind
1b874d1403
Use first commit title for multi-commit PRs and fix auto-focus title field (#36606)
Fixes: https://github.com/go-gitea/gitea/issues/34865

1. When opening a PR from a branch with multiple commits, use the first
(oldest) commit's title as the default title instead of the branch name
2. Fix autofocus on PR title input field

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-17 09:06:27 +01:00
silverwind
cfc60b2142
Use relative-time to render absolute dates (#36238)
`<relative-time>` can render absolute dates when passed
[`threshold="P0Y"`](https://github.com/github/relative-time-element#threshold-string-default-p30d)
and `prefix=""`, so remove the previously used `<absolute-date>` element
in its favor.

Devtest before:

<img width="324" height="210" alt="Screenshot 2025-12-23 at 20 22 44"
src="https://github.com/user-attachments/assets/cf78e0e7-f480-415f-98d5-09b25f9d5a8b"
/>

Devtest after:

<img width="274" height="184" alt="Screenshot 2025-12-23 at 20 22 49"
src="https://github.com/user-attachments/assets/5e7d25f6-eea1-4a8c-ba71-02b570804b95"
/>

Repo activity (rendering unchanged):

<img width="1023" height="67" alt="image"
src="https://github.com/user-attachments/assets/2c4fd6cb-14ab-43c6-ae4b-f86946b28288"
/>

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-16 10:58:04 +00:00
silverwind
0e99932530
Only turn links to current instance into hash links (#36237)
Given the following markdown:

```
a832c723cd
19fe6cdf81
a832c723cd
```

Previously, all links would turn into hash link, even ones to external
sites:

<img width="849" height="89" alt="Screenshot 2025-12-23 at 19 19 13"
src="https://github.com/user-attachments/assets/2ad35a18-4542-40a4-a838-7ab8ac8bc047"
/>

After this change, only links to the current instance, as identified by
`setting.AppURL` are turned into hash links:

<img width="850" height="87" alt="Screenshot 2025-12-23 at 19 18 56"
src="https://github.com/user-attachments/assets/2c49a5b2-426c-4a82-a610-9b9da8dcfff9"
/>

There is still one notable [difference with
GitHub](https://github.com/silverwind/symlink-test/issues/20#issuecomment-3687535938)
where the second link should render like `user/repo@<hash>`, not
`<hash>` as currently, I would like to fix that here as well.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 10:27:49 +00:00
silverwind
a0160694b9
Enable nilnil linter for new code (#36591)
Fixes: https://github.com/go-gitea/gitea/issues/36152

Enable the `nilnil` linter while adding `//nolint` comments to existing
violations. This will ensure no new issues enter the code base while we
can fix existing issues gradually.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 09:57:18 +00:00
Semenets V. Pavel
4b87e2a3b8
Merge branch 'main' into feature/workflow-graph
Signed-off-by: Semenets V. Pavel <p.semenets@gmail.com>
2026-02-16 08:23:27 +03:00
silverwind
8fdda2dd83
Fix linguist-detectable attribute being ignored for configuration files (#36640)
Fixes: go-gitea/gitea#36637. `linguist-detectable` must be able to
override the config classification.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 03:32:46 +00:00
wxiaoguang
258754f299
Fix chroma lexer mapping (#36629)
Fix some edge cases for ".hcl" and ".v" files, and add more tests
2026-02-16 02:11:02 +00:00
Tyrone Yeh
7a8fe9eb37
feat(db): Improve BuildCaseInsensitiveLike with lowercase (#36598)
Improve BuildCaseInsensitiveLike with lowercase, users are more likely
to input lowercase letters, so lowercase letters are used.

---------

Signed-off-by: Tyrone Yeh <siryeh@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-14 07:40:59 +00:00
Semenets V. Pavel
4d4e16e049
Merge branch 'main' into feature/workflow-graph
Signed-off-by: Semenets V. Pavel <p.semenets@gmail.com>
2026-02-13 11:35:37 +03:00
wxiaoguang
0d8bd7720d
Refactor highlight and diff (#36599)
1. fix a performance regression when using line-by-line highlighting
* the root cause is that chroma's `lexers.Get` is slow and a lexer cache
is missing during recent changes
2. clarify the chroma lexer detection behavior
* now we fully manage our logic to detect lexer, and handle overriding
problems, everything is fully under control
3. clarify "code analyze" behavior, now only 2 usages:
* only use file name and language to detect lexer (very fast), mainly
for "diff" page which contains a lot of files
* if no lexer is detected by file name and language, use code content to
detect again (slow), mainly for "view file" or "blame" page, which can
get best result
4. fix git diff bug, it caused "broken pipe" error for large diff files
2026-02-13 00:15:46 +00:00
silverwind
4b36f01bf4
Update emoji data for Unicode 16 (#36596)
Use emoji data from https://github.com/github/gemoji/pull/303 because
`github/gemoji` is unmaintained.

`assets/emoji.json` is now pretty-printed so that future diffs will
actually be readable. This causes no isses as the only place where it is
used is in frontend which imports it via `with {type: 'json'}` where
whitespace is irrelevant.

<img width="205" height="75" alt="image"
src="https://github.com/user-attachments/assets/96e335b8-acf6-4996-ace4-824c0870a7d3"
/>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 21:39:36 +00:00
wxiaoguang
2876800cb2
Fine tune diff highlighting (#36592) 2026-02-12 07:01:36 +00:00
silverwind
45ee571693
Update to go 1.26.0 and golangci-lint 2.9.0 (#36588) 2026-02-11 18:37:13 +01:00
Semenets V. Pavel
a6bac394fb
Merge branch 'main' into feature/workflow-graph 2026-02-11 05:40:28 +03:00
Lunny Xiao
18ccee0f2f
Fix mirror sync parser and fix mirror messages (#36504)
Fix #36474 

It also fixed a bug when sync deleted branches.
2026-02-11 00:16:05 +00:00
wxiaoguang
8cc8150922
Use full-file highlighting for diff sections (#36561)
* Fix #35252
* Fix #35999
* Improve diff rendering, don't add unnecessary "added"/"removed" tags for a full-line change
* Also fix a "space trimming" bug in #36539 and add tests
* Use chroma "SQL" lexer instead of "MySQL" to workaround a bug (35999)
2026-02-10 03:29:28 +00:00
Semenets V. Pavel
261b343ab0
Merge branch 'main' into feature/workflow-graph 2026-02-08 23:37:30 +03:00
wxiaoguang
08b7a30867
Fix various version parsing problems (#36553)
1. handle non-release git verions (not semver)
2. fix rubygems version "0" handling (only ">=" can be omitted)
3. lazy compile the regexp to improve performance
4. make test data maintainable, use origin source code instead of compressed binary
2026-02-08 20:25:30 +00:00
Sebastian Ertz
daf0483ef2
Update go dependencies (#36548) 2026-02-08 12:01:37 +00:00
Semenets V. Pavel
0f9d18a712
Merge branch 'main' into feature/workflow-graph 2026-02-08 12:43:33 +03:00
Louis
e2104a1dd5
Allow configuring default PR base branch (fixes #36412) (#36425)
This adds a per-repository default PR base branch and wires it through
PR entry points. It updates compare links and recently pushed branch
prompts to respect the configured base branch, and prevents auto-merge
cleanup from deleting the configured base branch on same-repo PRs.

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

---------

Signed-off-by: Louis <116039387+tototomate123@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-02-07 01:34:29 +00:00
Semenets V. Pavel
6e6decd936
Merge branch 'main' into feature/workflow-graph 2026-02-06 10:57:10 +03:00
Copilot
000d7c1ccb
Improve timeline entries for WIP prefix changes in pull requests (#36518)
Add new timeline event types when the WIP prefix is added or removed,
replacing the previous ugly title change messages.

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

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-05 05:57:08 +00:00
Semenets V. Pavel
b7c87025d3
Merge branch 'main' into feature/workflow-graph 2026-02-02 00:14:08 +03:00
Nicolas
c2dea22926
Add resolve/unresolve review comment API endpoints (#36441)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-01 12:28:28 +00:00
Copilot
584d8ef75f
Fix incorrect vendored detections (#36508)
Fixes: https://github.com/go-gitea/gitea/issues/22618

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

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

---------

Signed-off-by: silverwind <me@silverwind.io>
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-01 10:35:51 +00:00
Semenets V. Pavel
ce16e4fdc3
Merge branch 'main' into feature/workflow-graph 2026-01-31 11:40:34 +03:00
Copilot
8feabe4160
Add FOLDER_ICON_THEME configuration option (#36496)
Fixes: https://github.com/go-gitea/gitea/issues/35182
Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-01-30 20:48:56 +00:00
silverwind
2d1306291b
Use reserved .test TLD for unit tests (#36498)
`smtp.mydomain.test` is a real domain that resolves to something and
which is being connected to while running tests. Instead, use
[.test](https://en.wikipedia.org/wiki/.test) which is guaranteed to
never be registered on the internet, so all connections to it will fail
with NXDOMAIN dns error.
2026-01-30 19:42:32 +00:00
wxiaoguang
07ada3666b
chore: add comments for "api/healthz", clean up test env (#36481)
GITEA_UNIT_TESTS_LOG_SQL is renamed to GITEA_TEST_LOG_SQL
2026-01-30 10:23:38 +08:00
Semenets V. Pavel
39d9a64a8a
Merge branch 'main' into feature/workflow-graph
Signed-off-by: Semenets V. Pavel <p.semenets@gmail.com>
2026-01-29 21:07:56 +03:00
Lunny Xiao
1463426a27
Use merge tree to detect conflicts when possible (#36400)
In Git 2.38, the `merge-tree` command introduced the `--write-tree`
option, which works directly on bare repositories. In Git 2.40, a new parameter `--merge-base` introduced so we require Git 2.40 to use the merge tree feature.

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

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

Replace #35542

---------

Signed-off-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-27 11:57:20 -08:00
wxiaoguang
4c8f6dfa4e
Support rendering OpenAPI spec (#36449)
Fix #20852
2026-01-26 10:34:38 +08:00
Moritz Jörg
89bfddc5c2
Normalize guessed languages for code highlighting (#36450)
For when Enry correctly recognized the language, but returns the
language name in a way that isn't recognized by chroma.

Resolves https://github.com/go-gitea/gitea/issues/22443

---------

Co-authored-by: Moritz Jörg <moritz.jorg@oceanbox.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-25 14:02:16 +00:00
wxiaoguang
ddc9d29713
Fix various bugs (#36446)
* Fix #36409
* Fix #36322
* Fix #30101
* Fix #36317

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-24 11:30:47 +00:00
silverwind
a608b9e1e3
Update tool dependencies (#36445)
Updates all dependencies in `Makefile`. The go fix was done
automatically, I just altered the variable name.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-24 09:58:28 +01:00
wxiaoguang
9de659437e
Refactor template render (#36438) 2026-01-24 05:11:49 +00:00
Heath Dutton🕴️
0f78b99998
Fix markup heading parsing, fix emphasis parsing (#36284)
Fixes #36106, fix #17958

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-23 20:24:58 +00:00
wxiaoguang
e42a1dbb6b
Refactor GetRepoRawDiffForFile to avoid unnecessary pipe or goroutine (#36434) 2026-01-23 02:10:11 +00:00
wxiaoguang
3a09d7aa8d
Refactor git command stdio pipe (#36422)
Most potential deadlock problems should have been fixed, and new code is
unlikely to cause new problems with the new design.

Also raise the minimum Git version required to 2.6.0 (released in 2015)
2026-01-22 06:04:26 +00:00
luo jiyin
6a5f9e12f9
Fix typos: unknow -> unknown, pktLineTypeUnknow -> pktLineTypeUnknown (#36419) 2026-01-22 01:17:06 +00:00
Lunny Xiao
d46021a83a
Allow foreachref parse max tokens from 4*64KB to 4MB (#36414)
Fix #36408

---------

Signed-off-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-21 04:18:57 +00:00
wxiaoguang
9ea91e036f
Refactor git command context & pipeline (#36406)
Less and simpler code, fewer bugs
2026-01-21 01:35:14 +00:00