summaryrefslogtreecommitdiffstats
path: root/routers
Commit message (Collapse)AuthorAgeFilesLines
...
* Various code view improvements (#30014)silverwind2024-03-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Restore missing styles for message close icon 2. Move `code-line-button` so that it does not go off-screen on small viewports 3. Make `code-line-button` look and behave like other buttons 4. Make `code-line-button` work in blame 5. Make the active selection span the whole line, not just the code part 6. Tweak colors, make dark theme code bg darker, make line numbers same color in diff and file view. 7. Move code background to parent, fixing border radius and other problems 8. Enable code wrap in blame 9. Improve blame responsiveness 10. Remove `--color-code-sidebar-bg` in blame, now it uses same background as code 11. Rename `--color-active-line` to `--color-highlight-bg` 12. Add `--color-highlight-bg` 13. Fix button group borders on hover and border-right on last button. <img width="1343" alt="Screenshot 2024-03-23 at 22 34 13" src="https://github.com/go-gitea/gitea/assets/115237/fcbb919f-5dc3-43f0-97f6-870d6f412554"> <img width="1334" alt="Screenshot 2024-03-23 at 22 34 26" src="https://github.com/go-gitea/gitea/assets/115237/ca44c3b7-4328-4645-ba49-b0dc6a5ac06d"> <img width="1338" alt="Screenshot 2024-03-23 at 22 34 57" src="https://github.com/go-gitea/gitea/assets/115237/00eb0b5a-1ec7-4669-a94a-4602b9d1c1ac"> <img width="1337" alt="Screenshot 2024-03-23 at 22 34 42" src="https://github.com/go-gitea/gitea/assets/115237/752edc4a-064f-413c-9dff-c086187fcd85"> Fixes: https://github.com/go-gitea/gitea/issues/18074
* Escape paths for find file correctly (#30026)wxiaoguang2024-03-231-2/+3
| | | Fix #30020
* Use db.ListOptionsAll instead of db.ListOptions{ListAll: true} (#29995)Lunny Xiao2024-03-228-30/+16
|
* Fix some pending problems (#29985)wxiaoguang2024-03-222-5/+4
| | | | | | | | | | | | | | | | | These changes are quite independent and trivial, so I don't want to open too many PRs. * https://github.com/go-gitea/gitea/pull/29882#discussion_r1529607091 * the `f.Close` should be called properly * the error message could be more meaningful (https://github.com/go-gitea/gitea/pull/29882#pullrequestreview-1942557935) * https://github.com/go-gitea/gitea/pull/29859#pullrequestreview-1942324716 * the new translation strings don't take arguments * https://github.com/go-gitea/gitea/pull/28710#discussion_r1443778807 * stale for long time * #28140 * a form was forgotten to be changed to work with backend code
* Fix bugs in rerunning jobs (#29955)Zettat1232024-03-222-6/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix #28761 Fix #27884 Fix #28093 ## Changes ### Rerun all jobs When rerun all jobs, status of the jobs with `needs` will be set to `blocked` instead of `waiting`. Therefore, these jobs will not run until the required jobs are completed. ### Rerun a single job When a single job is rerun, its dependents should also be rerun, just like GitHub does (https://github.com/go-gitea/gitea/issues/28761#issuecomment-2008620820). In this case, only the specified job will be set to `waiting`, its dependents will be set to `blocked` to wait the job. ### Show warning if every job has `needs` If every job in a workflow has `needs`, all jobs will be blocked and no job can be run. So I add a warning message. <img src="https://github.com/go-gitea/gitea/assets/15528715/88f43511-2360-465d-be96-ee92b57ff67b" width="480px" />
* Refactor external URL detection (#29973)wxiaoguang2024-03-224-59/+3
| | | | Follow #29960, `IsExternalURL` is not needed anymore. Add some tests for `RedirectToCurrentSite`
* Refactor StringsToInt64s (#29967)wxiaoguang2024-03-214-11/+11
| | | And close #27176
* Performance improvements for pull request list page (#29900)Lunny Xiao2024-03-213-13/+14
| | | | | | | | | | | This PR will avoid load pullrequest.Issue twice in pull request list page. It will reduce x times database queries for those WIP pull requests. Partially fix #29585 --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Refactor URL detection (#29960)wxiaoguang2024-03-216-8/+8
| | | "Redirect" functions should only redirect if the target is for current Gitea site.
* Restore deleted branches when syncing (#29898)Jason Song2024-03-201-3/+5
| | | | | | | | | | | Regression of #29493. If a branch has been deleted, repushing it won't restore it. Lunny may have noticed that, but I didn't delve into the comment then overlooked it: https://github.com/go-gitea/gitea/pull/29493#discussion_r1509046867 The additional comments added are to explain the issue I found during testing, which are unrelated to the fixes.
* Fix milestoneID filter bug in issue list (#29897)Zettat1232024-03-191-3/+3
| | | Fix #29717
* Fix template error when comment review doesn't exist (#29888)wxiaoguang2024-03-191-0/+17
| | | Fix #29885
* Fix missing error check of bufio.Scanner (#29882)coldWater2024-03-191-0/+4
| | | maybe more
* Only do counting when count_only=true for repo dashboard (#29884)wxiaoguang2024-03-181-10/+15
| | | Ref: #29878
* Editor error message misleading due to re-used key. (#29859)buckybytes2024-03-181-2/+2
| | | | | | | | | | | | | | | The error message: `editor.file_changed_while_editing = The file contents have changed since you started editing. <a target="_blank" rel="noopener noreferrer" href="%s">Click here</a> to see them or <strong>Commit Changes again</strong> to overwrite them.` Is re-used in inappropriate contexts. The link in the key goes to a 404 when the key is used in a situation where the file contents have not changed. Added two new keys to differentiate commit id mismatch and push out of date conditions.
* Fix missing code in the user profile (#29865)Nanguan Lin2024-03-171-0/+14
| | | | | | | fix #29820 deleted by https://github.com/go-gitea/gitea/pull/29248/files#diff-2b0b591787f16325539485e648a09ab6d3177f47dc129cfe84a35ffe141dfd19L39-L62, which causing malfunction of follow/unfollow and missing description in the user profile page.
* Upgrade Go 1.22 and upgrade dependency (#29869)wxiaoguang2024-03-174-10/+6
|
* Fix PR creation via api between branches of same repo with head field ↵norohind2024-03-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | namespaced (#26986) Fix #20175 Current implementation of API does not allow creating pull requests between branches of the same repo when you specify *namespace* (owner of the repo) in `head` field in http request body. --- Although GitHub implementation of API allows performing such action and since Gitea targeting compatibility with GitHub API I see it as an appropriate change. I'm proposing a fix to the described problem and test case which covers this logic. My use-case just in case: https://github.com/go-gitea/gitea/issues/20175#issuecomment-1711283022
* Remove AddParamIfExist(AddParam) (#29841)wxiaoguang2024-03-1616-45/+46
| | | | | | Follow #29834 Remove AddParamIfExist, use "AddParamString" instead, it should clearly know what is being added into the parameters.
* Refactor code_indexer to use an SearchOptions struct for PerformSearch (#29724)65432024-03-163-4/+33
| | | | | | | | similar to how it's already done for the issue_indexer --- *Sponsored by Kithara Software GmbH*
* Refactor AddParam to AddParamIfExist (#29834)wxiaoguang2024-03-1616-45/+45
| | | | | | | When read the code: `pager.AddParam(ctx, "search", "search")`, the question always comes: What is it doing? Where is the value from? Why "search" / "search" ? Now it is clear: `pager.AddParamIfExist("search", ctx.Data["search"])`
* Unify search boxes (#29530)Denys Konovalov2024-03-144-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify all but a few search boxes to use uniform style, uniform translations and shared templates where possible. Remove a few duplicated search templates, e. g. code search. <details><summary>Example after screenshots:</summary> ![grafik](https://github.com/go-gitea/gitea/assets/47871822/e20e7d6b-c6be-4a47-b132-672766f41421) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/d5b11b9c-c12f-4a29-8fb0-24e5aa511d18) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/d86bb444-36c7-426d-9cf1-c634963dffb1) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/a76c0319-0518-484a-a840-563d02b61198) </details> Also includes #29700 Co-authored-by: 6543 <6543@obermui.de> --------- Co-authored-by: 6543 <m.huber@kithara.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
* Fix lint-swagger warning (#29787)sillyguodong2024-03-142-3/+7
| | | | | | | | | | | Caused by: #23106 Fix: https://github.com/go-gitea/gitea/actions/runs/8274650046/job/22640335697 1. Delete `UserBadgeList` in `options.go`, because it wasn't used. (The struct defined in `options.go` is the struct used to parse the request body) 2. Move `BadgeList` struct under `routers/api/v1/swagger` folder which response should be defined in.
* Fix incorrect menu/link on webhook edit page (#29709)yp053272024-03-141-0/+1
| | | | | | | Fix #29699 --------- Co-authored-by: silverwind <me@silverwind.io>
* Use relative links for commits, mentions, and issues in markdown (#29427)KN4CK3R2024-03-131-2/+4
| | | | | | | | | | | | Fixes #29404 Use relative links for - commits - mentions - issues --------- Co-authored-by: silverwind <me@silverwind.io>
* Move fork router functions to a standalone file (#29756)Lunny Xiao2024-03-132-214/+238
| | | To reduce the pull.go file's size.
* Refactor to use optional.Option for issue index search option (#29739)65432024-03-133-38/+38
| | | Signed-off-by: 6543 <6543@obermui.de>
* Fix user router possbile panic (#29751)Lunny Xiao2024-03-131-2/+5
| | | regression from #28023
* Refactor label.IsArchived() (#29750)65432024-03-131-7/+5
| | | just some missed nits
* Use Get but not Post to get actions artifacts (#29734)Lunny Xiao2024-03-121-1/+1
|
* Do some performance optimize for issues list and view issue/pull (#29515)Lunny Xiao2024-03-123-31/+20
| | | | | | | | | | | | | | This PR do some performance optimzations. - [x] Add `index` for the column `comment_id` of `Attachment` table to accelerate query from the database. - [x] Remove unnecessary database queries when viewing issues. Before some conditions which id = 0 will be sent to the database - [x] Remove duplicated load posters - [x] Batch loading attachements, isread of comments on viewing issue --------- Co-authored-by: Zettat123 <zettat123@gmail.com>
* Some performance optimization on dashboard and issues page (#29010)Lunny Xiao2024-03-121-1/+5
| | | | | | | | | This PR do some loading speed optimization for feeds user interface pages. - Load action users batchly but not one by one. - Load action repositories batchly but not one by one. - Load action's Repo Owners batchly but not one by one. - Load action's possible issues batchly but not one by one. - Load action's possible comments batchly but not one by one.
* remove repetitive words (#29695)pengqiseven2024-03-112-2/+2
| | | Signed-off-by: pengqiseven <912170095@qq.com>
* Sync branches first (#29714)Jason Song2024-03-111-13/+13
| | | | | Follow #29493. Sync branches to DB first, then trigger push events.
* Add a warning for disallowed email domains (#29658)Zettat1232024-03-112-0/+17
| | | | | | | | | | | | | Resolve #29660 Follow #29522 and #29609 Add a warning for disallowed email domains when admins manually add/edit users. Thanks @yp05327 for the [comment](https://github.com/go-gitea/gitea/pull/29605#issuecomment-1980105119) ![image](https://github.com/go-gitea/gitea/assets/15528715/6737b221-a3a2-4180-9ef8-b846c10f96e0)
* Use repo object format name instead of detecting from git repository (#29702)Lunny Xiao2024-03-102-12/+2
| | | | It's unnecessary to detect the repository object format from git repository. Just use the repository's object format name.
* Patch in exact search for meilisearch (#29671)65432024-03-093-6/+6
| | | | | | | | | | | | | | | | | | | meilisearch does not have an search option to contorl fuzzynes per query right now: - https://github.com/meilisearch/meilisearch/issues/1192 - https://github.com/orgs/meilisearch/discussions/377 - https://github.com/meilisearch/meilisearch/discussions/1096 so we have to create a workaround by post-filter the search result in gitea until this is addressed. For future works I added an option in backend only atm, to enable fuzzynes for issue indexer too. And also refactored the code so the fuzzy option is equal in logic to code indexer --- *Sponsored by Kithara Software GmbH*
* Move get/set default branch from git package to gitrepo package to hide ↵Lunny Xiao2024-03-083-4/+5
| | | | repopath (#29126)
* Make runs-on support variable expression (#29468)sillyguodong2024-03-081-68/+12
| | | | | | | | As title. Close issue: https://gitea.com/gitea/act_runner/issues/445 Follow: https://gitea.com/gitea/act/pulls/91 Move `getSecretsOfTask` and `getVariablesOfTask` under `models` because of circular dependency issues.
* Fix 500 when deleting account with incorrect password or unsupported login ↵Lunny Xiao2024-03-081-2/+17
| | | | | | | | | type (#29579) Fix #26210 --------- Co-authored-by: Jason Song <i@wolfogre.com>
* Update various logos and unify their filenames (#29637)silverwind2024-03-061-1/+1
| | | | | | | | 1. Checked all logos, updated 3 of them to newer versions. 2. Remove `open-with-` infix on the editor logos to be consistent with other files. <img width="626" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/3b2d9486-6e0a-45c6-b0e4-d38dc4c0b118">
* Cache repository default branch commit status to reduce query on commit ↵Lunny Xiao2024-03-062-22/+10
| | | | | | | | | | | | | status table (#29444) After repository commit status has been introduced on dashaboard, the most top SQL comes from `GetLatestCommitStatusForPairs`. This PR adds a cache for the repository's default branch's latest combined commit status. When a new commit status updated, the cache will be marked as invalid. <img width="998" alt="image" src="https://github.com/go-gitea/gitea/assets/81045/76759de7-3a83-4d54-8571-278f5422aed3">
* Detect broken git hooks (#29494)Jason Song2024-03-061-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | Detect broken git hooks by checking if the commit id of branches in DB is the same with the git repo. It can help #29338 #28277 and maybe more issues. Users could complain about actions, webhooks, and activities not working, but they were not aware that it is caused by broken git hooks unless they could see a warning. <img width="1348" alt="image" src="https://github.com/go-gitea/gitea/assets/9418365/2b92a46d-7f1d-4115-bef4-9f970bd695da"> It should be merged after #29493. Otherwise, users could see a ephemeral warning after committing and opening the repo home page immediately. And it also waits for #29495, since the doc link (the anchor part) will be updated. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Sync branches to DB immediately when handle git hook calling (#29493)Jason Song2024-03-061-1/+65
| | | | | | | | | | | Unlike other async processing in the queue, we should sync branches to the DB immediately when handling git hook calling. If it fails, users can see the error message in the output of the git command. It can avoid potential inconsistency issues, and help #29494. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Make wiki default branch name changable (#29603)wxiaoguang2024-03-063-25/+72
| | | | | | | | | Fix #29000 Fix #28685 Fix #18568 Related: #27497 And by the way fix #24036, add a Cancel button there (one line)
* Fix 500 error when adding PR comment (#29622)wxiaoguang2024-03-061-0/+6
|
* Skip email domain check when admins edit user emails (#29609)Zettat1232024-03-052-2/+2
| | | | | | Follow #29522 Administrators should be able to set a user's email address even if the email address is not in `EMAIL_DOMAIN_ALLOWLIST`
* Skip email domain check when admin users adds user manually (#29522)Zettat1232024-03-052-2/+2
| | | | | | Fix #27457 Administrators should be able to manually create any user even if the user's email address is not in `EMAIL_DOMAIN_ALLOWLIST`.
* Make "/user/login" page redirect if the current user has signed in (#29583)wxiaoguang2024-03-053-11/+64
| | | | Fix #29582 and maybe more. Maybe fix #29116
* Add missing database transaction for new issue (#29490)Lunny Xiao2024-03-042-14/+10
| | | | When creating an issue, inserting issue, assign users and set project should be in the same transaction.