0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-01-24 10:46:02 +01:00

809 Commits

Author SHA1 Message Date
Excellencedev
13660f202d cleanup 2026-01-03 13:39:01 +01:00
Excellencedev
9faf677652
Merge branch 'main' into fix-24635 2026-01-03 10:32:01 +01:00
Excellencedev
3e95499bcf green up ci 2026-01-03 10:31:44 +01:00
wxiaoguang
b79dbfa990
Fix link/origin referrer and login redirect (#36279)
Fix #35998

1. Fix `<a rel>` :
    * "_blank" already means "noopener"
* "noreferrer" is already provided by page's `<meta name="referrer">`
2. Fix "redirect_to" mechisam
* Use "referer" header to determine the redirect link for a successful
login
3. Simplify code and merge duplicate logic
2026-01-03 11:43:04 +08:00
Excellencedev
be52d4a338 ... 2026-01-02 10:42:18 +01:00
Excellencedev
285f366f22 ... 2026-01-02 10:12:47 +01:00
Excellencedev
91f8298828 comile errors 2026-01-02 09:42:39 +01:00
Excellencedev
a944be1bf2 improve test 2026-01-02 09:28:56 +01:00
Excellencedev
3af786ccee
Merge branch 'main' into fix-24635 2026-01-01 06:39:03 +01:00
wxiaoguang
094104bc91
Make "commit statuses" API accept slashes in "ref" (#36264)
Fix #36253

Support slashes in `{ref}` (follow GitHub's behavior)
2026-01-01 09:56:07 +08:00
Excellencedev
f3b14570f2 Feedback 2025-12-31 19:14:10 +01:00
Excellencedev
2e7bd47be6 chore: fix ci 2025-12-31 06:00:05 +01:00
Excellencedev
1ff75aa822 Implement Workflow Level Permissions 2025-12-31 05:11:28 +01:00
Excellencedev
efb93b5da1 Fixes 2025-12-30 04:38:04 +01:00
Excellencedev
f9f24dd466 Make all CI green again 2025-12-26 13:15:32 +01:00
Excellencedev
ae43a09aa8 ... 2025-12-26 12:49:27 +01:00
Excellencedev
4ccb766bf2 Re-implement changes for feedback 2025-12-26 09:18:59 +01:00
Excellencedev
7df7f72a71
Merge branch 'main' into fix-24635
Signed-off-by: Excellencedev <ademiluyisuccessandexcellence@gmail.com>
2025-12-26 08:23:33 +01:00
silverwind
42d294941c
Replace CSRF cookie with CrossOriginProtection (#36183)
Removes the CSRF cookie in favor of
[`CrossOriginProtection`](https://pkg.go.dev/net/http#CrossOriginProtection)
which relies purely on HTTP headers.

Fixes: https://github.com/go-gitea/gitea/issues/11188
Fixes: https://github.com/go-gitea/gitea/issues/30333
Helps: https://github.com/go-gitea/gitea/issues/35107

TODOs:

- [x] Fix tests
- [ ] Ideally add tests to validates the protection

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-12-25 12:33:34 +02:00
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