aboutsummaryrefslogtreecommitdiffstats
path: root/modules
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix `GetCommitBranchStart` bug (#33298)Zettat1232025-01-282-5/+5
| | | | | | Fix #33265 Fix #33370 This PR also fixes some bugs in `TestGitGeneral`.
* Refactor context flash msg and global variables (#33375)wxiaoguang2025-01-258-487/+506
| | | | | | 1. add `GetSiteCookieFlashMessage` to help to parse flash message 2. clarify `handleRepoHomeFeed` logic 3. remove unnecessary global variables, use `sync.OnceValue` instead 4. add some tests for `IsUsableUsername` and `IsUsableRepoName`
* Refactor webhook events (#33337)Lunny Xiao2025-01-233-55/+57
| | | | | | | Extract from #33320 This PR uses a map instead of a struct to store webhook event information. It removes many duplicated functions and makes the logic clearer.
* Support disable passkey auth (#33348)yp053272025-01-221-0/+2
| | | | | | | Fix #33314 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Support performance trace (#32973)wxiaoguang2025-01-219-7/+506
| | | | | | | | | | | | | 1. Add a OpenTelemetry-like shim-layer to collect traces 2. Add a simple builtin trace collector and exporter, end users could download the diagnosis report to get the traces. This PR's design is quite lightweight, no hard-dependency, and it is easy to improve or remove. We can try it on gitea.com first to see whether it works well, and fine tune the details. --------- Co-authored-by: silverwind <me@silverwind.io>
* Fix typo in documentation of GetBranchNames() (#33330)Michael Vetter2025-01-191-1/+1
|
* Fix parentCommit invalid memory address or nil pointer dereference. (#33204)hiifong2025-01-191-2/+8
| | | | | | | | | When the parent Commit does not exist on gitea, an error will be reported when opening the Commit details page: invalid memory address or nil pointer dereference. ![image](https://github.com/user-attachments/assets/4c2a9802-935f-41e9-b5b9-a4f0d745f709) ![image](https://github.com/user-attachments/assets/7b0bc15e-7f5f-4d58-8d24-fee667a799fa)
* Make tracked time representation display as hours (#33315)Vladimir Sysoev2025-01-193-65/+17
| | | | | | | | | | Estimated time represented in hours it might be convenient to have tracked time represented in the same way to be compared and managed. --------- Co-authored-by: Sysoev, Vladimir <i@vsysoev.ru> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Trivial fixes (#33304)wxiaoguang2025-01-171-4/+0
| | | | | | | 1. the error check was added for go-git, it was caused by the empty `.keep` file in the test fixtures. 2. use `PostFormValue` instead of `PostForm.Get` (`Get` needs to parse the form ahead) 3. fix incorrect container text (it should show "Images" in the header but not "OS/Arch") 4. align maven xml 5. fix closed PR color&icon
* Prepare for support performance trace (#33286)wxiaoguang2025-01-152-11/+13
| | | For #32973
* Refactor RefName (#33234)wxiaoguang2025-01-133-29/+38
| | | And fix some FIXMEs
* Refactor context RefName and RepoAssignment (#33226)wxiaoguang2025-01-133-19/+53
| | | | | | | The `ctx.Repo.RefName` was used to be a "short name", it causes a lot of ambiguity. This PR does some refactoring and use `RefFullName` to replace the legacy `RefName`, and simplify RepoAssignment
* Fix mirror bug (#33224)Lunny Xiao2025-01-121-0/+2
| | | | | Fix #33200 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor context repository (#33202)wxiaoguang2025-01-122-3/+3
|
* fix(cache): cache test triggered by non memory cache (#33220)TheFox0x72025-01-122-3/+9
| | | | | | | Change SlowCacheThreshold to 30 milliseconds so it doesn't trigger on non memory cache Closes: https://github.com/go-gitea/gitea/issues/33190 Closes: https://github.com/go-gitea/gitea/issues/32657
* Fix sync fork for consistency (#33147)Chai-Shi2025-01-101-0/+8
| | | | | | | | | Fixes #33145 An integration test could be added. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix pam auth test regression (#33169)TheFox0x72025-01-091-1/+1
| | | fixes: https://github.com/go-gitea/gitea/issues/33168
* Refactor older tests to use testify (#33140)TheFox0x72025-01-0923-197/+117
| | | | | Refactor checks to use assert/require Use require.Eventually for waiting in elastic and meilisearch tests Use require to exit early instead of assert
* Refactor HTMLFormat, update chroma render, fix js error (#33136)wxiaoguang2025-01-087-10/+25
| | | | | | A small refactor to improve HTMLFormat, to help to prevent low-level mistakes. And fix #33141, fix #33139
* add submodule diff links (#33097)Rowan Bohde2025-01-089-130/+259
| | | | | | | | | | | | This adds links to submodules in diffs, similar to the existing link when viewing a repo at a specific commit. It does this by expanding diff parsing to recognize changes to submodules, and find the specific refs that are added, deleted or changed. Related #25888 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Update status check for all supported on.pull_request.types in Gitea (#33117)yp053272025-01-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | Thanks @Zettat123 Follow #33116 Fix #33051 on.pull_request.types doc: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request on.pull_request.types added in this PR: ``` assigned, unassigned, review_requested, review_request_removed, milestoned, demilestoned, labeled, unlabeled ``` unsupported types in Gitea: ``` // Unsupported activity types: // converted_to_draft, ready_for_review, locked, unlocked, auto_merge_enabled, auto_merge_disabled, enqueued, dequeued ``` TODO: - [x] add test
* Support the new exit code for `git remote` subcommands for git version ↵yp053272025-01-071-0/+9
| | | | | | | | | >=2.30.0 (#33129) Fix #32889 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Make git clone URL could use current signed-in user (#33091)wxiaoguang2025-01-075-7/+17
| | | | | | | | | | | | | | close #33086 * Add a special value for "SSH_USER" setting: `(DOER_USERNAME)` * Improve parseRepositoryURL and add tests (now it doesn't have hard dependency on some setting values) Many changes are just adding "ctx" and "doer" argument to functions. By the way, improve app.example.ini, remove all `%(key)s` syntax, it only makes messy and no user really cares about it. Document: https://gitea.com/gitea/docs/pulls/138
* Refactor package (routes and error handling, npm peer dependency) (#33111)wxiaoguang2025-01-063-1/+16
|
* Trivial fixes (#33103)wxiaoguang2025-01-041-11/+22
| | | | 1. remove `gock` dependency, it is not needed 2. fix a regression from org private profile readme
* Make Gitea always use its internal config, ignore `/etc/gitconfig` (#33076)wxiaoguang2025-01-023-8/+12
| | | | | | | | | | | | | | | | | | | In history, Gitea could use the system config `/etc/gitconfig` because some users said that "they might put certNonceSeed in it" Actually, we shouldn't not use it, because it also causes conflicts (there are already some fixes like #28848) To make the system clear, I think it's worth to introduce the breaking change: add `GIT_CONFIG_NOSYSTEM=1` to all git commands. ## :warning: BREAKING :warning: For most users, nothing need to do. If you have made changes to `/etc/gitconfig` to affect Gitea's behavior, you need to move these config options to Gitea's internal git config file, it is usually in Gitea's `{AppDataPath}/home/.git` directory.
* Fix "stop time tracking button" on navbar (#33084)wxiaoguang2025-01-031-1/+1
| | | | | | | | Fix #33083 By the way (something I was working on): 1. relax color/background-color for more markup elements 2. fix a command line sentence error
* Fix bleve fuzziness search (#33078)wxiaoguang2025-01-035-8/+18
| | | Close #31565
* Refactor env var related code (#33075)wxiaoguang2025-01-021-2/+16
| | | And add more comments
* unset XDG_HOME_CONFIG as gitea manages configuration locations (#33067)JonRB2025-01-021-0/+5
| | | | | | | | unset XDG_CONFIG_HOME early to enable gitea to manage git configuration. simple error checking to satisfy the linting. Closes #33039 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Remove some unnecessary template helpers (#33069)wxiaoguang2025-01-012-8/+3
| | | | DisableGitHooks and DisableImportLocal are only used when editing a user, so only set them in `editUserCommon`
* Inherit submodules from template repository content (#16237)Steffen Schröter2025-01-0115-71/+221
| | | | | | | | Fix #10316 --------- Signed-off-by: Steffen Schröter <steffen@vexar.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix unittest and repo create bug (#33061)wxiaoguang2024-12-314-61/+50
| | | | | | | 1. `StatDir` was not right, fix the FIXME 2. Clarify the test cases for `IsUsableRepoName` 3. Fix regression bug in `repo-new.ts` Fix #33060
* Refactor maven package registry (#33049)wxiaoguang2024-12-311-0/+5
| | | Close #33036
* [Feature] Private README.md for organization (#32872)Chai-Shi2024-12-315-29/+132
| | | | | | | | Implemented #29503 --------- Co-authored-by: Ben Chang <ben_chang@htc.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix settings not being loaded at CLI (#26402)cassio zareck2024-12-305-13/+1
| | | | | | | | | | Closes #25898 The problem was that the default settings weren't being loaded --------- Signed-off-by: cassiozareck <cassiomilczareck@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor fixture loading for testing (#33024)wxiaoguang2024-12-301-5/+1
| | | To help binary size and testing performance
* Use gitrepo.GetTreePathLatestCommit to get file lastest commit instead from ↵Lunny Xiao2024-12-302-0/+26
| | | | | | | | | | | | latest commit cache (#32987) The latest commit cache is currently used only for listing tree files. However, a cold start may take longer than directly invoking the Git command. This PR addresses the issue of slow response times when accessing raw files, improving performance in such scenarios. ```log gitea.log:105521:2024/12/23 08:22:18 ...eb/routing/logger.go:68:func1() [W] router: slow GET /xxxx/xxxxxx/raw/commit/xxxxxxxxxxxxxxxxxxxxxxxxxxx/.editorconfig for 172.18.0.5:53252, elapsed 3526.8ms @ repo/download.go:117(repo.SingleDownload) ```
* Refactor arch route handlers (#32993)wxiaoguang2024-12-284-155/+256
|
* Add `show more` organizations icon in user's profile (#32986)yp053272024-12-271-0/+3
| | | | | | | | | | | | | | | | | | | Close #32952 # ⚠️ Doc update is required ![image](https://github.com/user-attachments/assets/296c5109-8fc1-43ea-b7dc-e79919cc1f9a) ![image](https://github.com/user-attachments/assets/d30980f6-22e4-4b97-9143-c750dc399da6) ------ ⚠️This PR refuses to be cherry-picked by any forked projects without any mentions. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Improve "ellipsis string" (#32989)wxiaoguang2024-12-262-8/+60
|
* Refactor "string truncate" (#32984)wxiaoguang2024-12-269-108/+169
|
* Do not render truncated links in markdown (#32980)wxiaoguang2024-12-265-17/+40
| | | Fixes #31780
* Fix Azure blob object `Seek` (#32974)Zettat1232024-12-252-1/+46
| | | | | | | | | This bug was found in a [test](https://github.com/go-gitea/gitea/actions/runs/12464294025/job/34788152194?pr=32883#step:9:105) of #32883 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix maven pom inheritance (#32943)wxiaoguang2024-12-252-9/+61
| | | Fix #30568
* Refactor arch route handlers (#32972)wxiaoguang2024-12-252-134/+209
|
* Clarify path param naming (#32969)wxiaoguang2024-12-242-3/+7
| | | | | | | | | In history (from some legacy frameworks), both `:name` and `name` are supported as path path name, `:name` is an alias to `name`. To make code consistent, now we should only use `name` but not `:name`. Also added panic check in related functions to make sure the name won't be abused in case some downstreams still use them.
* Refactor getpatch/getdiff functions and remove unnecessary fallback (#32817)Lunny Xiao2024-12-242-63/+10
| | | | | | | | | | Extract from #32786 `git diff a..b` is equal to `git diff a b` which is different from `git diff a...b`. For pull request, we should always --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor request context (#32956)wxiaoguang2024-12-247-110/+163
| | | | | | | | | | | Introduce RequestContext: is a short-lived context that is used to store request-specific data. RequestContext could be used to clean form tmp files, close context git repo, and do some tracing in the future. Then a lot of legacy code could be removed or improved. For example: most `ctx.Repo.GitRepo.Close()` could be removed because the git repo could be closed when the request is done.
* Add sub issue list support (#32940)wxiaoguang2024-12-247-74/+172
| | | Just like GitHub, show issue icon/title when the issue number is in a list