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

Issue 367 #394

Merged
merged 1 commit into from
Oct 31, 2023
Merged

Issue 367 #394

merged 1 commit into from
Oct 31, 2023

Conversation

liweinan
Copy link
Contributor

No description provided.

@liweinan
Copy link
Contributor Author

Generally speaking, this allows the user to define the prop like:

db-user = ${DB_USER:default_user}
db-pass = ${DB_PASS:default_pass}

And the environment variables DB_USER and DB_PASS will be passed in.

If the default values are not exist, the prop should be defined like this:

db-user = ${DB_USER:}
db-user = ${DB_PASSWD:}

The colon should not be omitted because it simplify the regexp processing pattern and ensure the efficiency.

@chengfang Do you agree with this solution?

@chengfang
Copy link
Contributor

@liweinan we can limit the change to jberet-se classes like BatchSEEnvironment.java? Since this new feature will only be available for JBeret in Java SE. jberet-core classes like JdbcRepository should be able to remain intact.

mongodb job repository also uses db-user and db-password, so having these changes in BatchSEEnvironment.java will also cover mongo repository.

From a user's point of view, it is a bit surprise to be required to use : in the expression. This is not what users do the similar expression in other environment so if possible, I would keep it consistent with everywhere else by not requiring the :

@liweinan
Copy link
Contributor Author

@chengfang Okay! I'll do the modification accordingly.

@liweinan
Copy link
Contributor Author

@chengfang I have refactored the impl according to your suggestion, could you please help to review it again? Thanks!

@liweinan
Copy link
Contributor Author

@chengfang Thanks for the suggestion! I have updated the PR accordingly. Could you please help to to review it again? If it's okay I'll squash the commits.

@liweinan
Copy link
Contributor Author

@chengfang Thanks for the suggestions! Today is too late I'll finish updating this PR during the weekend :D

@liweinan
Copy link
Contributor Author

@chengfang I have finished updating this PR according to your review comments, could you please help to review it again? Thanks!

@liweinan liweinan self-assigned this Oct 29, 2023
@liweinan
Copy link
Contributor Author

Thanks for checking @chengfang I'll do the cleanup and merge this.

@liweinan liweinan merged commit b3c0969 into jberet:main Oct 31, 2023
2 checks passed
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.

Enable Support to get DB Username/Password from enivonment variable for jberet.properties
2 participants