0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-01-25 23:45:54 +01:00

746 Commits

Author SHA1 Message Date
Excellencedev
973de056e8 review comment 2025-12-24 13:02:07 +01:00
Excellencedev
ebf7e2ea8c fix test 2025-12-24 06:26:31 +01:00
Excellencedev
43279bfb8b Use correct authentication 2025-12-24 05:57:51 +01:00
Excellencedev
9ada493d72 Add cross repo package access test 2025-12-24 05:29:27 +01:00
Excellencedev
9bd8b8109d Review comment fixes 2025-12-24 02:49:37 +01:00
Excellencedev
a72803dec1
Merge branch 'main' into fix-24635 2025-12-22 08:09:37 +01:00
Gregorius Bima Kharisma Wicaksana
b6ffe0e4e9
refactor: extract helper functions from SearchIssues (#36158)
## Summary

This PR refactors the `SearchIssues` function in
`routers/api/v1/repo/issue.go` by extracting common logic into reusable
helper functions:

- `parseIssueIsClosed()`: Parses the "state" query parameter and returns
the corresponding `isClosed` option
- `parseIssueIsPull()`: Parses the "type" query parameter and returns
the corresponding `isPull` option
- `buildSearchIssuesRepoIDs()`: Builds the list of repository IDs for
issue search based on query parameters

### Benefits:
- Improved code readability
- Smaller, more focused functions
- Easier to test individual components
- Potential for reuse in other handlers

### Changes:
- Extracted 3 helper functions from the ~292 line `SearchIssues`
function
- No functional changes - behavior remains the same
- Proper error handling preserved

## Test plan
- [ ] Verify existing API tests pass
- [ ] Manual testing of `/repos/issues/search` endpoint

Ref: #35015

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-12-20 17:57:41 -08:00
Excellencedev
463c670d06 issue fix 2025-12-20 08:28:58 +01:00
Excellencedev
6cc6fd7f68 lint 2025-12-20 07:50:12 +01:00
Excellencedev
38f384aca2 fmt 2025-12-20 07:38:11 +01:00
Excellencedev
5628ab713b lint 2025-12-20 07:31:41 +01:00
Excellencedev
b0c2a958b5 Format 2025-12-20 07:02:20 +01:00
Excellencedev
06b3db5507 Improve test coverage 2025-12-20 06:51:34 +01:00
Excellencedev
b2f05ff4f7 fix test 2025-12-20 06:19:38 +01:00
Excellencedev
b0811fe686 Formatting issues 2025-12-20 05:52:40 +01:00
Excellencedev
9c5b278622 Fix all bugs I found in the code 2025-12-20 05:46:33 +01:00
Excellencedev
5eb2f12b0e wip 2025-12-19 03:41:22 +01:00
Excellencedev
a6b6e709d9 update tesr 2025-12-18 19:07:51 +01:00
Excellencedev
65051b1762 Fix checks 2025-12-18 18:13:40 +01:00
Excellencedev
a4aae82c18 Fix test 2025-12-18 16:51:39 +01:00
Excellencedev
fd1afc5e4c Fixing Test Failures for Token Permissions 2025-12-18 15:54:59 +01:00
Excellencedev
0682fd8f04 Fix test 2025-12-18 15:16:51 +01:00
Excellencedev
9a69f65ee4 Adress all review comments 2025-12-18 04:01:54 +01:00
Excellencedev
e20d12e8a7
Merge branch 'main' into fix-24635 2025-12-18 02:39:42 +01:00
Lunny Xiao
efd5dd4f0b
Fix bug when creating pull request (#36166)
Extract from #36105 

Fix #36116
Fix #35912
Fix #20906
2025-12-17 21:21:04 +00:00
Lunny Xiao
ebf9b4dc6b
Use a migration test instead of a wrong test which populated the meta test repositories and fix a migration bug (#36160)
The test `TestGiteaUploadUpdateGitForPullRequest` modified the shared
meta test repositories directly, so this PR removes that test and
replaces it with an integration test that migrates a real repository
from gitea.com into a local test instance.

This PR also fixes a bug where pull-request migrations were not
correctly syncing head branches to the database.
2025-12-17 12:00:07 -08:00
Excellencedev
249794c92c
Merge branch 'main' into fix-24635 2025-12-17 12:24:50 +01:00
Excellencedev
3a10e8f4f5 feat: Add configurable permissions for Actions automatic tokens 2025-12-17 07:13:59 +01:00
silverwind
84b74d7c3e
Enable bodyclose linter (#36168)
Enabe
[`bodyclose`](https://golangci-lint.run/docs/linters/configuration/#bodyclose).
The only issue in non-test code (`services/migrations/dump.go`) was a
false-positive and I think there are a number of undetected cases, but I
guess it's still better than not having it.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2025-12-16 14:08:43 +01:00
Lunny Xiao
1f5237e0d7
Check user visibility when redirecting to a renamed user (#36148)
Fix #34169
2025-12-14 03:14:18 +01:00
Lunny Xiao
29057ea55f
Fix bug when viewing the commit diff page with non-ANSI files (#36149)
Fix #35504

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-12-13 21:54:03 +08:00
wxiaoguang
f25409fab8
Make Golang correctly delete temp files during uploading (#36128)
Fix #36127
2025-12-11 19:59:42 +01:00
Lunny Xiao
a440116a16
Support updating branch via API (#35951)
Resolve #35368
2025-12-10 19:23:26 +00:00
a1012112796
98ef79d73a
allow action user have read permission in public repo like other user (#36095)
related #28187

---------

Signed-off-by: a1012112796 <1012112796@qq.com>
2025-12-07 10:07:04 -08:00
Lunny Xiao
cb5082f8fe
Fix the bug when ssh clone with redirect user or repository (#36039)
Fix #36026 

The redirect should be checked when original user/repo doesn't exist.
2025-12-04 19:17:49 +00:00
Lunny Xiao
e30a130b9a
Fix edit user email bug in API (#36068)
Follow #36058 for API edit user bug when editing email.

- The Admin Edit User API includes a breaking change. Previously, when
updating a user with an email from an unallowed domain, the request
would succeed but return a warning in the response headers. Now, the
request will fail and return an error in the response body instead.
- Removed `AdminAddOrSetPrimaryEmailAddress` because it will not be used
any where.

Fix https://github.com/go-gitea/gitea/pull/36058#issuecomment-3600005186

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2025-12-04 09:05:13 +01:00
Bryan Mutai
7d6861ac54
Add "Go to file", "Delete Directory" to repo file list page (#35911)
/claim #35898
Resolves #35898 

### Summary of key changes:

1. Add file name search/Go to file functionality to repo button row.
2. Add backend functionality to delete directory
3. Add context menu for directories with functionality to copy path & delete a directory
4. Move Add/Upload file dropdown to right for parity with Github UI
5. Add tree view to the edit/upload UI

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-11-30 11:58:15 +08:00
Zettat123
f4e38e6367
Fix Actions pull_request.paths being triggered incorrectly by rebase (#36045)
Partially fix #34710 

The bug described in #34710 can be divided into two parts: `push.paths`
and `pull_request.paths`. This PR fixes the issue related to
`pull_request.paths`. The root cause is that the check for whether the
workflow can be triggered happens **before** updating the PR’s merge
base. This causes the file-change detection to use the old merge base.
Therefore, we need to update the merge base first and then check whether
the workflow can be triggered.
2025-11-28 19:33:52 +00:00
Zettat123
ed977d9702
Use GitHub-style commit message for squash merge (#35987) 2025-11-22 09:20:45 -08:00
Lunny Xiao
62d750eadb
Fix various permission & login related bugs (#36002)
Permission & protection check:

- Fix Delete Release permission check
- Fix Update Pull Request with rebase branch protection check
- Fix Issue Dependency permission check
- Fix Delete Comment History ID check

Information leaking:

- Show unified message for non-existing user and invalid password
    - Fix #35984
- Don't expose release draft to non-writer users.
- Make API returns signature's email address instead of the user
profile's.

Auth & Login:

- Avoid GCM OAuth2 attempt when OAuth2 is disabled
    - Fix #35510

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-11-22 07:16:08 +00:00
Lunny Xiao
a60a8c6966
Allow empty commit when merging pull request with squash style (#35989)
Before this PR, when merging an empty PR with squash style will result
in 500.

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-11-22 06:02:25 +00:00
wxiaoguang
358de23a50
Fix container push tag overwriting (#35936)
Fix #35853
2025-11-14 03:49:57 +00:00
wxiaoguang
1f3558b65c
Fix corrupted external render content (#35946)
Fix #35944
2025-11-14 08:31:11 +08:00
wxiaoguang
e31f224ad2
Make OAuth2 issuer configurable (#35915)
The new (correct) behavior breaks the old (incorrect) logins.

Add a config option to support legacy "issuer".

Fix #35830
2025-11-10 23:45:01 +08:00
Luohao Wang
bfaddbcd0d
Fix conda null depend issue (#35900)
Fix #35895
2025-11-08 23:29:17 +08:00
Lunny Xiao
d9c0f86de8
Fix incorrect pull request counter (#35819)
Fix #35781, #27472

The PR will not correct the wrong numbers automatically. 

There is a cron task `check_repo_stats` which will be run when Gitea
start or midnight. It will correct the numbers.
2025-11-03 20:52:13 +00:00
Lunny Xiao
b3e5b96111
Fix clone mixed bug (#35810)
Fix #35807
2025-11-02 00:52:59 -07:00
Lunny Xiao
b148bef471
Remove unnecessary function parameter (#35765) 2025-10-31 21:56:08 -07:00
wxiaoguang
de70cd3853
Fix cli "Before" handling (#35797)
Regression of #34973

Fix #35796
2025-10-31 18:12:03 +00:00
Zettat123
3ab8ae5807
Fix actions rerun bug (#35783)
Related issues: #35780, #35782 

Rerunning a job or a run is only allowed when the job is done and the
run is done.

Related PR: #34970
2025-10-30 01:08:59 +00:00