4701 Commits

Author SHA1 Message Date
RedCocoon
5b9049dec0 Add ShouldShowCommentType function when rendering pull review conversation 2024-11-04 19:04:34 +08:00
RedCocoon
0d65d7140b Load issue attributes instead of only loading pullrequest details 2024-11-04 17:47:26 +08:00
RedCocoon
b2a93cdda1 Remove unused data from indexer/search 2024-11-04 17:10:50 +08:00
RedCocoon
f2fc87b278 Load PR attachments before assigning value 2024-11-04 14:18:11 +08:00
RedCocoon
13e8d8488d Undo adding unnecessary ctx Data 2024-11-04 03:57:01 +08:00
RedCocoon
34c0068918 Update pull_review_test.go to add new data to ctx 2024-11-04 01:41:36 +08:00
RedCocoon
2ba22a8a13 Merge remote-tracking branch 'upstream/main' 2024-11-04 00:24:17 +08:00
wxiaoguang
e524f63d58
Fix git error handling (#32401)
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
2024-11-02 11:20:22 +00:00
wxiaoguang
fec6b3d500
Replace DateTime with DateUtils (#32383) 2024-11-02 04:08:28 +00:00
Rowan Bohde
7dcccc3bb1
improve performance of diffs (#32393)
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
This has two major changes that significantly reduce the amount of work
done for large diffs:

* Kill a running git process when reaching the maximum number of files
in a diff, preventing it from processing the entire diff.
* When loading a diff with the URL param `file-only=true`, skip loading
stats. This speeds up loading both hidden files of a diff and sections
of a diff when clicking the "Show More" button.

A couple of minor things from profiling are also included:

* Reuse existing repo in `PrepareViewPullInfo` if head and base are the
same.

The performance impact is going to depend heavily on the individual diff
and the hardware it runs on, but when testing locally on a diff changing
100k+ lines over hundreds of files, I'm seeing a roughly 75% reduction
in time to load the result of "Show More"

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-11-02 11:29:37 +08:00
RedCocoon
933b4b4865 Add copyright information to reaction.go 2024-11-02 03:43:42 +08:00
RedCocoon
5a49efbd3e Update reaction.go to conform to lint revive 2024-11-02 03:21:39 +08:00
RedCocoon
98baaa2446 Consolidate reaction web/repo logic 2024-11-02 03:14:12 +08:00
RedCocoon
2084a7a5c4 Remove unneccessary api calls 2024-11-02 02:35:21 +08:00
RedCocoon
706b919d9f make fmt and add option to swagger 2024-11-01 03:19:58 +08:00
RedCocoon
b03448bc42 Revert variable name to adhere to codestyle 2024-11-01 02:56:21 +08:00
RedCocoon
b1af5cd6be Rename variables in conversation.go 2024-11-01 02:46:55 +08:00
RedCocoon
60b750ece4 Remove duplicate functions 2024-11-01 02:11:43 +08:00
Zettat123
0690cb076b
Fix missing signature key error when pulling Docker images with SERVE_DIRECT enabled (#32365)
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 #28121

I did some tests and found that the `missing signature key` error is
caused by an incorrect `Content-Type` header. Gitea correctly sets the
`Content-Type` header when serving files.

348d1d0f32/routers/api/packages/container/container.go (L712-L717)
However, when `SERVE_DIRECT` is enabled, the `Content-Type` header may
be set to an incorrect value by the storage service. To fix this issue,
we can use query parameters to override response header values.

https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html
<img width="600px"
src="https://github.com/user-attachments/assets/f2ff90f0-f1df-46f9-9680-b8120222c555"
/>

In this PR, I introduced a new parameter to the `URL` method to support
additional parameters.

```
URL(path, name string, reqParams url.Values) (*url.URL, error)
```

---

Most S3-like services support specifying the content type when storing
objects. However, Gitea always use `application/octet-stream`.
Therefore, I believe we also need to improve the `Save` method to
support storing objects with the correct content type.

b7fb20e73e/modules/storage/minio.go (L214-L221)
2024-10-31 15:28:25 +00:00
RedCocoon
ab083c8525 Remove unused struct, fix duplicate table name 2024-10-31 21:46:00 +08:00
wxiaoguang
a4a121c684
Fix suggestions for issues (#32380)
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
2024-10-30 20:06:36 +00:00
Oleksandr Redko
f4d3aaeeb9
refactor: remove redundant err declarations (#32381) 2024-10-30 19:36:24 +00:00
RedCocoon
5ba8ae10fc Remove unnecessary data from Conversation 2024-10-30 23:49:24 +08:00
RedCocoon
abc5d12590
Merge branch 'main' into main 2024-10-30 23:21:47 +08:00
RedCocoon
c039238f07 Merge branch 'main' of https://github.com/RedCocoon/gitea 2024-10-30 20:37:28 +08:00
RedCocoon
95c57a1677 Clean up code based on lint 2024-10-30 20:37:04 +08:00
6543
58eb16eda7
Respect UI.ExploreDefaultSort setting again (#32357)
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 regression of https://github.com/go-gitea/gitea/pull/29430

---
*Sponsored by Kithara Software GmbH*
2024-10-30 12:33:25 +00:00
RedCocoon
7b263cd638
Merge branch 'go-gitea:main' into main 2024-10-30 01:26:14 +08:00
RedCocoon
692f0aacaa Reimplement edit comment for conversations 2024-10-29 21:34:24 +08:00
RedCocoon
17fb682c18 Reimplement quote reply and translation text 2024-10-29 20:03:40 +08:00
Anbraten
b7fb20e73e
Suggestions for issues (#32327)
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
closes #16872
2024-10-29 17:20:49 +08:00
RedCocoon
bb943791fb Reimplement reactions and delete, fixed conversation styling css 2024-10-29 16:48:18 +08:00
RedCocoon
637788bc2f Reimplement delete comment for conversations 2024-10-28 16:33:51 +08:00
wxiaoguang
d70af38447
Refactor the DB migration system slightly (#32344)
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
Introduce "idNumber" for each migration, and clarify the difference
between the migration ID number and database version.
2024-10-27 19:54:35 +08:00
RedCocoon
c55ca5df79 Allow creation of commit comments 2024-10-25 22:05:56 +08:00
RedCocoon
c511070fa8 Add backend functionalities to create and display conversations 2024-10-25 01:35:19 +08:00
Lunny Xiao
2abdbe88b5
Fix disable 2fa bug (#32320)
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
2024-10-23 06:41:00 +00:00
Tim
de2ad2e1b1
Make admins adhere to branch protection rules (#32248)
This introduces a new flag `BlockAdminMergeOverride` on the branch
protection rules that prevents admins/repo owners from bypassing branch
protection rules and merging without approvals or failing status checks.

Fixes #17131

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-10-23 12:39:43 +08:00
Zettat123
9206fbb55f
Add DISABLE_ORGANIZATIONS_PAGE and DISABLE_CODE_PAGE settings for explore pages and fix an issue related to user search (#32288)
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
These settings can allow users to only display the repositories explore page.

Thanks to yp05327 and wxiaoguang !

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-10-22 13:09:19 +08:00
RedCocoon
6051ff8525 Decouple conversations from issues 2024-10-21 00:38:17 +08:00
6543
d638067d3c
API: enhance SearchIssues swagger docs (#32208)
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-licenses / cron-licenses (push) Has been cancelled
this will result in better api clients generated out of the openapi docs
... for SearchIssues

---
*Sponsored by Kithara Software GmbH*
2024-10-19 20:11:56 +00:00
wxiaoguang
5242e520c4
Make owner/repo/pulls handlers use "PR reader" permission (#32254)
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 #32253 (partially)
2024-10-15 06:47:07 +00:00
wxiaoguang
afa8dd45af
Make git push options accept short name (#32245)
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
Just like what most CLI parsers do: `--opt` means `opt=true`

Then users could use `-o force-push` as `-o force-push=true`
2024-10-12 05:42:10 +00:00
Zettat123
0fe5e2b08c
Allow maintainers to view and edit files of private repos when "Allow maintainers to edit" is enabled (#32215)
Fix #31539
2024-10-11 19:08:19 +00:00
Lunny Xiao
aebb741c08
Use per package global lock for container uploads instead of memory lock (#31860)
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
This PR uses a per-package lock instead of a global lock for container
uploads. So that different packages can be uploaded simultaneously.
2024-10-11 07:37:49 +00:00
Lunny Xiao
c2217670dd
Move admin routers from /admin to /-/admin (#32189)
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
Resolve #32181

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-10-10 04:56:49 +00:00
wxiaoguang
dd83cfcacc
Refactor CSRF token (#32216) 2024-10-10 03:48:21 +00:00
Zettat123
4eacc61f64
Fix incorrect "Target branch does not exist" in PR title (#32222) 2024-10-10 08:25:46 +08:00
Lunny Xiao
d6d3c96e65
Fix bug when a token is given public only (#32204)
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
2024-10-08 12:51:09 +03:00
6543
bdd655f2bd
Allow filtering PRs by poster in the ListPullRequests API (#32209)
as title

---
*Sponsored by Kithara Software GmbH*
2024-10-07 23:21:07 +02:00