aboutsummaryrefslogtreecommitdiffstats
path: root/services
Commit message (Collapse)AuthorAgeFilesLines
...
* Support the new exit code for `git remote` subcommands for git version ↵yp053272025-01-072-8/+7
| | | | | | | | | >=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-15/+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-061-8/+6
|
* Fix empty git repo handling logic (#33101)wxiaoguang2025-01-041-3/+0
| | | Fix #33092
* Inherit submodules from template repository content (#16237)Steffen Schröter2025-01-011-63/+67
| | | | | | | | Fix #10316 --------- Signed-off-by: Steffen Schröter <steffen@vexar.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* feat(action): issue change title notifications (#33050)Bo-Yi Wu2024-12-311-0/+8
| | | | | | | | | | | | | | | | | | | | | - Add `IssueChangeTitle` method to handle issue title changes - Add `notifyIssueChangeWithTitleOrContent` method to generalize notification handling for issue title or content changes action file as below: ```yaml name: Semantic Pull Request on: pull_request_target: types: [edited] ``` --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* [Feature] Private README.md for organization (#32872)Chai-Shi2024-12-313-5/+10
| | | | | | | | Implemented #29503 --------- Co-authored-by: Ben Chang <ben_chang@htc.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix duplicate co-author in squashed merge commit messages (#33020)hiifong2024-12-301-1/+5
| | | | | | | Fix: #31980 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Move SetMerged to service layer (#33045)Lunny Xiao2024-12-302-2/+61
| | | | No code change. Extract from #32178
* Remove aws go sdk package dependency (#33029)Lunny Xiao2024-12-301-5/+5
| | | | | This PR removed the dependency of `github.com/aws/aws-sdk-go/aws` Patially fix for #33023
* Refactor pagination (#33037)wxiaoguang2024-12-301-22/+2
| | | | | I am sure the simple approach should work, let's try it in 1.24 Follow #29834 and #29841
* Test webhook email (#33033)wxiaoguang2024-12-301-0/+12
| | | Close #27918
* Refactor tests (#33021)wxiaoguang2024-12-291-1/+1
| | | | | | | | | | | | | | | | 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 ... ```
* Fix Agit pull request permission check (#32999)a10121127962024-12-271-1/+2
| | | | | | | | | | | user with read permission should also can create agit flow pull request. looks this logic was broken in https://github.com/go-gitea/gitea/pull/31033 this pull request try fix it and add test code. --------- Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Support for email addresses containing uppercase characters when activating ↵Zettat1232024-12-271-3/+6
| | | | | | | | | user account (#32998) Fix #32807 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor "string truncate" (#32984)wxiaoguang2024-12-264-6/+5
|
* Use `CloseIssue` and `ReopenIssue` instead of `ChangeStatus` (#32467)Lunny Xiao2024-12-254-25/+52
| | | | | | | | | | | | | | 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>
* demilestone should not include milestone (#32923)Lunny Xiao2024-12-252-0/+12
| | | Fix #32887
* Clarify path param naming (#32969)wxiaoguang2024-12-2411-120/+147
| | | | | | | | | 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-241-4/+14
| | | | | | | | | | 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-2413-196/+124
| | | | | | | | | | | 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-248-15/+133
| | | 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-232-3/+128
| | | | | | Fix #23703 When Gitea starts, it reads GITEA_RUNNER_REGISTRATION_TOKEN or GITEA_RUNNER_REGISTRATION_TOKEN_FILE to add registration token.
* Fix repo avatar conflict (#32958)wxiaoguang2024-12-233-3/+12
| | | Continue even if the avatar deleting fails
* Refactor template & test related code (#32938)wxiaoguang2024-12-228-27/+26
| | | Move some legacy code from "base" package to proper packages.
* Move some errors to their own sub packages (#32880)Lunny Xiao2024-12-2021-110/+457
|
* Refactor pprof labels and process desc (#32909)wxiaoguang2024-12-2011-55/+16
| | | | | | * 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
* Add more load functions to make sure the reference object loaded (#32901)Lunny Xiao2024-12-192-0/+9
| | | Fix #32897
* Fix Arch package metadata introduced incorrect field (#32881)Exploding Dragon2024-12-181-1/+2
| | | | | | Incorrect content was introduced while generating the index, which has now been removed, and the missing fields have been added. ![](https://github.com/user-attachments/assets/4fbb8884-337e-43b1-939f-a5ba687f7ffd)
* Move delete deploy keys into service layer (#32201)Lunny Xiao2024-12-183-14/+56
|
* Move RepoTransfer from models to models/repo sub package (#32506)Lunny Xiao2024-12-1810-42/+81
| | | | | | | | | | | | | `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/+6
| | | | | | | | | | | | | | 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>
* Refactor some LDAP code (#32849)wxiaoguang2024-12-155-34/+42
|
* Enable tenv and testifylint rules (#32852)TheFox0x72024-12-1516-46/+44
| | | | Enables tenv and testifylint linters closes: https://github.com/go-gitea/gitea/issues/32842
* Add missing two sync feed for refs/pull (#32815)Lunny Xiao2024-12-131-0/+12
| | | Fowllow #32659
* Detect whether action view branch was deleted (#32764)Lunny Xiao2024-12-121-1/+1
| | | | | Fix #32761 ![图片](https://github.com/user-attachments/assets/a5a7eef8-0fea-4242-b199-1b0b73d9bbdb)
* Make API "compare" accept commit IDs (#32801)wxiaoguang2024-12-121-23/+7
|
* Add label/author/assignee filters to the user/org home issue list (#32779)wxiaoguang2024-12-111-0/+13
| | | | | | | | | | 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-0/+251
| | | | | | | | | | | | | | | | | | | | (#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`.
* Support "merge upstream branch" (Sync fork) (#32741)wxiaoguang2024-12-062-1/+118
| | | | | | | | | Add basic "sync fork" support (GitHub-like) <details> ![image](https://github.com/user-attachments/assets/e71473f4-4518-48c7-b9e2-fedfcd564fc3) </details>
* GitHub like repo home page (#32213)yp053272024-12-061-8/+1
| | | | | | | Move some components (description, license, release, language stats) to sidebar --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Issue time estimate, meaningful time tracking (#23113)Illya Marchenko2024-12-053-0/+13
| | | | | | | | | | | | | Redesign the time tracker side bar, and add "time estimate" support (in "1d 2m" format) Closes #23112 --------- Co-authored-by: stuzer05 <stuzer05@gmail.com> Co-authored-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add Arch package registry (#32692)KN4CK3R2024-12-045-5/+420
| | | | | | | | | | | | | | | | | | | | | | | Close #25037 Close #31037 This PR adds a Arch package registry usable with pacman. ![grafik](https://github.com/user-attachments/assets/81cdb0c2-02f9-4733-bee2-e48af6b45224) Rewrite of #25396 and #31037. You can follow [this tutorial](https://wiki.archlinux.org/title/Creating_packages) to build a package for testing. Docs PR: https://gitea.com/gitea/docs/pulls/111 Co-authored-by: [d1nch8g@ion.lc](mailto:d1nch8g@ion.lc) Co-authored-by: @ExplodingDragon --------- Co-authored-by: dancheg97 <dancheg97@fmnx.su> Co-authored-by: dragon <ExplodingFKL@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Use new mail package instead of an unmintained one (#32682)Lunny Xiao2024-12-058-60/+101
| | | Resolve #18664
* Fix delete branch perm checking (#32654)Lunny Xiao2024-12-041-6/+23
|
* Split mail sender sub package from mailer service package (#32618)Lunny Xiao2024-11-3013-398/+491
| | | | | | | | Move all mail sender related codes into a sub package of services/mailer. Just move, no code change. Then we just have dependencies on go-mail package in the new sub package. We can use other package to replace it because it's unmaintainable. ref #18664
* Move GetFeeds to service layer (#32526)Lunny Xiao2024-11-294-0/+180
| | | Move GetFeeds from models to service layer, no code change.
* Don't create action when syncing mirror pull refs (#32659)Lunny Xiao2024-11-281-0/+6
| | | Fix #27961
* Validate OAuth Redirect URIs (#32643)Rowan Bohde2024-11-281-1/+1
| | | | | | | This fixes a TODO in the code to validate the RedirectURIs when adding or editing an OAuth application in user settings. This also includes a refactor of the user settings tests to only create the DB once per top-level test to avoid reloading fixtures.
* Move team related functions to service layer (#32537)Lunny Xiao2024-11-2716-271/+1158
| | | | | There are still some functions under `models` after last big refactor about `models`. This change will move all team related functions to service layer with no code change.