Commit Graph

19573 Commits

Author SHA1 Message Date
71e4740946 Refactor some file edit related code (#34744)
Follow up #34350

---------

Co-authored-by: delvh <dev.lh@web.de>
2025-06-18 01:18:07 +00:00
ecc6685c20 [skip ci] Updated translations via Crowdin 2025-06-18 00:37:12 +00:00
a14db5c5e3 Fix ghost user in feeds when pushing in an actions, it should be gitea-actions (#34703) 2025-06-17 23:44:35 +00:00
ee334886f3 upgrade orgmode to v1.8.0 (#34721) 2025-06-17 19:30:43 +00:00
1376cf7481 Support title and body query parameters for new PRs (#34537)
Currently, Gitea supports title and body query parameters when creating
new issues, allowing pre-filling those fields via URL parameters.
However, similar support for pull requests (PRs) does not exist.

This feature adds support for the title, body, and quick_pull query
parameters in the new pull request creation page. These parameters work
similarly to GitHub’s behavior, allowing users to pre-populate the PR
title and body, and optionally expand the PR creation form
automatically.

By supporting these query parameters, it improves the usability and
automation capabilities when creating pull requests via direct URLs,
aligning Gitea more closely with GitHub’s user experience.

---------

Co-authored-by: root <root@DESKTOP-UPANUTP>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-06-17 12:05:10 -07:00
f214bb40a3 Improve nuget/rubygems package registries (#34741)
1. Add some missing (optional) fields for nuget v2, and sort the fields
to make it easier to maintain
2. Add missing "platform" for rubygems: `VERSION-PLATFORM` and
`VERSION_PLATFORM`

Co-authored-by: Giteabot <teabot@gitea.io>
2025-06-17 19:42:00 +02:00
224aa64cd9 Replace update repository function in some places (#34566)
Some checks are pending
release-nightly / nightly-binary (push) Waiting to run
release-nightly / nightly-docker-rootful (push) Waiting to run
release-nightly / nightly-docker-rootless (push) Waiting to run
cron-translations / crowdin-pull (push) Has been skipped
`UpdateAllCols` is dangerous, the columns should be updated when
necessary.

This PR replaces some `updateRepository` invokes to reduce possible
problems and wrongly updated time. Some parts have been fixed in #34388,
but some are hidden in the function `updateRepository`. Alternatively,
using `UpdateRepositoryColsNoAutoTime` to update the changed columns.

Some `UpdateRepoSize` invokes are duplicated, so they will be removed
when extracting from `updateRepository`.
2025-06-17 09:54:25 -07:00
1e644e39f9 remove unnecessary duplicate code (#34733) 2025-06-17 12:23:56 -04:00
037f72bdb3 fix: prevent double markdown link brackets when pasting URL (#34745)
When adding a link using the "Add a link" button in comment editor,
pasting a URL resulted in incorrect Markdown formatting (double
brackets) instead of replacing the placeholder text.

This fix adds a context check to prevent creating a new markdown link
when we're already inside an existing one.

Fixes #34740

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-06-17 21:33:50 +08:00
4cbb482554 Fix JS error for "select" dropdown (#34743)
Regression of recent dropdown filter change.
2025-06-17 19:19:08 +08:00
439ebe7031 [skip ci] Updated translations via Crowdin 2025-06-17 00:37:42 +00:00
3a37d63d61 Allow renaming/moving binary/LFS files in the UI (#34350)
Adds the ability to rename/move binary files like binary blobs or images
and files that are too large in the web ui.
This was purposed in #24722, along with the ability edit images via an
upload of a new image, which I didn't implement here (could be done in a
separate PR).

Binary file content:

![binary](https://github.com/user-attachments/assets/61d9ff71-25d3-4832-9288-452cdefc7283)

File too large:

![toolarge](https://github.com/user-attachments/assets/3b42dbd0-e76a-4c3c-92d2-52ebffedea64)

GitHub does the same (I've copied the text from there):

![gh](https://github.com/user-attachments/assets/e1499813-fb71-4544-9d58-086046a5f13e)
2025-06-16 17:15:07 -07:00
24ce2058e8 Clean bindata (#34728)
Some checks are pending
release-nightly / nightly-binary (push) Waiting to run
release-nightly / nightly-docker-rootful (push) Waiting to run
release-nightly / nightly-docker-rootless (push) Waiting to run
cron-translations / crowdin-pull (push) Has been skipped
Follow #34692
2025-06-16 12:03:51 +00:00
6b8b580218 Refactor container and UI (#34736)
Some checks are pending
release-nightly / nightly-binary (push) Waiting to run
release-nightly / nightly-docker-rootful (push) Waiting to run
release-nightly / nightly-docker-rootless (push) Waiting to run
2025-06-16 16:27:01 +08:00
bbee652e29 Prevent duplicate form submissions when creating forks (#34714)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2025-06-16 04:19:16 +00:00
637070e07b Fix container range bug (#34725)
Some checks are pending
release-nightly / nightly-binary (push) Waiting to run
release-nightly / nightly-docker-rootful (push) Waiting to run
release-nightly / nightly-docker-rootless (push) Waiting to run
Fix #34724
2025-06-15 21:55:11 +03:00
0d3e9956cd [skip ci] Updated translations via Crowdin 2025-06-15 00:41:44 +00:00
28debdbe00 [skip ci] Updated translations via Crowdin 2025-06-14 00:35:48 +00:00
dcc9206a59 Raise minimum Node.js version to 20, test on 24 (#34713)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-docker-rootful (push) Has been cancelled
release-nightly / nightly-docker-rootless (push) Has been cancelled
cron-translations / crowdin-pull (push) Has been skipped
- Node.js 18 is now EOL, so raise minimum version to current LTS v20
- Test on 24
- Change devcontainers to use LTS version (currently 22),
[ref](https://github.com/devcontainers/features/tree/main/src/node)
2025-06-13 13:40:39 -04:00
bc28654b49 [skip ci] Updated translations via Crowdin 2025-06-13 00:37:13 +00:00
d21ce9fa07 Improve the performance when detecting the file editable (#34653)
Some checks failed
cron-translations / crowdin-pull (push) Has been skipped
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-docker-rootful (push) Has been cancelled
release-nightly / nightly-docker-rootless (push) Has been cancelled
Noticed the SQL will be executed 4 times when visit the file render view
page. For a repository which have many pull requests, it maybe slow.
```SQL
2025/06/08 15:24:44 models/issues/pull_list.go:69:GetUnmergedPullRequestsByHeadInfo() [I] [SQL] SELECT * FROM `pull_request` INNER JOIN `issue` ON issue.id = pull_request.issue_id WHERE (head_repo_id = ? AND head_branch = ? AND has_merged = ? AND issue.is_closed = ? AND flow = ?) [393 main false false 0] - 2.004167ms
2025/06/08 15:24:44 models/issues/pull_list.go:69:GetUnmergedPullRequestsByHeadInfo() [I] [SQL] SELECT * FROM `pull_request` INNER JOIN `issue` ON issue.id = pull_request.issue_id WHERE (head_repo_id = ? AND head_branch = ? AND has_merged = ? AND issue.is_closed = ? AND flow = ?) [393 main false false 0] - 1.03975ms
2025/06/08 15:24:44 models/issues/pull_list.go:69:GetUnmergedPullRequestsByHeadInfo() [I] [SQL] SELECT * FROM `pull_request` INNER JOIN `issue` ON issue.id = pull_request.issue_id WHERE (head_repo_id = ? AND head_branch = ? AND has_merged = ? AND issue.is_closed = ? AND flow = ?) [393 main false false 0] - 881.583µs
2025/06/08 15:24:44 models/issues/pull_list.go:69:GetUnmergedPullRequestsByHeadInfo() [I] [SQL] SELECT * FROM `pull_request` INNER JOIN `issue` ON issue.id = pull_request.issue_id WHERE (head_repo_id = ? AND head_branch = ? AND has_merged = ? AND issue.is_closed = ? AND flow = ?) [393 main false false 0] - 935.084µs
```

This PR did a refactor to query it once only.
2025-06-12 18:12:45 +00:00
8fed27bf6a Fix various problems (#34708)
* Fix #34707
* Fix dropdown filter handling
* Fix #27014
2025-06-12 09:19:24 -07:00
65986f423f Refactor embedded assets and drop unnecessary dependencies (#34692)
Some checks are pending
release-nightly / nightly-binary (push) Waiting to run
release-nightly / nightly-docker-rootful (push) Waiting to run
release-nightly / nightly-docker-rootless (push) Waiting to run
Benefits:

1. smaller binary size (reduces more than 1MB)
2. better control of the assets details
3. fewer unmaintained dependencies
4. faster startup if the assets are not needed
5. won't hang up editors when open "bindata.go" by accident
2025-06-12 03:59:33 +00:00
18bafcc378 Bump minimum go version to 1.24.4 (#34699)
Fixes 3 open govulncheck issues.
2025-06-12 03:33:36 +00:00
8d135ef5cf Update JS deps (#34701)
Result of `make update-js`. Fixes
https://github.com/go-gitea/gitea/security/dependabot/114.
2025-06-12 05:06:27 +02:00
d5893ee260 Fix markdown wrap (#34697)
Fix #34696
2025-06-12 10:09:42 +08:00
06ccb3a1d4 [skip ci] Updated translations via Crowdin 2025-06-12 00:36:44 +00:00
94db956e31 frontport changelog (#34689)
Some checks are pending
release-nightly / nightly-docker-rootful (push) Waiting to run
release-nightly / nightly-docker-rootless (push) Waiting to run
release-nightly / nightly-binary (push) Waiting to run
cron-translations / crowdin-pull (push) Has been skipped
2025-06-11 16:58:39 +00:00
c9505a26b9 Improve instance wide ssh commit signing (#34341)
Some checks are pending
release-nightly / nightly-binary (push) Waiting to run
release-nightly / nightly-docker-rootful (push) Waiting to run
release-nightly / nightly-docker-rootless (push) Waiting to run
* Signed SSH commits can look in the UI like on GitHub, just like gpg keys today in Gitea
* SSH format can be added in gitea config
* SSH Signing worked before with DEFAULT_TRUST_MODEL=committer

`TRUSTED_SSH_KEYS` can be a list of additional ssh public key contents
to trust for every user of this instance

Closes #34329
Related #31392

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-06-11 10:32:55 +00:00
fbc3796f9e Fix pull requests API convert panic when head repository is deleted. (#34685)
Some checks are pending
release-nightly / nightly-binary (push) Waiting to run
release-nightly / nightly-docker-rootful (push) Waiting to run
release-nightly / nightly-docker-rootless (push) Waiting to run
Fix #34682
2025-06-10 20:19:52 -07:00
d5afdccde8 [skip ci] Updated translations via Crowdin 2025-06-11 00:37:02 +00:00
17cfae82a5 Hide href attribute of a tag if there is no target_url (#34556)
Some checks are pending
release-nightly / nightly-binary (push) Waiting to run
release-nightly / nightly-docker-rootful (push) Waiting to run
release-nightly / nightly-docker-rootless (push) Waiting to run
cron-translations / crowdin-pull (push) Has been skipped
Relate #34450
2025-06-10 19:32:20 +00:00
1610a63bfd Fix commit message rendering and some UI problems (#34680)
* Fix #34679
* Fix #34676
* Fix #34674
* Fix #34526
2025-06-10 23:20:32 +08:00
e9f5105e95 Migrate to urfave v3 (#34510)
Some checks are pending
release-nightly / nightly-binary (push) Waiting to run
release-nightly / nightly-docker-rootful (push) Waiting to run
release-nightly / nightly-docker-rootless (push) Waiting to run
migrate cli to urfave v3

add more cli tests

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-06-10 12:35:12 +00:00
2c341b6803 [skip ci] Updated translations via Crowdin 2025-06-10 00:37:13 +00:00
0082cb51fa Fix last admin check when syncing users (#34649)
Some checks are pending
release-nightly / nightly-docker-rootful (push) Waiting to run
release-nightly / nightly-docker-rootless (push) Waiting to run
release-nightly / nightly-binary (push) Waiting to run
cron-translations / crowdin-pull (push) Has been skipped
Fix #34358
2025-06-09 20:57:45 +00:00
92e7e98c56 Update x/crypto package and make builtin SSH use default parameters (#34667) 2025-06-09 19:51:02 +00:00
7b39c82587 Fix "oras" OCI client compatibility (#34666)
Fix #25846

1. the ImageConfig can be empty, fall back to default
2. the blob size can be empty, it still needs "Content-Length" header
2025-06-09 18:51:05 +00:00
b408bf2f0b Fix: skip paths check on tag push events in workflows (#34602)
## Summary
Fix skipping of `paths` condition in workflows triggered by tag push
events.

## Details
- Ensure workflows triggered by tag pushes bypass the `paths` filter
check.
- Prevent incorrect skipping of workflows due to `paths` conditions on
tag pushes.
- Added and updated unit tests to verify correct behavior.
2025-06-09 17:44:45 +00:00
c6b2cbd75d Fix footnote jump behavior on the issue page. (#34621)
Close #34511 
Close #34590 

Add comment ID to the footnote item's id attribute to ensure uniqueness.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-06-09 17:18:11 +00:00
9165ea8713 Only activity tab needs heatmap data loading (#34652)
Some checks are pending
release-nightly / nightly-binary (push) Waiting to run
release-nightly / nightly-docker-rootful (push) Waiting to run
release-nightly / nightly-docker-rootless (push) Waiting to run
2025-06-09 21:02:16 +08:00
7a59f5a825 Ignore "Close" error when uploading container blob (#34620) 2025-06-09 07:06:21 +00:00
6d0b24064a Keeping consistent between UI and API about combined commit status state and fix some bugs (#34562)
Some checks are pending
release-nightly / nightly-binary (push) Waiting to run
release-nightly / nightly-docker-rootful (push) Waiting to run
release-nightly / nightly-docker-rootless (push) Waiting to run
Extract from #34531 

## Move Commit status state to a standalone package

Move the state from `structs` to `commitstatus` package. It also
introduce `CommitStatusStates` so that the combine function could be
used from UI and API logic.

## Combined commit status Changed

This PR will follow Github's combined commit status. Before this PR,
every commit status could be a combined one.
According to
https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#get-the-combined-status-for-a-specific-reference
> Additionally, a combined state is returned. The state is one of:
> failure if any of the contexts report as error or failure
> pending if there are no statuses or a context is pending
> success if the latest status for all contexts is success

This PR will follow that rule and remove the `NoBetterThan` logic. This
also fixes the inconsistent between UI and API. In the API convert
package, it has implemented this which is different from the UI. It also
fixed the missing `URL` and `CommitURL` in the API.

## `CalcCommitStatus` return nil if there is no commit statuses

The behavior of `CalcCommitStatus` is changed. If the parameter commit
statuses is empty, it will return nil. The reference places should check
the returned value themselves.
2025-06-09 04:05:33 +00:00
f6041441ee Refactor FindOrgOptions to use enum instead of bool, fix membership visibility (#34629) 2025-06-09 03:30:34 +00:00
1fe652cd26 [skip ci] Updated translations via Crowdin 2025-06-09 00:39:30 +00:00
a9a705f4db Fix missed merge commit sha and time when migrating from codecommit (#34645)
Some checks are pending
release-nightly / nightly-docker-rootless (push) Waiting to run
release-nightly / nightly-binary (push) Waiting to run
release-nightly / nightly-docker-rootful (push) Waiting to run
cron-translations / crowdin-pull (push) Has been skipped
Fix #34627
2025-06-08 16:16:23 +00:00
1e0758a9f1 [skip ci] Updated translations via Crowdin 2025-06-08 00:41:38 +00:00
cc942e2a86 Fix GetUsersByEmails (#34643)
Some checks are pending
release-nightly / nightly-binary (push) Waiting to run
release-nightly / nightly-docker-rootful (push) Waiting to run
release-nightly / nightly-docker-rootless (push) Waiting to run
cron-translations / crowdin-pull (push) Has been skipped
2025-06-07 18:30:36 +00:00
7fa5a88831 Add --color-logo for text that should match logo color (#34639)
Add a new color that indicates the logo's primary color and use it in
the frontpage over previous green color. This will be useful for
customization.

<img width="1347" alt="Screenshot 2025-06-07 at 16 53 34"
src="https://github.com/user-attachments/assets/496aa81f-c910-4c28-bd12-f2473a68bbab"
/>
2025-06-07 18:02:28 +00:00
f6f6aedd4f Update JS deps, regenerate SVGs (#34640)
Result of `make update-js svg`.
2025-06-07 17:59:36 +00:00