aboutsummaryrefslogtreecommitdiffstats
path: root/services/doctor
Commit message (Collapse)AuthorAgeFilesLines
* Enable addtional linters (#34085)TheFox0x79 days2-3/+4
| | | | | | | | enable mirror, usestdlibbars and perfsprint part of: https://github.com/go-gitea/gitea/issues/34083 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Enable testifylint rules (#34075)TheFox0x711 days1-2/+2
| | | | enable testifylint rules disabled in: https://github.com/go-gitea/gitea/pull/34054
* add additional ReplaceAll in pathsep to cater for different pathsep (#34061)JonRB12 days1-1/+1
| | | | | | | | | | | | | | The doctor storage check reconstructs the lfs oid by producing a string where the path separator is stripped ab/dc/efg -> abdcefg. Windows however uses a backslash and thus the ReplaceAll call doesn't produce the correct oid resulting in all lfs objects being classed as orphaned. This PR allows this to be more OS agnostic. Closes #34039 --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Fix some migration and repo name problems (#33986)wxiaoguang2025-03-241-6/+0
| | | | | | 1. Ignore empty inputs in `UnmarshalHandleDoubleEncode` 2. Ignore non-existing `stateEvent.User` in gitlab migration 3. Enable `release` and `wiki` units when they are selected in migration 4. Sanitize repo name for migration and new repo
* Use filepath.Join instead of path.Join for file system file operations (#33978)Lunny Xiao2025-03-241-4/+4
|
* Don't create duplicated functions for code repositories and wiki ↵Lunny Xiao2025-03-191-2/+2
| | | | | | | | | | 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.
* Move hooks function to gitrepo and reduce expose repopath (#33890)Lunny Xiao2025-03-161-3/+2
| | | | Extract from #28966 Follow #33874
* Improve log format (#33814)wxiaoguang2025-03-081-4/+4
|
* Add global lock for migrations to make upgrade more safe with multiple ↵Lunny Xiao2025-03-071-1/+2
| | | | replications (#33706)
* Remove context from git struct (#33793)TheFox0x72025-03-043-10/+10
| | | | Argument is moved from struct init in command run, which lets us remove context from struct.
* Add migrations and doctor fixes (#33556)Lunny Xiao2025-03-021-0/+19
| | | Fix #33535
* Refactor older tests to use testify (#33140)TheFox0x72025-01-091-3/+2
| | | | | Refactor checks to use assert/require Use require.Eventually for waiting in elastic and meilisearch tests Use require to exit early instead of assert
* Move team related functions to service layer (#32537)Lunny Xiao2024-11-271-2/+2
| | | | | 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.
* Add a doctor check to disable the "Actions" unit for mirrors (#32424)Zettat1232024-11-101-0/+70
| | | | | | | | Resolve #32232 Users can disable the "Actions" unit for all mirror repos by running ``` gitea doctor check --run disable-mirror-actions-unit --fix ```
* Refactor the DB migration system slightly (#32344)wxiaoguang2024-10-271-1/+1
| | | | Introduce "idNumber" for each migration, and clarify the difference between the migration ID number and database version.
* Resolve lint for unused parameter and unnecessary type arguments (#30750)Chongyi Zheng2024-04-291-7/+7
| | | | | | | | | | Resolve all cases for `unused parameter` and `unnecessary type arguments` Related: #30729 --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Add a db consistency check to remove runners that do not belong to a ↵Zettat1232024-04-231-0/+6
| | | | | repository (#30614) Follow #30406
* Add optional doctor storage init (#30330)Michael Kriese2024-04-081-0/+11
| | | Add optional storage init to doctor
* Fix oauth2 builtin application logic (#30304)wxiaoguang2024-04-083-11/+79
| | | | | | Fix #29074 (allow to disable all builtin apps) and don't make the doctor command remove the builtin apps. By the way, rename refobject and joincond to camel case.
* Fix gitea doctor will remove repo-avatar files when execute command ↵yp053272024-03-261-1/+1
| | | | | `storage-archives` (#30094) Fix #30037
* Fix panic for `fixBrokenRepoUnits16961` (#30068)yp053272024-03-261-0/+6
| | | ![image](https://github.com/go-gitea/gitea/assets/18380374/508b3ceb-f53d-4d3b-a781-97c1542af1cb)
* Fix some pending problems (#29985)wxiaoguang2024-03-221-3/+3
| | | | | | | | | | | | | | | | | 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 missing error check of bufio.Scanner (#29882)coldWater2024-03-191-0/+4
| | | maybe more
* Move some asymkey functions to service layer (#28894)Lunny Xiao2024-03-041-2/+3
| | | | After the moving, all models will not depend on `util.Rename` so that I can do next step refactoring.
* Simplify how git repositories are opened (#28937)Lunny Xiao2024-01-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ## Purpose This is a refactor toward building an abstraction over managing git repositories. Afterwards, it does not matter anymore if they are stored on the local disk or somewhere remote. ## What this PR changes We used `git.OpenRepository` everywhere previously. Now, we should split them into two distinct functions: Firstly, there are temporary repositories which do not change: ```go git.OpenRepository(ctx, diskPath) ``` Gitea managed repositories having a record in the database in the `repository` table are moved into the new package `gitrepo`: ```go gitrepo.OpenRepository(ctx, repo_model.Repo) ``` Why is `repo_model.Repository` the second parameter instead of file path? Because then we can easily adapt our repository storage strategy. The repositories can be stored locally, however, they could just as well be stored on a remote server. ## Further changes in other PRs - A Git Command wrapper on package `gitrepo` could be created. i.e. `NewCommand(ctx, repo_model.Repository, commands...)`. `git.RunOpts{Dir: repo.RepoPath()}`, the directory should be empty before invoking this method and it can be filled in the function only. #28940 - Remove the `RepoPath()`/`WikiPath()` functions to reduce the possibility of mistakes. --------- Co-authored-by: delvh <dev.lh@web.de>
* Move doctor package from modules to services (#28856)Lunny Xiao2024-01-2017-0/+2386