aboutsummaryrefslogtreecommitdiffstats
path: root/models
Commit message (Collapse)AuthorAgeFilesLines
* Don't create duplicated functions for code repositories and wiki ↵Lunny Xiao11 days1-4/+16
| | | | | | | | | | 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 Smith13 days4-13/+76
| | | | | | | Fixes #33484 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor functions to reduce repopath expose (#33892)Lunny Xiao2025-03-161-4/+3
|
* Give organisation members access to organisation feeds (#33508)Job2025-03-151-29/+53
| | | | | | | | | | | | | | | | | | | | | | | | 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 Bryant2025-03-151-0/+3
| | | | | | | | | | | 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>
* Feature: Ephemeral action runners (#33570)ChristopherHX2025-03-143-0/+19
| | | | | | | | * This includes a runner mock test for hardend PickTask behavior like described in my proposal * Runner register ephemeral flag introduced in https://gitea.com/gitea/act_runner/pulls/649 Closes #32461
* Add workflow_job webhook (#33694)ChristopherHX2025-03-111-1/+1
| | | | | | | | | 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-102-14/+19
| | | | | | | | * add missing commit status * conflicts with concurrency support Closes #33763 Co-authored-by: Giteabot <teabot@gitea.io>
* Move notifywatch to service layer (#33825)Lunny Xiao2025-03-102-170/+5
| | | No logic change.
* Decouple context from repository related structs (#33823)TheFox0x72025-03-083-26/+23
| | | Calls that required context implicitly are made to pass it as argument
* Improve log format (#33814)wxiaoguang2025-03-082-2/+2
|
* Add global lock for migrations to make upgrade more safe with multiple ↵Lunny Xiao2025-03-072-3/+3
| | | | replications (#33706)
* Remove context from git struct (#33793)TheFox0x72025-03-042-8/+8
| | | | Argument is moved from struct init in command run, which lets us remove context from struct.
* Small refactor to reduce unnecessary database queries and remove duplicated ↵Lunny Xiao2025-03-0410-12/+32
| | | | functions (#33779)
* Refactor error system (#33771)wxiaoguang2025-03-034-6/+6
| | | It should not expose `util.SilentWrap` or construct it manually.
* Add migrations and doctor fixes (#33556)Lunny Xiao2025-03-025-0/+62
| | | Fix #33535
* Use pullrequestlist instead of []*pullrequest (#33765)Lunny Xiao2025-03-022-8/+8
| | | Just renames no code changed.
* Add composor source field (#33502)Lunny Xiao2025-02-281-3/+6
| | | Fix #33066
* Improve "generate new access token" form (#33730)Guillaume2025-02-272-3/+16
| | | | | | | | | | | | | | | | | | | | | 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>
* Clone repository with Tea CLI (#33725)Quentin2025-02-271-5/+13
| | | | | | | | | | | | 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>
* allow filtering /repos/{owner}/{repo}/pulls by target base branch queryparam ↵Royce Remer2025-02-271-0/+5
| | | | | | (#33684) Co-authored-by: Royce Remer <rremer@salesforce.com> Co-authored-by: delvh <dev.lh@web.de>
* Optimize user dashboard loading (#33686)Lunny Xiao2025-02-242-14/+44
| | | | | | | | 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.
* Fix some user name usages (#33689)wxiaoguang2025-02-233-2/+21
| | | | | | | 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"
* Fix omitempty bug (#33663)Lunny Xiao2025-02-201-1/+1
| | | Fix #33660
* Use test context in tests and new loop system in benchmarks (#33648)TheFox0x72025-02-2011-37/+28
| | | | | | | | Replace all contexts in tests with go1.24 t.Context() --------- Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix PR web route permission check (#33636)wxiaoguang2025-02-191-4/+6
| | | | | | | | | | | 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-2/+3
| | | | | 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-176-185/+347
| | | | | | | | | | | | | | | | | | | 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>
* Fix project issues list and counting (#33594)Lunny Xiao2025-02-176-93/+74
| | | | Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add API to support link package to repository and unlink it (#33481)Lunny Xiao2025-02-161-0/+5
| | | | | | | Fix #21062 --------- Co-authored-by: Zettat123 <zettat123@gmail.com>
* Move commits signature and verify functions to service layers (#33605)Lunny Xiao2025-02-168-491/+22
| | | | No logic change, just move functions.
* Artifacts download api for artifact actions v4 (#33510)ChristopherHX2025-02-162-9/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Fix bug when get commit (#33602)Lunny Xiao2025-02-151-7/+11
| | | Fix #33595
* Improve commits list performance to reduce unnecessary database queries (#33528)Lunny Xiao2025-02-144-32/+121
| | | | | | 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-2/+4
| | | | (#33585)
* Fix various problems (artifact order, api empty slice, assignee check, fuzzy ↵wxiaoguang2025-02-131-1/+7
| | | | | | | | | | prompt, mirror proxy, adopt git) (#33569) * Make artifact list output a stable order * Fix #33506 * Fix #33521 * Fix #33288 * Fix #33196 * Fix #33561
* Enhance routers for the Actions runner operations (#33549)Jason Song2025-02-111-0/+9
| | | | | | | | | - 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-111-6/+16
| | | | | | | | | | - 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>
* Rework suggestion backend (#33538)Lunny Xiao2025-02-101-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add a option "--user-type bot" to admin user create, improve role display ↵mscherer2025-02-072-8/+10
| | | | | | | | | | | (#27885) Partially solve #13044 Fix #33295 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add alphabetical project sorting (#33504)John Smith2025-02-051-0/+4
| | | Fixes #33500
* Fix unnecessary comment when moving issue on the same project column (#33496)Lunny Xiao2025-02-051-4/+6
| | | Fix #33482
* chore: fix some trivial problems and TODOs (#33473)wxiaoguang2025-02-022-3/+1
| | | | | | | | | | | 1. Fix incorrect `MentionCount` (actually it seems to be deadcode, affects nothing) 2. Remove fallback sha1 support for time limit token 3. Use route middleware `reqRepoActionsWriter` for `ArtifactsDeleteView` 4. Use clearer message "Failed to authenticate user" instead of "Verify" when auth fails 5. `tests/integration/benchmarks_test.go` is not quite right, actually it is never used, so delete it. 6. Remove or update TODO comments
* Worktime tracking for the organization level (#19808)K Kovacs2025-02-031-0/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dear Gitea team, first of all, thanks for the great work you're doing with this project. I'm planning to introduce Gitea at a client site, and noticed that while there is time recording, there are no project-manager-friendly reports to actually make use of that data, as were also mentioned by others in #4870 #8684 and #13531. Since I had a little time last weekend, I had put together something that I hope to be a useful contribution to this great project (while of course useful for me too). This PR adds a new "Worktime" tab to the Organisation level. There is a date range selector (by default set to the current month), and there are three possible views: - by repository, - by milestone, and - by team member. Happy to receive any feedback! There are several possible future improvements of course (predefined date ranges, charts, a member time sheet, matrix of repos/members, etc) but I hope that even in this relatively simple state this would be useful to lots of people. <img width="1161" alt="Screen Shot 2022-05-25 at 22 12 58" src="https://user-images.githubusercontent.com/118010/170366976-af00c7af-c4f3-4117-86d7-00356d6797a5.png"> Keep up the good work! Kristof --------- Co-authored-by: user <user@kk-git1> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Hide/disable unusable UI elements when a repository is archived (#33459)wxiaoguang2025-01-311-5/+7
| | | And by the way, remove some jQuery code
* Support choose email when creating a commit via web UI (more) (#33445)wxiaoguang2025-01-312-14/+1
| | | Follow #33432
* Refactor repository transfer (#33211)Lunny Xiao2025-01-301-15/+52
| | | | | | | | | | | | | - Both have `RejectTransfer` and `CancelTransfer` because the permission checks are not the same. `CancelTransfer` can be done by the doer or those who have admin permission to access this repository. `RejectTransfer` can be done by the receiver user if it's an individual or those who can create repositories if it's an organization. - Some tests are wrong, this PR corrects them. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Support choose email when creating a commit via web UI (#33432)wxiaoguang2025-01-302-1/+11
| | | Initial PR for #24469
* Refactor user & avatar (#33433)wxiaoguang2025-01-306-41/+123
| | | | | 1. better GetPossibleUserByID logic 2. fix some function name & comment typos 3. do not re-generate avatar if one exists
* Refactor user package (#33423)wxiaoguang2025-01-295-50/+58
| | | and avoid global variables