aboutsummaryrefslogtreecommitdiffstats
path: root/routers
Commit message (Collapse)AuthorAgeFilesLines
* Remove some unnecessary template helpers (#33069)wxiaoguang2025-01-011-0/+2
| | | | DisableGitHooks and DisableImportLocal are only used when editing a user, so only set them in `editUserCommon`
* Use project's redirect url instead of composing url (#33058)Lunny Xiao2024-12-313-9/+16
| | | | | | | Fix #32992 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor maven package registry (#33049)wxiaoguang2024-12-312-22/+56
| | | Close #33036
* [Feature] Private README.md for organization (#32872)Chai-Shi2024-12-3111-73/+116
| | | | | | | | Implemented #29503 --------- Co-authored-by: Ben Chang <ben_chang@htc.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Merge updatecommentattachment functions (#33044)Lunny Xiao2024-12-301-1/+1
| | | Extract from #32178
* Move SetMerged to service layer (#33045)Lunny Xiao2024-12-301-1/+1
| | | | No code change. Extract from #32178
* Use gitrepo.GetTreePathLatestCommit to get file lastest commit instead from ↵Lunny Xiao2024-12-302-21/+9
| | | | | | | | | | | | 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 pagination (#33037)wxiaoguang2024-12-3023-127/+31
| | | | | I am sure the simple approach should work, let's try it in 1.24 Follow #29834 and #29841
* Refactor tests (#33021)wxiaoguang2024-12-291-4/+5
| | | | | | | | | | | | | | | | 1. fix incorrect tests, for example: BeanExists doesn't do assert and shouldn't be used 2. remove unnecessary test functions 3. introduce DumpQueryResult to help to see the database rows during test (at least I need it) ``` ====== DumpQueryResult: SELECT * FROM action_runner_token ====== - # row[0] id: 1 token: xeiWBL5kuTYxGPynHCqQdoeYmJAeG3IzGXCYTrDX owner_id: 0 ... ```
* Refactor arch route handlers (#32993)wxiaoguang2024-12-281-35/+4
|
* De-emphasize signed commits (#31160)Blender Defender2024-12-281-10/+82
| | | | | | | | | | The new code structure is easier to make more improvements or refactor, for example: change the colors to de-emphasize more, or design some new layouts. --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Support for email addresses containing uppercase characters when activating ↵Zettat1232024-12-272-3/+3
| | | | | | | | | user account (#32998) Fix #32807 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Support org labels when adding labels by label names (#32988)Zettat1232024-12-261-1/+13
| | | Fix #32891
* Add `show more` organizations icon in user's profile (#32986)yp053272024-12-272-25/+26
| | | | | | | | | | | | | | | | | | | 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>
* Refactor "string truncate" (#32984)wxiaoguang2024-12-262-2/+2
|
* Use `CloseIssue` and `ReopenIssue` instead of `ChangeStatus` (#32467)Lunny Xiao2024-12-254-65/+61
| | | | | | | | | | | | | | The behaviors of closing issues and reopening issues are very different. So splitting it into two different functions makes it easier to maintain. - [x] Split ChangeIssueStatus into CloseIssue and ReopenIssue both at the service layer and model layer - [x] Rename `isClosed` to `CloseOrReopen` to make it more readable. - [x] Add transactions for ReopenIssue and CloseIssue --------- Co-authored-by: Zettat123 <zettat123@gmail.com>
* Fix maven pom inheritance (#32943)wxiaoguang2024-12-251-0/+2
| | | Fix #30568
* Refactor arch route handlers (#32972)wxiaoguang2024-12-251-16/+12
|
* Refactor tmpl and blob_excerpt (#32967)wxiaoguang2024-12-253-24/+6
| | | | | 1. do not use `{{/* */}}` to remove spaces, use `{{- -}}` 2. fix "blob_excerpt" endpoint, remove the legacy fragile code: have tested commit diff and wiki diff
* Clarify path param naming (#32969)wxiaoguang2024-12-2488-299/+300
| | | | | | | | | 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 request context (#32956)wxiaoguang2024-12-2414-113/+89
| | | | | | | | | | | 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-241-1/+1
| | | Just like GitHub, show issue icon/title when the issue number is in a list
* Use env GITEA_RUNNER_REGISTRATION_TOKEN as global runner token (#32946)wxiaoguang2024-12-233-4/+3
| | | | | | Fix #23703 When Gitea starts, it reads GITEA_RUNNER_REGISTRATION_TOKEN or GITEA_RUNNER_REGISTRATION_TOKEN_FILE to add registration token.
* Add auto-expanding running actions step (#30058)bytedream2024-12-221-1/+20
| | | | | | | Auto-expands the currently running action step. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor template & test related code (#32938)wxiaoguang2024-12-2287-301/+306
| | | Move some legacy code from "base" package to proper packages.
* Move some errors to their own sub packages (#32880)Lunny Xiao2024-12-2022-143/+134
|
* Refactor pprof labels and process desc (#32909)wxiaoguang2024-12-201-1/+0
| | | | | | * Deprecate "gopid" in log, it is not useful and requires very hacky approach * Remove "git.Command.SetDescription" because it is not useful and only makes the logs too flexible
* Update go tool dependencies (#32916)silverwind2024-12-191-3/+0
| | | | | | | | | | | | | | | | | Update all go tool dependencies to latest version. WIP because I think there are new gopls errors, would like to confirm them on CI first. Here is from a local run: ``` modules/markup/markdown/goldmark.go:115:37-53: unnecessary type arguments modules/markup/html.go:45:32-49: unnecessary type arguments modules/markup/internal/renderinternal.go:20:33-49: unnecessary type arguments modules/markup/common/linkify.go:27:32-49: unnecessary type arguments modules/util/time_str.go:28:39-63: unnecessary type arguments routers/web/repo/pull.go:704:19: impossible condition: non-nil == nil modules/util/util_test.go:248:14-23: unused parameter: other ``` ~~Backport because the `gxz` update might have security benefits.~~
* Refactor repo-projects.ts (#32892)silverwind2024-12-191-4/+6
| | | | | | | | | | - Remove jQuery - Add types to all functions - Tested all modified functionality --------- Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Move delete deploy keys into service layer (#32201)Lunny Xiao2024-12-182-2/+2
|
* Move RepoTransfer from models to models/repo sub package (#32506)Lunny Xiao2024-12-187-16/+18
| | | | | | | | | | | | | `RepoTransfer` now is at models, but if we want to move it into `repo` model, it will depend on `Team`. So this PR also makes repo model depend on org model to make it possible. Just refactor, no code change. - [x] Move `DeleteOrganization` from `models/organization` to service layer - [x] Move `AccessibleTeamReposEnv` to `models/repo` - [x] Move `RepoTransfer` from `models` to `models/repo` - [x] Merge `getUserTeamIDs` and `GetUserTeamIDs`, Merge `GetUserTeams` and `getUserTeams`. - [x] Remove `Team`'s `Repos []*repo_model.Repository` to avoid dependency recycle.
* Fix various trivial problems (#32861)wxiaoguang2024-12-171-0/+3
| | | | | | | | | | | | | | 1. add/improve comments to help future readers could understand the problem more easily. 2. add an error log to LDAP with username fallback 3. use `or` instead of `Iif` for "repo/branch_dropdown" (`Iif` was a mistake, but it doesn't really affect the UI) 4. add `tw-font-mono` style to container digest to match dockerhub 5. fix a bug in RepoBranchTagSelector: the form is not updated when there is no click to an item --------- Co-authored-by: delvh <dev.lh@web.de>
* Fix bug on action list deleted branch (#32848)Lunny Xiao2024-12-163-4/+41
| | | | | | | | Fix https://github.com/go-gitea/gitea/issues/32761#issuecomment-2540946064 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Enable tenv and testifylint rules (#32852)TheFox0x72024-12-152-3/+3
| | | | Enables tenv and testifylint linters closes: https://github.com/go-gitea/gitea/issues/32842
* Update golangci-lint to v1.62.2, fix issues (#32845)silverwind2024-12-152-4/+4
| | | Update it and fix new issues related to `redefines-builtin-id`
* Fix missing outputs for jobs with matrix (#32823)Zettat1232024-12-143-16/+86
| | | | | | | Fix #32795 If a job uses a matrix, multiple `ActionRunJobs` may have the same `JobID`. We need to merge the outputs of these jobs to make them available to the jobs that need them.
* Allow to fork repository into the same owner (#32819)wxiaoguang2024-12-141-3/+4
| | | | | | | | | | | | This feature is experimental, not fully tested, and may be changed in the future. It is only designed for users who really need it: set `[repository].ALLOW_FORK_INTO_SAME_OWNER=true` in your app.ini Doc: https://gitea.com/gitea/docs/pulls/122 ![image](https://github.com/user-attachments/assets/38d08c23-9cfc-49d8-9321-ff81edf65395)
* Detect whether action view branch was deleted (#32764)Lunny Xiao2024-12-122-2/+46
| | | | | Fix #32761 ![图片](https://github.com/user-attachments/assets/a5a7eef8-0fea-4242-b199-1b0b73d9bbdb)
* Make API "compare" accept commit IDs (#32801)wxiaoguang2024-12-123-85/+79
|
* Implement update branch API (#32433)Kemal Zebari2024-12-123-0/+74
| | | | | | | | | | Resolves #22526. Builds upon #23061. --------- Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add `is_archived` option for issue indexer (#32735)yp053272024-12-121-0/+7
| | | | | | | Try to fix #32697 Reason: `is_archived` is already defined in the query options, but it is not implemented in the indexer.
* Add standard-compliant route to serve outdated R packages (#32783)Sebastian T. T.2024-12-111-0/+1
| | | | | | | | | | | | | The R package repository currently does not have support for older versions of packages which should be stored in a separate /Archive router. This PR remedies that by adding a new path router. I am a member of a group that loves using Gitea and this bug has been annoying us for a long time. Hope it can be merged in time for Gitea 1.23.0. Any feedback much appreciated. Fixes #32782
* Rearrange Clone Panel (#31142)Blender Defender2024-12-111-2/+2
| | | | | | | | | | | | | Rearrange the clone panel to use less horizontal space. The following changes have been made to achieve this: - Moved everything into the dropdown menu - Moved the HTTPS/SSH Switch to a separate line - Moved the "Clone in VS Code"-Button up and added a divider - Named the dropdown button "Code", added appropriate icon --------- Co-authored-by: techknowlogick <techknowlogick@gitea.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add label/author/assignee filters to the user/org home issue list (#32779)wxiaoguang2024-12-117-174/+136
| | | | | | | | | | Replace #26661, fix #25979 Not perfect, but usable and much better than before. Since it is quite complex, I am not quite sure whether there would be any regression, if any, I will fix in first time. I have tested the related pages many times: issue list, milestone issue list, project view, user issue list, org issue list.
* Use batch database operations instead of one by one to optimze api pulls ↵Lunny Xiao2024-12-111-33/+2
| | | | | | | | | | | | | | | | | | | | (#32680) Resolve #31492 The response time for the Pull Requests API has improved significantly, dropping from over `2000ms` to about `350ms` on my local machine. It's about `6` times faster. A key area for further optimization lies in batch-fetching data for `apiPullRequest.ChangedFiles, apiPullRequest.Additions, and apiPullRequest.Deletions`. Tests `TestAPIViewPulls` does exist and new tests added. - This PR also fixes some bugs in `GetDiff` functions. - This PR also fixes data inconsistent in test data. For a pull request, the head branch's reference should be equal to the reference in `pull/xxx/head`.
* Fix internal server error when updating labels without write permission (#32776)yp053272024-12-101-5/+5
| | | | | | Fix #32775 if permission denined, `prepareForReplaceOrAdd` will return nothing, and this case is not handled.
* Refactor issue filter (labels, poster, assignee) (#32771)wxiaoguang2024-12-104-40/+9
| | | | | | | | | | | | Rewrite a lot of legacy strange code, remove duplicate code, remove jquery, and make these filters reusable. Let's forget the old code, new code affects: * issue list open/close switch * issue list filter (label, author, assignee) * milestone list open/close switch * milestone issue list filter (label, author, assignee) * project view (label, assignee)
* Make RepoActionView.vue support `##[group]` (#32770)wxiaoguang2024-12-101-3/+7
|
* Refactor issue list (#32755)wxiaoguang2024-12-083-49/+73
| | | | | 1. add backend support for filtering "poster" and "assignee" * due to the limits, there is no frontend support at the moment 2. rewrite TS code without jquery, now there are 14 jQuery files left:
* Fix compare page bug view as anonymous (#32754)Lunny Xiao2024-12-081-1/+3
| | | | Fix a bug introduced from https://github.com/go-gitea/gitea/pull/32403/files#diff-dc86301f15109eee38296d469630672193e0587ad1485fdd8f503bf4c789cf7eR692