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

Rename db Engines related functions #17481

Merged
merged 5 commits into from
Oct 30, 2021

Conversation

lunny
Copy link
Member

@lunny lunny commented Oct 29, 2021

To make it not confusing, this PR renamed some functions related database Engine.

  • GetNewEngine -> NewEngine: this function will return a xorm.Engine as the first return parameter, so call it New is suitable.
  • SetEngine -> InitEngine: it will call the original GetNewEngine and assign engine to the db package variable x. So we call it Init.
  • NewEngine -> InitEngineWithMigration: the function will call SetEngine with some migration functions.
  • NewInstallTestEngine -> InitInstallEngineWithMigration: the function will call SetEngine with some test special statements.

@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Oct 29, 2021
@codecov-commenter
Copy link

codecov-commenter commented Oct 29, 2021

Codecov Report

Merging #17481 (b305ba2) into main (0b4a8be) will increase coverage by 0.00%.
The diff coverage is 19.23%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #17481   +/-   ##
=======================================
  Coverage   45.47%   45.47%           
=======================================
  Files         791      791           
  Lines       88697    88702    +5     
=======================================
+ Hits        40335    40339    +4     
+ Misses      41850    41845    -5     
- Partials     6512     6518    +6     
Impacted Files Coverage Δ
cmd/cmd.go 44.18% <0.00%> (ø)
cmd/doctor.go 0.00% <0.00%> (ø)
cmd/dump.go 0.91% <0.00%> (ø)
cmd/migrate.go 0.00% <0.00%> (ø)
cmd/migrate_storage.go 0.00% <0.00%> (ø)
modules/doctor/dbconsistency.go 6.83% <0.00%> (ø)
modules/doctor/dbversion.go 42.85% <0.00%> (ø)
modules/doctor/doctor.go 12.24% <0.00%> (ø)
routers/install/install.go 0.66% <0.00%> (ø)
routers/web/feed/convert.go 0.00% <0.00%> (ø)
... and 12 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 f5bb788...b305ba2. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 29, 2021
@wxiaoguang
Copy link
Contributor

I like the idea to make these function names clear.

models/db/engine.go Outdated Show resolved Hide resolved
@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 Oct 29, 2021
models/db/engine.go Show resolved Hide resolved
@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 Oct 29, 2021
@wxiaoguang wxiaoguang merged commit 63c0dc8 into go-gitea:main Oct 30, 2021
@lunny lunny deleted the lunny/rename_db_engines branch October 30, 2021 15:45
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
* Rename db Engines related functions

Co-authored-by: wxiaoguang <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. 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.

5 participants