1373 Commits

Author SHA1 Message Date
RedCocoon
f65f92c1df Merge remote-tracking branch 'upstream/main' 2024-11-07 16:25:26 +08:00
Lunny Xiao
276500c314
Move AddCollabrator and CreateRepositoryByExample to service layer (#32419)
- [x] Move `CreateRepositoryByExample` to service layer
- [x] Move `AddCollabrator` to service layer
- [x] Add a new parameter for `AddCollabrator` so that changing mode
immediately after that will become unnecessary.
2024-11-07 11:28:11 +08:00
RedCocoon
0e10d6d7a4 Fix pull_review.go referring to the wrong template 2024-11-06 03:32:11 +08:00
RedCocoon
c1735ac2dc Merge remote-tracking branch 'upstream/main' 2024-11-06 03:01:09 +08:00
RedCocoon
5ea9292ce0 Update issue header comment to use new time formatter 2024-11-06 02:48:45 +08:00
Lunny Xiao
24b83ff63e
Fix milestone deadline and date related problems (#32339)
Use zero instead of 9999-12-31 for deadline
Fix #32291

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-11-05 07:46:40 +00:00
wxiaoguang
61c35590c7
Refactor RepoRefByType (#32413)
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
1. clarify the "filepath" could(should) contain "{ref}"
2. remove unclear RepoRefLegacy and RepoRefAny, use RepoRefUnknown to guess
3. by the way, avoid using AppURL
2024-11-05 06:35:54 +00:00
wxiaoguang
4a469c8e1b
Refactor template ctx and render utils (#32422)
Clean up the templates
2024-11-05 14:04:26 +08:00
RedCocoon
c7c1010077 Reapply "Merge remote-tracking branch 'upstream/main'"
This reverts commit a3e5eaf91727b68d8711cb4b32835450a47d8d65.
2024-11-05 01:38:44 +08:00
RedCocoon
a3e5eaf917 Revert "Merge remote-tracking branch 'upstream/main'"
This reverts commit 2585c8b66a454252b0cf265d62f76c33839f6f2c, reversing
changes made to 8e012ebbb22b0468d746e31ad33463a71f0ef595.
2024-11-04 23:38:45 +08:00
RedCocoon
2585c8b66a Merge remote-tracking branch 'upstream/main' 2024-11-04 21:39:49 +08:00
wxiaoguang
b068dbd40e
Refactor DateUtils and merge TimeSince (#32409)
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
Follow #32383 and #32402
2024-11-04 11:30:00 +00:00
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
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
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
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