-
Notifications
You must be signed in to change notification settings - Fork 409
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
Add MySQL into the build system #3736
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3736 +/- ##
==========================================
- Coverage 76.43% 76.25% -0.18%
==========================================
Files 323 325 +2
Lines 23069 23112 +43
==========================================
- Hits 17632 17624 -8
- Misses 4396 4447 +51
Partials 1041 1041
... and 7 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. |
Taskfile.yml
Outdated
@@ -18,7 +18,7 @@ vars: | |||
TESTJS_PORT: 27017 | |||
RACE_FLAG: -race={{and (ne OS "windows") (ne ARCH "arm") (ne ARCH "riscv64")}} | |||
BUILD_TAGS: ferretdb_debug,ferretdb_hana | |||
SERVICES: postgres postgres_secured mongodb mongodb_secured jaeger | |||
SERVICES: postgres postgres_secured mongodb mongodb_secured jaeger mysql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SERVICES: postgres postgres_secured mongodb mongodb_secured jaeger mysql | |
SERVICES: postgres postgres_secured mysql mongodb mongodb_secured jaeger |
build/deps/mysql.Dockerfile
Outdated
@@ -0,0 +1 @@ | |||
FROM mysql:8.2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a line break there
build/mysql-init.sql
Outdated
@@ -0,0 +1,2 @@ | |||
-- grant super user privileges | |||
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do that in the envtool's setup
cmd/ferretdb/main.go
Outdated
// | ||
// See main_mysql.go. | ||
var mySQLFlags struct { | ||
MySQLURL string `name:"mysql-url" default:"127.0.0.1:3306/ferretdb" help:"MySQL URL for 'mysql' handler"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add hidden:""
for now.
Also, let's use mysql://
scheme for consistency with other backends
acad6b3
to
9e54f88
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there!
cmd/envtool/envtool.go
Outdated
setupMongodb, | ||
setupMongodbSecured, | ||
setupMySQL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setupMongodb, | |
setupMongodbSecured, | |
setupMySQL, | |
setupMySQL, | |
setupMongodb, | |
setupMongodbSecured, |
To keep the same general order
cmd/envtool/envtool.go
Outdated
return err | ||
} | ||
|
||
eval := "mysql -u root -ppassword -e \"GRANT ALL PRIVILEGES ON *.* TO 'username'@'%';\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's okay for now, but we should use the backend code once we have it.
Let's add a comment for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean that we should use the backend code for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should do a thing similar to setupAnyPostgres
by using internal/backends/mysql/...
package there instead of docker compose exec
. But that's not possible now. So I think we should add a comment about that future change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh okay. Got it
Setup MySQL build tooling
Readiness checklist
task all
, and it passed.@FerretDB/core
), Milestone (Next
), Labels, Project and project's Sprint fields.