18609 Commits

Author SHA1 Message Date
RedCocoon
19ba51f5e5 Change comment type 22 to refer to the correct template 2024-11-05 00:49:36 +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
RedCocoon
8e012ebbb2 add comments for testing conversation search 2024-11-04 20:37:52 +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
wxiaoguang
61be51e56b
Refactor markup package (#32399)
To make the markup package easier to maintain:
1. Split some go files into small files
2. Use a shared util.NopCloser, remove duplicate code
3. Remove unused functions
2024-11-04 10:59:50 +00:00
wxiaoguang
af28ce59b8
Add some handy markdown editor features (#32400)
There were some missing features from EasyMDE:

1. H1 - H3 style
2. Auto add task list
3. Insert a table

And added some tests
2024-11-04 10:14:36 +00:00
RedCocoon
0d65d7140b Load issue attributes instead of only loading pullrequest details 2024-11-04 17:47:26 +08:00
RedCocoon
6f9647b2b9 Remove invalid options from conversation_stat.go 2024-11-04 17:13:02 +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
Royce Remer
54146e62c0
Make LFS http_client parallel within a batch. (#32369)
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-off-by: Royce Remer <royceremer@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-11-04 04:49:08 +00: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
ed576c23fb Fix lint backend compliance issues 2024-11-04 00:50:34 +08:00
RedCocoon
8b68cc8f72 Fix warning lines and remove unused variables 2024-11-04 00:34:32 +08:00
RedCocoon
56fca5e557 Fix LoadPosters remove from conversation comment list 2024-11-04 00:28:28 +08:00
RedCocoon
2ba22a8a13 Merge remote-tracking branch 'upstream/main' 2024-11-04 00:24:17 +08:00
RedCocoon
3327b83b07 Merge branch 'main' of https://github.com/RedCocoon/gitea 2024-11-04 00:22:19 +08:00
RedCocoon
b1f07f2df0 Add unit test for comments 2024-11-04 00:22:11 +08:00
RedCocoon
5d7dcdf625 Add unit test for comments 2024-11-04 00:15:59 +08:00
RedCocoon
e344e371df Add unit test for conversations 2024-11-03 22:29:30 +08:00
wxiaoguang
f2a6df03d9
Refactor repo legacy (#32404)
Some checks failed
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-licenses / cron-licenses (push) Has been cancelled
Only move code, no unnecessary logic change. (There are many problems in
old code, but changing them is not in this PR's scope)

Co-authored-by: Giteabot <teabot@gitea.io>
2024-11-03 11:00:12 +00:00
wxiaoguang
259811617b
Replace DateTime with proper functions (#32402)
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

This PR cleans up the "Deadline" usages in templates, make them call
`ParseLegacy` first to get a `Time` struct then display by `DateUtils`.

Now it should be pretty clear how "deadline string" works, it makes it
possible to do further refactoring and correcting.
2024-11-02 21:04:53 +00: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
Lunny Xiao
13a203828c
Fix created_unix for mirroring (#32342)
Fix #32233
2024-11-02 06:11:38 +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
940fa351d9 Change v1_json.tmpl 2024-11-02 02:44:04 +08:00
RedCocoon
2084a7a5c4 Remove unneccessary api calls 2024-11-02 02:35:21 +08:00
RedCocoon
6976590c90 Update v1_json.tmpl 2024-11-02 00:41:48 +08:00
wxiaoguang
ec2d1593c2
Refactor tests to prevent from unnecessary preparations (#32398)
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-01 23:18:29 +08:00
Kyle D.
66971e591e
Add artifacts test fixture (#30300)
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 https://github.com/go-gitea/gitea/issues/30296

- Adds a DB fixture for actions artifacts
- Adds artifacts test files
- Clears artifacts test files between each run
- Note: I initially initialized the artifacts only for artifacts tests,
but because the files are small it only takes ~8ms, so I changed it to
always run in test setup for simplicity
- Fix some otherwise flaky tests by making them not depend on previous
tests
2024-11-01 10:29:54 +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
8509c5c2aa Generate Swagger 2024-11-01 02:54:17 +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
silverwind
8107823026
Fix a number of typescript issues (#32308)
- Prefer
[window.location.assign](https://developer.mozilla.org/en-US/docs/Web/API/Location/assign)
over assigning to
[window.location](https://developer.mozilla.org/en-US/docs/Web/API/Window/location)
which typescript does not like. This works in all browsers including
PaleMoon.
- Fix all typescript issues in `web_src/js/webcomponents`, no behaviour
changes.
- ~~Workaround bug in `@typescript-eslint/no-unnecessary-type-assertion`
rule.~~
- Omit vendored file from type checks.
- `tsc` error count is reduce by 53 with these changes.
2024-10-31 14:57:40 +00:00
RedCocoon
ab083c8525 Remove unused struct, fix duplicate table name 2024-10-31 21:46:00 +08:00
wxiaoguang
5e6523aa57
Update go dependencies (#32389) 2024-10-31 12:05:54 +00:00
silverwind
9914c9ab08
Update JS and PY dependencies (#32388)
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
- Update all JS dependencies excluding stylelint (because of
https://github.com/AndyOGo/stylelint-declaration-strict-value/issues/379).
- Update all PY dependencies.
- Replace `eslint-plugin-deprecation` with
`@typescript-eslint/no-deprecated` rule.
- Enabled `unicorn/prefer-math-min-max` and autofixed issues.
- Tested all dependencies.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-10-31 04:19:15 +00: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
yp05327
dd1f67491f
Fix the missing menu in organization project view page (#32313)
#29248 didn't modify the view page.
The class name is not good enough, so this is a quick fix.

Before:
org:

![image](https://github.com/user-attachments/assets/3e26502d-66b4-4043-ab03-003ba7391487)
user:

![image](https://github.com/user-attachments/assets/9b22b90c-d63c-4228-acad-4d9fb20590ac)


After:
org:

![image](https://github.com/user-attachments/assets/21bf98a7-8a5b-4dc6-950a-88f529e36450)
user: (no change)

![image](https://github.com/user-attachments/assets/fea0dcae-3625-44e8-bb9e-4c3733da8764)

Co-authored-by: Giteabot <teabot@gitea.io>
2024-10-30 19:05:40 +00:00