Skip to content

Remove unneeded doctor sub-commands#37156

Merged
silverwind merged 2 commits intogo-gitea:mainfrom
wxiaoguang:fix-doctor
Apr 9, 2026
Merged

Remove unneeded doctor sub-commands#37156
silverwind merged 2 commits intogo-gitea:mainfrom
wxiaoguang:fix-doctor

Conversation

@wxiaoguang
Copy link
Copy Markdown
Contributor

No description provided.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 9, 2026
Comment thread services/doctor/breaking.go
Comment thread services/doctor/actions.go
Comment thread services/doctor/dbversion.go
Comment thread services/doctor/fix16961.go
Comment thread services/doctor/mergebase.go
Comment thread services/doctor/misc.go
Comment thread services/doctor/misc.go
Comment thread services/doctor/paths.go
Comment thread services/doctor/usertype.go
@wxiaoguang
Copy link
Copy Markdown
Contributor Author

Explained my understanding in the comments. Feel free to correct if I was wrong.

@wxiaoguang wxiaoguang added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Apr 9, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Apr 9, 2026

Add a breaking label? Or too unimportant?

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 9, 2026
@wxiaoguang
Copy link
Copy Markdown
Contributor Author

Or too unimportant?

image

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 9, 2026
@lunny lunny added reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. type/refactoring Existing code has been cleaned up. There should be no new functionality. labels Apr 9, 2026
@lunny lunny added this to the 1.27.0 milestone Apr 9, 2026
@silverwind silverwind merged commit c10a5b9 into go-gitea:main Apr 9, 2026
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Apr 9, 2026
@wxiaoguang wxiaoguang deleted the fix-doctor branch April 9, 2026 23:26
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/refactoring Existing code has been cleaned up. There should be no new functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants