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

Ensure schema on the new MySQL datastore before migrate #1813

Merged
merged 5 commits into from
Mar 31, 2021

Conversation

khanhtc1202
Copy link
Member

@khanhtc1202 khanhtc1202 commented Mar 31, 2021

What this PR does / why we need it:

  • Move the implementation of ops/mysqlensurer to datastore/mysql/ensurer as sub package of datastore/mysql
  • Call to datastore/mysql/ensurer package from ops and pipectl/datastore command

Which issue(s) this PR fixes:

Rel #1806

Does this PR introduce a user-facing change?:

NONE

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.86%. This pull request increases coverage by 0.01%.

File Function Base Head Diff
pkg/datastore/mysql/ensurer/client.go NewMySQLEnsurer -- 0.00% +0.00%
pkg/datastore/mysql/ensurer/client.go mysqlEnsurer.EnsureIndexes -- 0.00% +0.00%
pkg/datastore/mysql/ensurer/client.go mysqlEnsurer.EnsureSchema -- 0.00% +0.00%
pkg/datastore/mysql/ensurer/client.go mysqlEnsurer.Close -- 0.00% +0.00%
pkg/datastore/mysql/ensurer/client.go makeCreateIndexStatements -- 100.00% +100.00%
pkg/app/ops/mysqlensurer/client.go NewMySQLEnsurer 0.00% -- +-0.00%
pkg/app/ops/mysqlensurer/client.go mysqlEnsurer.EnsureIndexes 0.00% -- +-0.00%
pkg/app/ops/mysqlensurer/client.go mysqlEnsurer.EnsureSchema 0.00% -- +-0.00%
pkg/app/ops/mysqlensurer/client.go mysqlEnsurer.Close 0.00% -- +-0.00%
pkg/app/ops/mysqlensurer/client.go makeCreateIndexStatements 100.00% -- -100.00%

@nakabonne
Copy link
Member

👍
/lgtm

BUILD.bazel Outdated
@@ -66,6 +66,7 @@ genrule(
# gazelle:exclude pkg/model/project.pb.validate.go
# gazelle:exclude pkg/model/role.pb.validate.go
# gazelle:exclude pkg/model/user.pb.validate.go
# gazelle:exclude pkg/datastore/mysql/ensurer/sql.embed.go
# gazelle:exclude pkg/app/ops/mysqlensurer/sql.embed.go
Copy link
Member

Choose a reason for hiding this comment

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

This should be removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch 🙆‍♀️ addressed on 0acffcf

@pipecd-bot pipecd-bot removed the lgtm label Mar 31, 2021
@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.86%. This pull request increases coverage by 0.01%.

File Function Base Head Diff
pkg/datastore/mysql/ensurer/client.go NewMySQLEnsurer -- 0.00% +0.00%
pkg/datastore/mysql/ensurer/client.go mysqlEnsurer.EnsureIndexes -- 0.00% +0.00%
pkg/datastore/mysql/ensurer/client.go mysqlEnsurer.EnsureSchema -- 0.00% +0.00%
pkg/datastore/mysql/ensurer/client.go mysqlEnsurer.Close -- 0.00% +0.00%
pkg/datastore/mysql/ensurer/client.go makeCreateIndexStatements -- 100.00% +100.00%
pkg/app/ops/mysqlensurer/client.go NewMySQLEnsurer 0.00% -- +-0.00%
pkg/app/ops/mysqlensurer/client.go mysqlEnsurer.EnsureIndexes 0.00% -- +-0.00%
pkg/app/ops/mysqlensurer/client.go mysqlEnsurer.EnsureSchema 0.00% -- +-0.00%
pkg/app/ops/mysqlensurer/client.go mysqlEnsurer.Close 0.00% -- +-0.00%
pkg/app/ops/mysqlensurer/client.go makeCreateIndexStatements 100.00% -- -100.00%

@nghialv
Copy link
Member

nghialv commented Mar 31, 2021

Thank you.
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by nghialv.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

@pipecd-bot pipecd-bot merged commit 941a58a into master Mar 31, 2021
@pipecd-bot pipecd-bot deleted the mysql-ensurer-refactor branch March 31, 2021 10:17
@pipecd-bot pipecd-bot mentioned this pull request Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants