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

[Multi-Database Support][h2] Support run on h2 #4851

Merged
merged 4 commits into from
May 6, 2023

Conversation

shoothzj
Copy link
Member

@shoothzj shoothzj commented Apr 19, 2023

What's the purpose of this PR

Added support for h2 init sql to ApolloConfig. Verified the following functionalities: adding/disabling/enabling users, adding/deleting namespaces, publishing configurations, and adding applications.

Brief changelog

Add h2 init sql, only effective when h2

How to use it

apollo-config run args

-Dapollo_profile=github,database-discovery
-Dspring.profiles.group.github=h2
-Dspring.datasource.url=jdbc:h2:mem:testdb;mode=mysql;DATABASE_TO_UPPER=FALSE;BUILTIN_ALIAS_OVERRIDE=TRUE;
-Dspring.datasource.username=sa
-Dspring.datasource.password=

apollo-portal run args

-Dapollo_profile=github,auth
-Dspring.profiles.group.github=h2
-Dspring.datasource.url=jdbc:h2:mem:testdb;mode=mysql;DATABASE_TO_UPPER=FALSE;BUILTIN_ALIAS_OVERRIDE=TRUE;
-Dspring.datasource.username=sa
-Dspring.datasource.password=
-Ddev_meta=http://localhost:8080/

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Read the Contributing Guide before making this pull request.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit tests to verify the code.
  • Run mvn clean test to make sure this pull request doesn't break anything.
  • Update the CHANGES log.

Copy link
Member

Hello, I am a serverless review bot on flows.network. Here are my reviews of code commits in this PR.


Commit 1

This patch adds support for the h2 database to Apollo. It does this by adding an h2 initialization script, an annotation for running the script and a datasource field. The h2 initialization script makes changes to the ServerConfig table by adding a new row. There are no apparent potential problems with this patch.

@nobodyiam
Copy link
Member

review again

Copy link
Member

nobodyiam commented May 5, 2023

Hello, I am a code review bot on flows.network. Here are my reviews of code commits in this PR.


@codecov
Copy link

codecov bot commented May 5, 2023

Codecov Report

Merging #4851 (e05aaa4) into master (a4df1a3) will increase coverage by 0.09%.
The diff coverage is 42.85%.

@@             Coverage Diff              @@
##             master    #4851      +/-   ##
============================================
+ Coverage     48.36%   48.46%   +0.09%     
- Complexity     1722     1725       +3     
============================================
  Files           346      346              
  Lines         10827    10835       +8     
  Branches       1078     1080       +2     
============================================
+ Hits           5237     5251      +14     
+ Misses         5268     5260       -8     
- Partials        322      324       +2     
Impacted Files Coverage Δ
...mework/apollo/biz/service/BizDBPropertySource.java 80.00% <42.85%> (-0.56%) ⬇️
.../apollo/portal/service/PortalDBPropertySource.java 39.13% <42.85%> (+7.55%) ⬆️

... and 4 files with indirect coverage changes

Copy link
Member

@nobodyiam nobodyiam left a comment

Choose a reason for hiding this comment

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

LGTM

@nobodyiam nobodyiam merged commit 4f4a8f7 into apolloconfig:master May 6, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 6, 2023
@shoothzj shoothzj deleted the h2-init-sql-try2 branch May 6, 2023 00:55
@apolloconfig apolloconfig unlocked this conversation May 6, 2023
@apolloconfig apolloconfig locked as resolved and limited conversation to collaborators May 15, 2023
@apolloconfig apolloconfig deleted a comment May 19, 2023
@apolloconfig apolloconfig deleted a comment May 19, 2023
@apolloconfig apolloconfig deleted a comment May 19, 2023
@apolloconfig apolloconfig deleted a comment May 19, 2023
@apolloconfig apolloconfig deleted a comment May 19, 2023
@apolloconfig apolloconfig deleted a comment May 19, 2023
@apolloconfig apolloconfig deleted a comment May 19, 2023
@nobodyiam nobodyiam added this to the 2.2.0 milestone Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants