aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web
Commit message (Collapse)AuthorAgeFilesLines
* Fix oauth2 auth and UI (#33961)wxiaoguang6 days1-1/+1
|
* Allow filtering issues by any assignee (#33343)Andreas Svanberg7 days5-31/+30
| | | | | | | | | | | | | | | | This is the opposite of the "No assignee" filter, it will match all issues that have at least one assignee. Before ![Before change](https://github.com/user-attachments/assets/4aea194b-9add-4a84-8d6b-61bfd8d9e58e) After ![After change with any filter](https://github.com/user-attachments/assets/99f1205d-ba9f-4a0a-a60b-cc1a0c0823fe) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Optimize total count of feed when loading activities in user dashboard. (#33841)Lunny Xiao7 days1-1/+1
| | | | | | | | | | | | Two SQLs are very slow when `action` table have over 5M records. ``` database duration=1.8881s db.sql="SELECT created_unix DIV 900 * 900 AS timestamp, count(user_id) as contributions FROM `action` WHERE user_id=? AND act_user_id=? AND (created_unix > ?) GROUP BY timestamp ORDER BY timestamp" database duration=1.5408s db.sql="SELECT count(*) FROM `action` WHERE (user_id = ?) AND (is_deleted = ?)" ``` This will cache the count for the first loading or when the activities changed.
* Don't create duplicated functions for code repositories and wiki ↵Lunny Xiao8 days4-6/+6
| | | | | | | | | | repositories (#33924) Fix https://github.com/go-gitea/gitea/pull/33910#pullrequestreview-2688913865 This PR changed the Repositroy interface in `gitrepo` package which makes it only focus the relative path in the disk and abstract whether it's a wiki repository or not.
* Added Description Field for Secrets and Variables (#33526)John Smith10 days2-3/+7
| | | | | | | Fixes #33484 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Move git references checking to gitrepo packages to reduce expose of ↵Lunny Xiao12 days6-11/+14
| | | | repository path (#33891)
* Give organisation members access to organisation feeds (#33508)Job12 days2-1/+51
| | | | | | | | | | | | | | | | | | | | | | | | Currently the organisation feed only includes items for public repositories (for non-administrators). This pull requests adds notifications from private repositories to the organisation-feed (for accounts that have access to the organisation). Feed-items only get shown for repositories where the users team(s) should have access to, this filtering seems to get done by some existing code. Needs some tests, but am unsure where/how to add them. Before: ![image](https://github.com/user-attachments/assets/8b63f430-227a-4b19-ad1a-f6f5175de301) After: ![image](https://github.com/user-attachments/assets/b439ce0e-4946-421c-a399-421806c7a6d8) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add file tree to file view page (#32721)Kerwin Bryant12 days6-45/+96
| | | | | | | | | | | Resolve #29328 This pull request introduces a file tree on the left side when reviewing files of a repository. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add abstraction layer to delete repository from disk (#33879)Lunny Xiao13 days1-4/+5
| | | | Extract from #28966 Follow #33874
* Improve repo commit view (#33877)wxiaoguang13 days2-1/+13
| | | | | | | | | | | | | | | | | Fix #24623 Major changes: 1. Redirect `/owner/repo/blob/*` requests to `/owner/repo/src/commit/*` (like GitHub) 2. Add a "view file diff" link (see screenshot below) 3. Refactor "AssertHTMLElement" to generic, now we can accurately assert existence or number. 4. Add more tests --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: delvh <dev.lh@web.de>
* Pull request updates will also trigger code owners review requests (#33744)Lunny Xiao14 days1-2/+1
| | | | | | | | | | Fix #33490 It will only read the changed file on the pushed commits but not all the files of this PR. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Improve issue & code search (#33860)wxiaoguang2025-03-134-17/+21
| | | | Each "indexer" should provide the "search modes" they support by themselves. And we need to remove the "fuzzy" search for code.
* Refactor cache-control (#33861)wxiaoguang2025-03-136-16/+18
| | | And fix #21391
* Add workflow_job webhook (#33694)ChristopherHX2025-03-112-1/+26
| | | | | | | | | Provide external Integration information about the Queue lossly based on https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=completed#workflow_job Naming conflicts between GitHub & Gitea are here, Blocked => Waiting, Waiting => Queued Rationale Enhancement for ephemeral runners management #33570
* Fix auto concurrency cancellation skips commit status updates (#33764)ChristopherHX2025-03-101-2/+1
| | | | | | | | * add missing commit status * conflicts with concurrency support Closes #33763 Co-authored-by: Giteabot <teabot@gitea.io>
* Fix material icon & diff highlight (#33844)wxiaoguang2025-03-101-1/+0
|
* Move notifywatch to service layer (#33825)Lunny Xiao2025-03-101-1/+1
| | | No logic change.
* Full-file syntax highlighting for diff pages (#33766)Dustin Firebaugh2025-03-094-4/+4
| | | | | | | | | | | | Fix #33358, fix #21970 This adds a step in the `GitDiffForRender` that does syntax highlighting for the entire file and then only references lines from that syntax highlighted code. This allows things like multi-line comments to be syntax highlighted correctly. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Improve theme display (#30671)wxiaoguang2025-03-081-7/+1
| | | | | | Document: https://gitea.com/gitea/docs/pulls/180 ![image](https://github.com/go-gitea/gitea/assets/2114189/68e38573-b911-45d9-b7aa-40d96d836ecb)
* Decouple diff stats query from actual diffing (#33810)wxiaoguang2025-03-084-29/+37
| | | | | | | | | The diff stats are no longer part of the diff generation. Use `GetDiffShortStat` instead to get the total number of changed files, added lines, and deleted lines. As such, `gitdiff.GetDiff` can be simplified: It should not do more than expected. And do not run "git diff --shortstat" for pull list. Fix #31492
* Use correct start and end commits for GetDiffTree (#33816)Alexander McRae2025-03-071-1/+1
| | | | | | Fixes https://github.com/go-gitea/gitea/pull/33514#issuecomment-2702814099 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor: move part of updating protected branch logic to service layer (#33742)Lunny Xiao2025-03-051-17/+3
|
* Remove context from git struct (#33793)TheFox0x72025-03-042-10/+10
| | | | Argument is moved from struct init in command run, which lets us remove context from struct.
* Refactor error system (#33771)wxiaoguang2025-03-031-1/+1
| | | It should not expose `util.SilentWrap` or construct it manually.
* Use `git diff-tree` for `DiffFileTree` on diff pages (#33514)Alexander McRae2025-02-284-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Improve "generate new access token" form (#33730)Guillaume2025-02-271-7/+27
| | | | | | | | | | | | | | | | | | | | | 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>
* Always show the "rerun" button for action jobs (#33692)wxiaoguang2025-02-242-2/+35
| | | And improve the mock code.
* Fix git empty check and HEAD request (#33690)wxiaoguang2025-02-241-1/+1
|
* Fix PR web route permission check (#33636)wxiaoguang2025-02-191-7/+9
| | | | | | | | | | | 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>
* Fix Untranslated Text on Actions Page (#33635)Kerwin Bryant2025-02-181-1/+1
| | | | | Fix the problem of untranslated text on the actions page Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Move issue pin to an standalone table for querying performance (#33452)Lunny Xiao2025-02-172-20/+33
| | | | | | | | | | | | | | | | | | | Noticed a SQL in gitea.com has a bigger load. It seems both `is_pull` and `pin_order` are not indexed columns in the database. ```SQL SELECT `id`, `repo_id`, `index`, `poster_id`, `original_author`, `original_author_id`, `name`, `content`, `content_version`, `milestone_id`, `priority`, `is_closed`, `is_pull`, `num_comments`, `ref`, `pin_order`, `deadline_unix`, `created_unix`, `updated_unix`, `closed_unix`, `is_locked`, `time_estimate` FROM `issue` WHERE (repo_id =?) AND (is_pull = 0) AND (pin_order > 0) ORDER BY pin_order ``` I came across a comment https://github.com/go-gitea/gitea/pull/24406#issuecomment-1527747296 from @delvh , which presents a more reasonable approach. Based on this, this PR will migrate all issue and pull request pin data from the `issue` table to the `issue_pin` table. This change benefits larger Gitea instances by improving scalability and performance. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor error system (#33610)wxiaoguang2025-02-1676-432/+431
|
* Fix project issues list and counting (#33594)Lunny Xiao2025-02-173-5/+30
| | | | Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Move commits signature and verify functions to service layers (#33605)Lunny Xiao2025-02-164-7/+10
| | | | No logic change, just move functions.
* enable literal string for code search (#33590)Darren Hoo2025-02-162-59/+6
| | | | | | | | Close: #33588 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Artifacts download api for artifact actions v4 (#33510)ChristopherHX2025-02-161-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | * download endpoint has to use 302 redirect * fake blob download used if direct download not possible * downloading v3 artifacts not possible New repo apis based on GitHub Rest V3 - GET /runs/{run}/artifacts (Cannot use run index of url due to not being unique) - GET /artifacts - GET + DELETE /artifacts/{artifact_id} - GET /artifacts/{artifact_id}/zip - (GET /artifacts/{artifact_id}/zip/raw this is a workaround for a http 302 assertion in actions/toolkit) - api docs removed this is protected by a signed url like the internal artifacts api and no longer usable with any token or swagger - returns http 401 if the signature is invalid - or change the artifact id - or expired after 1 hour Closes #33353 Closes #32124 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Improve commits list performance to reduce unnecessary database queries (#33528)Lunny Xiao2025-02-145-10/+45
| | | | | | When listing commits, Gitea attempts to retrieve the actual user based on the commit email. Querying users one by one from the database is inefficient. This PR optimizes the process by batch querying users by email, reducing the number of database queries.
* Performance optimization for pull request files loading comments attachments ↵Lunny Xiao2025-02-141-6/+6
| | | | (#33585)
* Fix PR's target branch dropdown (#33589)wxiaoguang2025-02-141-8/+16
| | | | | | Fix #33586 It only moves `PrepareBranchList` and `retrieveAssigneesData` to before the `CanModifyIssueOrPull` check, and adds more comments
* Fix various problems (artifact order, api empty slice, assignee check, fuzzy ↵wxiaoguang2025-02-131-4/+7
| | | | | | | | | | prompt, mirror proxy, adopt git) (#33569) * Make artifact list output a stable order * Fix #33506 * Fix #33521 * Fix #33288 * Fix #33196 * Fix #33561
* Fix context usage (#33554)wxiaoguang2025-02-111-1/+1
| | | | | | | | | Some old code use direct type-casting to get context, it causes problems. This PR fixes all legacy problems and use correct `ctx.Value` to get low-level contexts. Fix #33518
* Enhance routers for the Actions runner operations (#33549)Jason Song2025-02-113-207/+227
| | | | | | | | | - Find the runner before deleting - Move the main logic from `routers/web/repo/setting/runners.go` to `routers/web/shared/actions/runners.go`. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Enhance routers for the Actions variable operations (#33547)Jason Song2025-02-113-156/+175
| | | | | | | | | | - Find the variable before updating or deleting - Move the main logic from `routers/web/repo/setting/variables.go` to `routers/web/shared/actions/variables.go`. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Feature: Support workflow event dispatch via API (#33545)wxiaoguang2025-02-111-130/+11
| | | | | | | | | Fix: https://github.com/go-gitea/gitea/issues/31765 (Re-open #32059) --------- Co-authored-by: Bence Santha <git@santha.eu> Co-authored-by: Bence Sántha <7604637+bencurio@users.noreply.github.com> Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
* Rework suggestion backend (#33538)Lunny Xiao2025-02-101-49/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix #33522 The suggestion backend logic now is - If the keyword is empty, returned the latest 5 issues/prs with index desc order - If the keyword is digital, find all issues/prs which `index` has a prefix with that, with index asc order - If the keyword is non-digital or if the queried records less than 5, searching issues/prs title with a `like`, with index desc order ## Empty keyword <img width="310" alt="image" src="https://github.com/user-attachments/assets/1912c634-0d98-4eeb-8542-d54240901f77" /> ## Digital <img width="479" alt="image" src="https://github.com/user-attachments/assets/0356a936-7110-4a24-b21e-7400201bf9b8" /> ## Digital and title contains the digital <img width="363" alt="image" src="https://github.com/user-attachments/assets/6e12f908-28fe-48de-8ccc-09cbeab024d4" /> ## non-Digital <img width="435" alt="image" src="https://github.com/user-attachments/assets/2722bb53-baa2-4d67-a224-522a65f73856" /> <img width="477" alt="image" src="https://github.com/user-attachments/assets/06708dd9-80d1-4a88-b32b-d29072dd1ba6" /> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Revert "Feature: Support workflow event dispatch via API (#32059)" (#33541)wxiaoguang2025-02-101-24/+136
| | | This reverts commit 523751dc82bbb9d3f8d413f232e23ab0476eb4d4.
* Feature: Support workflow event dispatch via API (#32059)Bence Sántha2025-02-101-136/+24
| | | | | | | | | ref: https://github.com/go-gitea/gitea/issues/31765 --------- Signed-off-by: Bence Santha <git@santha.eu> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
* Add a option "--user-type bot" to admin user create, improve role display ↵mscherer2025-02-071-44/+37
| | | | | | | | | | | (#27885) Partially solve #13044 Fix #33295 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Move gitgraph from modules to services layer (#33527)Lunny Xiao2025-02-071-1/+1
| | | Just move, no code change.
* Refactor web route handler (#33488)wxiaoguang2025-02-057-107/+117
|