The Wayback Machine - https://web.archive.org/web/20220507003102/https://github.com/go-gitea/gitea/pull/12264
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor doctor #12264

Merged
merged 9 commits into from Dec 2, 2020
Merged

Refactor doctor #12264

merged 9 commits into from Dec 2, 2020

Conversation

Copy link
Contributor

@zeripath zeripath commented Jul 16, 2020

This PR refactors the doctor code to move it to its own module. It changes the functions to use a passed in logger instead of using a results array.

Fix #12706

@stale
Copy link

@stale stale bot commented Sep 15, 2020

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions.

@6543
Copy link

@6543 6543 commented Oct 22, 2020

so fare so good - I think with this refactor maintaining doctor is easyer ...

EDIT: just noticed some unrelated enhancements at the logger...

@zeripath
Copy link
Author

@zeripath zeripath commented Oct 22, 2020

They're not quite unrelated ... we need them for this

@zeripath zeripath changed the title WIP/RFC: Refactor doctor Refactor doctor Oct 22, 2020
@codecov-io
Copy link

@codecov-io codecov-io commented Oct 23, 2020

Codecov Report

Merging #12264 (7aaeaee) into master (253add8) will increase coverage by 0.01%.
The diff coverage is 17.06%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12264      +/-   ##
==========================================
+ Coverage   42.23%   42.24%   +0.01%     
==========================================
  Files         699      706       +7     
  Lines       76959    77123     +164     
==========================================
+ Hits        32500    32578      +78     
- Misses      39094    39179      +85     
- Partials     5365     5366       +1     
Impacted Files Coverage Δ
cmd/doctor.go 0.00% <0.00%> (ø)
modules/doctor/dbconsistency.go 10.81% <10.81%> (ø)
modules/doctor/mergebase.go 11.76% <11.76%> (ø)
modules/doctor/doctor.go 12.24% <12.24%> (ø)
modules/doctor/paths.go 14.49% <14.49%> (ø)
modules/doctor/authorizedkeys.go 14.81% <14.81%> (ø)
modules/doctor/misc.go 30.20% <30.20%> (ø)
modules/doctor/dbversion.go 42.85% <42.85%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 253add8...7aaeaee. Read the comment docs.

modules/doctor/misc.go Outdated Show resolved Hide resolved
@lunny
Copy link

@lunny lunny commented Oct 24, 2020

It's better to move all codes about logger to another PR and this one depends that one.

@zeripath
Copy link
Author

@zeripath zeripath commented Oct 24, 2020

Then we will need to merge those changes first.

The logger changes are entirely required for this to work

Refactor Logger to make a logger interface and make it possible to
wrap loggers for specific purposes.
zeripath added 2 commits Oct 24, 2020
    Move the gitea doctor functions into its own module.
    Use a logger for its messages instead of returning a results string[]

Signed-off-by: Andrew Thornton <[email protected]>
modules/doctor/misc.go Show resolved Hide resolved
@6543
Copy link

@6543 6543 commented Oct 24, 2020

@zeripath do this solve #12706?

@zeripath
Copy link
Author

@zeripath zeripath commented Oct 24, 2020

Probably it does solve it yes

@zeripath zeripath added this to the 1.14.0 milestone Oct 31, 2020
6543
6543 approved these changes Nov 5, 2020
@lafriks lafriks merged commit 4569339 into go-gitea:master Dec 2, 2020
2 checks passed
@zeripath zeripath deleted the refactor-doctor branch Dec 2, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Jan 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

7 participants