Remove unneeded doctor sub-commands#37156
Merged
silverwind merged 2 commits intogo-gitea:mainfrom Apr 9, 2026
Merged
Conversation
wxiaoguang
commented
Apr 9, 2026
Contributor
Author
|
Explained my understanding in the comments. Feel free to correct if I was wrong. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes several previously available doctor checks/sub-commands and their supporting code (including related model helpers and test fixtures), aiming to simplify the services/doctor surface area.
Changes:
- Removed multiple doctor checks (paths/config validation, DB version check, merge base recalculation, historical fix16961 repair, user type repair, actions unfinished-run-status repair, and “breaking” username/email checks).
- Cleaned up related helper functions and tests/fixtures that only supported those checks.
- Updated actions run count expectations after removing action run fixtures tied to the deleted doctor check.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| services/doctor/usertype.go | Removed the “wrong user type” doctor check registration and implementation. |
| services/doctor/paths.go | Removed the configuration/paths doctor check (previously default + DB-skip). |
| services/doctor/misc.go | Removed “script-type” and “enable-push-options” checks and related imports/registrations. |
| services/doctor/mergebase.go | Removed PR merge-base recalculation check. |
| services/doctor/fix16961.go | Removed legacy dump-repair check for issue #16961. |
| services/doctor/fix16961_test.go | Removed tests that only covered the deleted fix16961 behavior. |
| services/doctor/dbversion.go | Removed doctor check that ensured/migrated DB version. |
| services/doctor/breaking.go | Removed optional checks for invalid user emails/usernames. |
| services/doctor/actions.go | Removed “fix unfinished actions run status” check; kept mirror-actions-unit check. |
| services/doctor/actions_test.go | Removed test that only covered the deleted actions doctor check. |
| models/user/user.go | Removed user model helpers that were only used by the deleted usertype doctor check. |
| models/fixtures/action_task.yml | Removed fixture row associated with deleted actions doctor test data. |
| models/fixtures/action_run.yml | Removed fixture run associated with deleted actions doctor test data. |
| models/fixtures/action_run_job.yml | Removed fixture job associated with deleted actions doctor test data. |
| models/actions/run_test.go | Updated expectations for NumActionRuns after fixture removal. |
Comments suppressed due to low confidence (1)
services/doctor/misc.go:203
- With the removal of the former "paths" check, there no longer appears to be any doctor check that sets SkipDatabaseInitialization=true. As a result, RunChecks will initialize DB/Git before running the first check; initDBSkipLogger calls setting.MustInstalled(), which uses log.Fatal and can terminate the process immediately for uninstalled/misconfigured instances (bypassing doctor’s normal error reporting). Consider reintroducing a minimal early configuration/paths check (SkipDatabaseInitialization=true, AbortIfFailed=true) or refactoring RunChecks/initDBSkipLogger to validate config/InstallLock without log.Fatal and return an error instead.
func init() {
Register(&Check{
Title: "Check if hook files are up-to-date and executable",
Name: "hooks",
IsDefault: false,
Run: checkHooks,
Priority: 6,
})
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
Add a breaking label? Or too unimportant? |
silverwind
approved these changes
Apr 9, 2026
Contributor
Author
Zettat123
approved these changes
Apr 9, 2026
lunny
approved these changes
Apr 9, 2026
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Apr 10, 2026
* main: Make Markdown fenced code block work with more syntaxes (go-gitea#37154) Remove unneeded doctor sub-commands (go-gitea#37156) Report structurally invalid workflows to users (go-gitea#37116) Replace `rollup-plugin-license` with `rolldown-license-plugin` (go-gitea#37130) Clean up and improve non-gitea js error filter (go-gitea#37148)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.