Commit Graph

19157 Commits (216243eee299a973e4504fc210e07c168376934e)

Author SHA1 Message Date
wxiaoguang 216243eee2
Refactor error system (#33771)
It should not expose `util.SilentWrap` or construct it manually.
2025-03-03 05:36:10 +00:00
Lunny Xiao dbed39d632
Add migrations and doctor fixes (#33556)
Fix #33535
2025-03-02 21:01:28 -08:00
wxiaoguang 02657e85a4
Refactor mail code (#33768)
`mail.go` contains various different functions, it's time to split it.
2025-03-03 03:31:47 +00:00
wxiaoguang 27bf63ad20
Refactor global init code and add more comments (#33755)
Follow up #33748

Now there are 3 "global" functions:

* registerGlobalSelectorFunc: for all elements matching the selector, eg: `.ui.dropdown`
* registerGlobalInitFunc: for `data-global-init="initInputAutoFocusEnd"`
* registerGlobalEventFunc: for `data-global-click="onCommentReactionButtonClick"`


And introduce `initGlobalInput` to replace old `initAutoFocusEnd` and
`attachDirAuto`, use `data-global-init` to replace fragile
`.js-autofocus-end` selector.

Another benefit is that by the new approach, no matter how many times
`registerGlobalInitFunc` is called, we only need to do one
"querySelectorAll" in the last step, it could slightly improve the
performance.
2025-03-03 10:57:28 +08:00
Lunny Xiao 5cbdf83f70
Use pullrequestlist instead of []*pullrequest (#33765)
Just renames no code changed.
2025-03-02 10:14:49 -08:00
Lunny Xiao 2c8bdd2233
Upgrade act to 0.261.4 and actions-proto-go to v0.4.1 (#33760)
Include https://gitea.com/gitea/act/pulls/129 Fix #33657 
And https://gitea.com/gitea/actions-proto-def/pulls/14
2025-03-01 20:02:58 +00:00
ChristopherHX b684f51d20
Webhook add X-Gitea-Hook-Installation-Target-Type Header (#33752)
This is a X-GitHub Header port

* repository for repository webhooks (matches GitHub)
* organization for organization webhooks (matches GitHub)
* user for user webhooks (Gitea specific)
* system for system webhooks  (Gitea specific)
* default for default hooks needs testing (Gitea specific)

- `X-Gitea-Hook-Installation-Target-Type`
- `X-GitHub-Hook-Installation-Target-Type`
2025-03-01 06:50:49 +00:00
wxiaoguang 698ae7aa5b
Fix dynamic content loading init problem (#33748)
1. Rewrite `dirauto.ts` to `observer.ts`. 
* We have been using MutationObserver for long time, it's proven that it
is quite performant.
    * Now we extend its ability to handle more "init" works.
2. Use `observeAddedElement` to init all non-custom "dropdown".
3. Use `data-global-click` to handle click events from dynamically
loaded elements.
* By this new approach, the old fragile selector-based
(`.comment-reaction-button`) mechanism is removed.
4. By the way, remove unused `.diff-box` selector, it was abused and
never really used.

A lot of FIXMEs in "repo-diff.ts" are completely fixed, newly loaded
contents could work as expected.
2025-03-01 02:02:10 +00:00
GiteaBot f3ada61097 [skip ci] Updated translations via Crowdin 2025-03-01 00:36:23 +00:00
Lunny Xiao aca21549f2
Add composor source field (#33502)
Fix #33066
2025-02-28 16:29:21 +00:00
Lunny Xiao ae4a3d7708
upgrade go-crypto from 1.1.5 to 1.1.6 (#33745)
Fix #33296

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-28 14:06:47 +00:00
silverwind 6e475dc7e0
Disable go license generation as part of `make tidy` (#33747)
It seems something broken `google/go-licenses` (maybe related to go
1.24), and my findings are in
https://github.com/google/go-licenses/issues/128#issuecomment-2689753365.
I think it's best we disable this generation for now until a better
solution is found.

Also, enable showing stderr output so we can actually debug this thing.
For reference, these are the errors that currently apparently break the
tool:

```
E0228 05:15:27.005759   13158 library.go:117] Package text/tabwriter does not have module info. Non go modules projects are no longer supported. For feedback, refer to https://github.com/google/go-licenses/issues/128.
E0228 05:15:27.005776   13158 library.go:117] Package net/http/fcgi does not have module info. Non go modules projects are no longer supported. For feedback, refer to https://github.com/google/go-licenses/issues/128.
F0228 05:15:27.028122   13158 main.go:77] some errors occurred when loading direct and transitive dependency packages
```
2025-02-28 11:26:27 +00:00
wxiaoguang 4e56d5f39f
Refactor repo-diff.ts (#33746)
Remove jQuery
2025-02-28 16:37:16 +08:00
Alexander McRae aba96f65cd
Use `git diff-tree` for `DiffFileTree` on diff pages (#33514)
Modify Diff View FileTree to show all files

## Changes

* removes Show Status button on diff
* uses `git diff-tree` to generate the file tree for the diff
* doesn't reload the diff tree each time we load more files in the
preview
* selecting and unloaded file will keep loading until that file is
loaded
* removes `DiffFileList.vue` and "Show Stats" in diff options

## Open Questions

* selecting and unloaded file will keep loading until that file is
loaded. Is this behaviour okay? It matches what github does.

### Demo

In this demo I set `git.MAX_GIT_DIFF_FILES=1` in my `app.ini` to
demonstrate a worst case example. In most cases the behaviour isn't
nearly as jarring as we load a bunch of files at a time.


https://github.com/user-attachments/assets/72f29663-d6fc-472d-94fa-7fb5950c2836

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-28 00:58:25 +00:00
GiteaBot 7a8eed13b9 [skip ci] Updated translations via Crowdin 2025-02-28 00:32:56 +00:00
Guillaume 303af554c9
Improve "generate new access token" form (#33730)
Fix: https://github.com/go-gitea/gitea/issues/33519

As discussed in [PR
#33614](https://github.com/go-gitea/gitea/pull/33614), the
ScopedAccessTokenSelector Vue component is not particularly useful.

This PR removes the component and reverts to using HTML templates. It
also introduces some (hopefully) useful refactoring.

The Vue component was causing the UX bug reported in the linked issue.
Required form fields are now properly working, as expected (see
screenshot).

![Screenshot from 2025-02-25
22-00-28](https://github.com/user-attachments/assets/41167854-0718-48b0-a3ee-75ca3a7b8b20)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-27 19:40:12 +00:00
silverwind 8362a41559
Remove superflous tw-content-center (#33741) 2025-02-27 19:05:28 +00:00
Quentin f52e31f5ce
Clone repository with Tea CLI (#33725)
This PR adds "Tea CLI" as a clone method.

<img width="350" alt="Capture d’écran 2025-02-25 à 23 38 47"
src="https://github.com/user-attachments/assets/8e86e54a-998b-45d1-9f20-167b449e79b6"
/>

---------

Signed-off-by: Quentin Guidée <quentin.guidee@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-27 18:18:02 +00:00
Royce Remer b7aac5ef9a
allow filtering /repos/{owner}/{repo}/pulls by target base branch queryparam (#33684)
Co-authored-by: Royce Remer <rremer@salesforce.com>
Co-authored-by: delvh <dev.lh@web.de>
2025-02-27 17:50:44 +00:00
wxiaoguang 01156f9cc4
Show info about maintainers are allowed to edit a PR (#33738)
A simple and clear approach. The existing test
TestPullCompare_EnableAllowEditsFromMaintainer should be good enough.

Fix #21280



![image](https://github.com/user-attachments/assets/b685950b-4095-45ad-b913-425f840f2876)
2025-02-27 16:47:00 +00:00
wxiaoguang 8db8a3b0d1
Improve admin user view page (#33735)
1. show more user types
2. show prohibited state
2025-02-27 17:47:37 +08:00
GiteaBot 0e477b590d [skip ci] Updated translations via Crowdin 2025-02-27 00:32:24 +00:00
Quentin 793c0e1fa6
Align sidebar gears to the right (#33721)
Currently, the issue/pr sidebar is hard to read visually. One of the
reason is that the gear icons make reading difficult because they are
"in the way" when reading, and not aligned together.

This PR proposes to align them on the right.

Actions are also better highlighted this way.

## Screenshots

### Issue

| Before this PR | After this PR |
| --- | --- |
| <img width="322" alt="Capture d’écran 2025-02-25 à 19 59 39"
src="https://github.com/user-attachments/assets/efdd13af-7b22-4f2b-8e65-dd17d6f3ffad"
/> | <img width="322" alt="Capture d’écran 2025-02-25 à 19 58 56"
src="https://github.com/user-attachments/assets/eeacc3f4-5e2c-4558-a4b3-0f1ab4742107"
/> |

### Pull Request


| Before this PR | After this PR |
| --- | --- |
| <img width="322" alt="Capture d’écran 2025-02-25 à 20 16 12"
src="https://github.com/user-attachments/assets/c274b58b-ad50-4ad8-b3da-91dbabd1b120"
/> | <img width="322" alt="Capture d’écran 2025-02-25 à 20 15 54"
src="https://github.com/user-attachments/assets/ecfd6d60-a525-4767-872d-2ef84030d81e"
/> |

Signed-off-by: Quentin Guidée <quentin.guidee@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2025-02-27 00:03:23 +02:00
GiteaBot 6c5951dabd [skip ci] Updated translations via Crowdin 2025-02-26 00:32:38 +00:00
Lunny Xiao 74c8e95e87
Fix inconsistent closed issue list icon (#33722)
Fixe #33718 

Before 

![image](https://github.com/user-attachments/assets/2c77e249-a118-4471-8c63-ead4fe0f6336)

After 

![image](https://github.com/user-attachments/assets/c082eba8-5b21-4814-b091-c725ca46ccf3)
2025-02-25 15:27:23 -08:00
silverwind 2aa59ba9e5
Update files-changed and labeler globs (#33720)
Few tweaks, should be self-explanatory.
2025-02-25 11:33:23 -08:00
silverwind b35a9da14c
Enable `@typescript-eslint/no-use-before-define` (#33715)
The [rule](https://typescript-eslint.io/rules/no-use-before-define/) is
a superset of the eslint base rule, and I tested it with
https://github.com/go-gitea/gitea/pull/33514#discussion_r1969795271
where it does not raise an error for cyclic types.
2025-02-25 16:30:31 +01:00
GiteaBot 38ccc8e3e4 [skip ci] Updated translations via Crowdin 2025-02-25 00:35:17 +00:00
techknowlogick 7535af20da
bump x/crypto & x/oauth2 (#33704) 2025-02-24 20:15:18 +00:00
Lunny Xiao 76b7f95a27
Optimize user dashboard loading (#33686)
Fix #33582
Fix #31698

When a user login, the dashboard should load all feed belongs to him
with no any conditions. The complicated conditions should be applied
only for another user view this user's profile.
2025-02-24 11:29:32 -08:00
Kerwin Bryant 2cd2ae07a7
Add No Results Prompt Message on Issue List Page (#33699) 2025-02-24 18:24:56 +00:00
wxiaoguang 555d64d024
Always show the "rerun" button for action jobs (#33692)
And improve the mock code.
2025-02-24 08:40:46 +00:00
Arif Er adf7018bfd
Fix OCI image.version annotation for releases to use full semver (#33698)
This commit fixes the docker build workflow such that semver-tagged
releases use the full semver for the OCI
`org.opencontainers.image.version` annotation, instead of using the
major version only.

This is done by changing the order of the tags that the
`docker/metadata-action` action is told to generate. Since the tags that
the action is told to generate are all of the same priority, the first
in the list will be used to set the annotation.

There is no need to fix the other two docker build workflows, i.e., (i)
the nightly releases and (ii) the rc-tagged releases. This is because
(i) the nightly releases do not get tagged with a semver, so the issue
does not exist, and (ii) rc-tagged releases only get built with one tag,
so the issue of needing to set an order of how tags are generated is
irrelevant.

Resolves go-gitea/gitea#33697.
2025-02-24 01:37:37 -05:00
wxiaoguang 56a0a9c750
Fix git empty check and HEAD request (#33690) 2025-02-24 02:11:29 +00:00
wxiaoguang 8ae46d9684
Fix some user name usages (#33689)
1. GetUserOrgsList should "order by" lower_name
2. GetIssuePostersWithSearch should search in-case-sensitive-ly
3. LoginName should not be used as username

By the way, remove unnecessary "onGiteaRun"
2025-02-23 12:33:43 +00:00
wxiaoguang f991807f7e
Try to fix ACME path when renew (#33668)
Try to fix #32191
2025-02-23 13:12:08 +08:00
GiteaBot 9e75c54559 [skip ci] Updated translations via Crowdin 2025-02-23 00:34:45 +00:00
wxiaoguang ead716d204
Improve Open-with URL encoding (#33666)
Fix #33665
2025-02-21 17:46:05 +00:00
Diana a61014ea47
Fix for Maven Package Naming Convention Handling (#33678)
Make legacy package names could be listed and add tests

---------

Co-authored-by: diana.strebkova@t-systems.com <diana.strebkova@t-systems.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-22 01:38:49 +08:00
wxiaoguang 4adb7cad8b
Improve swagger generation (#33664)
Remove most "sed" tricks

---------

Co-authored-by: silverwind <me@silverwind.io>
2025-02-21 00:04:30 -08:00
Lunny Xiao f2fbb897f3
Deleting repository should unlink all related packages (#33653)
Fix #33634

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-21 04:17:56 +00:00
Lunny Xiao a25081f380
Fix omitempty bug (#33663)
Fix #33660
2025-02-20 12:39:21 -08:00
wxiaoguang 3ee5ee2029
Upgrade golangci-lint to v1.64.5 (#33654)
Use `usetesting` instead of deprecated `tenv`.
1. Follow up #33648
2. Make lint pass and add some comments
2025-02-21 00:05:40 +08:00
wxiaoguang cd225d7034
Fix mCaptcha bug (#33659)
Fix #33658
2025-02-20 22:53:38 +08:00
wxiaoguang e6759f356d
Update Go dependencies (skip blevesearch, meilisearch) (#33655) 2025-02-20 22:10:54 +08:00
TheFox0x7 cc1fdc84ca
Use test context in tests and new loop system in benchmarks (#33648)
Replace all contexts in tests with go1.24 t.Context()

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-20 09:57:40 +00:00
Lunny Xiao 3bbc482879
Add missed changelogs (#33649)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-20 17:31:07 +08:00
GiteaBot 21af8150b7 [skip ci] Updated translations via Crowdin 2025-02-20 00:32:10 +00:00
ericLemanissier 40faa6dc78
git graph: don't show detached commits (#33645)
Current git graph is not usable for mirrors of repos having a lot of
PRs, as can be seen at
https://demo.gitea.com/ericLemanissier/conan-center-index/graph

![image](https://github.com/user-attachments/assets/ace40dd2-3eea-4d69-8e19-10fb7224e326)


Manually running `git log --graph --date-order --all` on such a repo
indeed shows:
```
*   commit c4a34bd39d7977c8630177c5f88507000ea3e943
|\  Merge: a4bbd3ad6b 35a102c77c
| | Author: toge <toge.mail@gmail.com>
| | Date:   Wed Feb 19 08:36:41 2025 +0000
| |
| |     Merge 35a102c77cbc38d84baca0ca63466fb410336ea8 into a4bbd3ad6bb5a0f8e5117a897d8c55941f533d98
| |
| * commit 35a102c77cbc38d84baca0ca63466fb410336ea8
| | Author: toge <toge.mail@gmail.com>
| | Date:   Wed Feb 19 17:36:35 2025 +0900
| |
| |     update 4.4.2
| |
| | * commit 5d610f4fd3c0428731e402a2f618fad9ce055875
| |/| Merge: a4bbd3ad6b fe916fb70a
|/| | Author: Antony Peacock <ant.peacock@gmail.com>
| | | Date:   Wed Feb 19 08:31:30 2025 +0000
| | |
| | |     Merge fe916fb70a8bf49503cce70a5c7124bcc4314ddc into a4bbd3ad6bb5a0f8e5117a897d8c55941f533d98
| | |
| | * commit fe916fb70a8bf49503cce70a5c7124bcc4314ddc
| | | Author: Antony Peacock <ant.peacock@gmail.com>
| | | Date:   Wed Feb 19 08:31:18 2025 +0000
| | |
| | |     Remove parquet cmakelist patch
| | |
| | | * commit 9f6d2759d650ec3c86d01bb940e829e7e14220c2
| |_|/| Merge: a4bbd3ad6b f0963429b0
|/| | | Author: Thomas Sedlmair <thomas.sedlmair@googlemail.com>
| | | | Date:   Wed Feb 19 08:03:08 2025 +0100
| | | |
| | | |     Merge f0963429b0952499da0da7e559f8d53387097307 into a4bbd3ad6bb5a0f8e5117a897d8c55941f533d98
| | | |
| | | * commit f0963429b0952499da0da7e559f8d53387097307
| |_|/  Author: Thomas Sedlmair <thomas.sedlmair@googlemail.com>
|/| |   Date:   Wed Feb 19 08:01:43 2025 +0100
| | |
| | |       added cwt-cucumber 2.5
| | |
```

On the other hand, running `git log --graph --date-order --branches
--tags` returns the expected:
```
* commit a4bbd3ad6bb5a0f8e5117a897d8c55941f533d98 (HEAD -> master)
| Author: Dan <mstr.danila@gmail.com>
| Date:   Fri Feb 14 18:46:11 2025 +0200
|
|     grpc: add version 1.69.0 (#26446)
|
|     * grpc: add version 1.69.0
|
|     * add cmake tool requires
|
|     ---------
|
|     Co-authored-by: Luis Caro Campos <3535649+jcar87@users.noreply.github.com>
|
* commit a7868807cb2e21206ebf95278cb588f29a3e2205
| Author: Guillaume Egles <gegles@users.noreply.github.com>
| Date:   Thu Feb 13 05:44:35 2025 -0800
|
|     openssl: add versions `3.0.16`, `3.1.8`, `3.2.4`, `3.3.3`, `3.4.1`, stop publishing revisions for version `3.0.15` (#26578)
|
* commit 86057d3e63ac71e2fe48c07bb301f2d54187044d
| Author: Luis Caro Campos <3535649+jcar87@users.noreply.github.com>
| Date:   Thu Feb 13 13:34:41 2025 +0000
|
|     android-ndk: dont set LD and AS variables (#26581)
|
|     * android-ndk: dont set LD and AS variables
|
|     * android-ndk: refactor test package
|
* commit 123e382fafd2f5e811e10faac02efc275c45ec2a
| Author: Nikita <root.kidik@gmail.com>
| Date:   Thu Feb 13 12:29:39 2025 +0300
|
|     libffi: fix conditionals when building on Windows (#26500)
|
|     * fix: add missing or `clang`
|
|     * fix: libffi - always require as tool `automake`
```
2025-02-19 10:35:08 -08:00
wxiaoguang c2e23d3301
Fix PR web route permission check (#33636)
See the FIXME comment in code. Otherwise, if a repo's issue unit is
disabled, then the PRs can't be edited anymore.

By the way, make the permission log output look slightly better.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: metiftikci <metiftikci@hotmail.com>
2025-02-19 00:55:19 +00:00