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

Feat: Add support for OpenGauss and Postgres database types #865

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

lgj101
Copy link
Contributor

@lgj101 lgj101 commented Jul 28, 2023

Description of your changes

Add support for OpenGauss database types

Fixes #

I have:

  • Read and followed KubeVela's contribution process.
  • Related Docs updated properly. In a new feature or configuration option, an update to the documentation is necessary.
  • Run yarn lint to ensure the frontend changes are ready for review.
  • Run make reviewableto ensure the server changes are ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

Copy link
Member

@chivalryq chivalryq left a comment

Choose a reason for hiding this comment

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

Thanks for contributing. Please fix the CI.

@@ -31,6 +32,7 @@ import (
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
mysqlgorm "gorm.io/driver/mysql"
opengaussgorm "gorm.io/driver/postgres"
Copy link
Member

Choose a reason for hiding this comment

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

Postgres will be later supported. I think we should leave the import alias as postgresgorm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok let me modify it

go.mod Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jul 31, 2023

Codecov Report

Patch coverage has no change and project coverage change: -11.25% ⚠️

Comparison is base (d0b2a3b) 58.94% compared to head (5fd4c1d) 47.69%.

❗ Current head 5fd4c1d differs from pull request most recent head b35a087. Consider uploading reports for the commit b35a087 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #865       +/-   ##
===========================================
- Coverage   58.94%   47.69%   -11.25%     
===========================================
  Files         114      115        +1     
  Lines       19801    20032      +231     
===========================================
- Hits        11671     9554     -2117     
- Misses       6694     9229     +2535     
+ Partials     1436     1249      -187     
Flag Coverage Δ
apiserver-unittests ?
server-e2e-tests 47.69% <0.00%> (-0.63%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
pkg/server/config/config.go 0.00% <0.00%> (ø)
...rver/infrastructure/datastore/postgres/postgres.go 0.00% <0.00%> (ø)
pkg/server/server.go 53.73% <0.00%> (-0.82%) ⬇️

... and 43 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lgj101 lgj101 force-pushed the main branch 11 times, most recently from 8fbe67d to 4363e88 Compare August 1, 2023 05:44
@lgj101 lgj101 force-pushed the main branch 2 times, most recently from 4b3c8f8 to 52ccd88 Compare August 1, 2023 08:20
@NeerajGartia21
Copy link
Collaborator

NeerajGartia21 commented Aug 1, 2023

Thanks for your contribution @lgj101 . This PR looks good to me !!
Since the whole implementation of OpenGauss and PostgreSQL are almost similar, I think it is better if we name the driver as PostgreSQL and in the Documentation we can add a note about using OpenGauss as PostgreSQL driver.

CC: @chivalryq

@@ -72,6 +72,16 @@ jobs:
mysql database: 'kubevela'
mysql root password: 'kubevelaSQL123'

- name: Set up OpenGauss
uses: lgj101/opengauss-action@v1.6
Copy link
Member

Choose a reason for hiding this comment

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

Is this really setup a OpenGauss DB? I checked Harmon758/postgresql-action@master...lgj101:opengauss-action:master and it seems to change the exposed variable only. If this is only changes I think we can just uses the origin action and implement the Postgres driver.

After all if we setup a Postgres here we can only checked the compatibility with Postgres. We can't say VelaUX "supports OpenGauss" because we don't have test.

However if we implement the Postgres driver and we can add notes in document that because OpenGauss is compatible with Postgres, you can also use OpenGauss.

Copy link
Member

Choose a reason for hiding this comment

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

I'm sorry, yes this action setup a opengauss db. Given the popularity of postgres and the compatibility between them, we can just rename the driver/opengauss to driver/postgresql and keep the openguass test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I have already made the modifications like this

Signed-off-by: ligjn <lgj112113@163.com>

delete comment

Signed-off-by: ligjn <lgj112113@163.com>

bug fix

Signed-off-by: ligjn <lgj112113@163.com>

modify package name

Signed-off-by: ligjn <lgj112113@163.com>

modify package name

Signed-off-by: ligjn <lgj112113@163.com>

opengauss ci setup

Signed-off-by: ligjn <lgj112113@163.com>

edit ci

Signed-off-by: ligjn <lgj112113@163.com>

edit ci

Signed-off-by: ligjn <lgj112113@163.com>

edit ci

Signed-off-by: ligjn <lgj112113@163.com>

edit ci

Signed-off-by: ligjn <lgj112113@163.com>

edit ci

Signed-off-by: ligjn <lgj112113@163.com>

edit ci

Signed-off-by: ligjn <lgj112113@163.com>

edit ci

Signed-off-by: ligjn <lgj112113@163.com>

edit ci

Signed-off-by: ligjn <lgj112113@163.com>

edit ci

Signed-off-by: ligjn <lgj112113@163.com>

edit ci

Signed-off-by: ligjn <lgj112113@163.com>

edit ci

Signed-off-by: ligjn <lgj112113@163.com>

edit log level

Signed-off-by: ligjn <lgj112113@163.com>

change opengauss to postgres

Signed-off-by: ligjn <lgj112113@163.com>

edit ci

change opengauss to postgres
Copy link
Member

@chivalryq chivalryq left a comment

Choose a reason for hiding this comment

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

LGTM

@chivalryq chivalryq merged commit 27b45c2 into kubevela:main Aug 1, 2023
13 of 15 checks passed
@chivalryq chivalryq changed the title Feat: Add support for OpenGauss database types Feat: Add support for OpenGauss and Postgres database types Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants