-
Notifications
You must be signed in to change notification settings - Fork 485
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 envs for biz starter #885
Conversation
WalkthroughThe recent updates introduce enhanced flexibility by incorporating environment variables into the execution and startup processes. This is achieved through modifications across various components, including the addition of new methods and parameters that allow passing and utilizing environment variables alongside traditional arguments. This holistic change aims to offer more dynamic and context-aware execution capabilities. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #885 +/- ##
============================================
+ Coverage 78.76% 78.84% +0.07%
Complexity 831 831
============================================
Files 162 162
Lines 6767 6777 +10
Branches 1006 1007 +1
============================================
+ Hits 5330 5343 +13
+ Misses 917 911 -6
- Partials 520 523 +3 ☔ View full report in Codecov by Sentry. |
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (6)
- sofa-ark-parent/core-impl/archive/src/main/java/com/alipay/sofa/ark/bootstrap/AbstractLauncher.java (2 hunks)
- sofa-ark-parent/core-impl/archive/src/main/java/com/alipay/sofa/ark/bootstrap/MainMethodRunner.java (2 hunks)
- sofa-ark-parent/core-impl/archive/src/test/java/com/alipay/sofa/ark/bootstrap/MainMethodRunnerTest.java (2 hunks)
- sofa-ark-parent/core-impl/container/src/main/java/com/alipay/sofa/ark/container/model/BizModel.java (2 hunks)
- sofa-ark-parent/core/api/src/main/java/com/alipay/sofa/ark/api/ArkClient.java (4 hunks)
- sofa-ark-parent/core/spi/src/main/java/com/alipay/sofa/ark/spi/model/Biz.java (3 hunks)
Additional comments: 11
sofa-ark-parent/core-impl/archive/src/test/java/com/alipay/sofa/ark/bootstrap/MainMethodRunnerTest.java (1)
- 39-39: The addition of a
null
parameter in theMainMethodRunner
constructor call within thetestRunner
method aligns with the updated constructor signature to support environment variables. Please ensure the test still effectively validatesMainMethodRunner
functionality, including the handling ofnull
environment variables.sofa-ark-parent/core/spi/src/main/java/com/alipay/sofa/ark/spi/model/Biz.java (1)
- 38-44: The addition of the
start(String[] args, Map<String, String> envs)
method to theBiz
interface is a crucial step towards supporting environment variables in business application startups. Please consider enhancing the method's documentation to clarify the expected behavior whenenvs
isnull
or empty.sofa-ark-parent/core-impl/archive/src/main/java/com/alipay/sofa/ark/bootstrap/MainMethodRunner.java (3)
- 20-21: The addition of imports for
HashMap
andMap
is necessary for supporting environment variables. Good job on keeping the imports organized.- 36-46: The introduction of the
envs
field and its initialization in the constructor are well-implemented. Initializingenvs
with an emptyHashMap
if it'snull
is a good practice to avoid potentialNullPointerException
.- 54-54: The comment about adding
envs
into the tenant of JDK in therun
method indicates future work is needed to utilizeenvs
. Please ensure this implementation is completed to fully support environment variables.sofa-ark-parent/core-impl/archive/src/main/java/com/alipay/sofa/ark/bootstrap/AbstractLauncher.java (2)
- 112-112: The addition of a
null
parameter in thecreateMainMethodRunner
method's constructor call toMainMethodRunner
aligns with the updated constructor to support environment variables. This change is necessary for compatibility.- 172-172: The addition of a newline in the
getMainClass
method is a minor formatting change and does not impact functionality.sofa-ark-parent/core/api/src/main/java/com/alipay/sofa/ark/api/ArkClient.java (3)
- 64-68: The introduction of a static
envs
field to store environment variables is a significant change. Consider the implications for thread safety and potential side effects across different parts of the application. It might be beneficial to review the usage pattern of these environment variables to ensure they are managed safely.- 146-152: The addition of
getEnvs()
andsetEnvs(Map<String, String> envs)
methods provides a structured way to access and modify environment variables. Ensure that the usage of these methods is consistent and thread-safe across the application.- 161-174: The modifications to the
installBiz()
method and the introduction of thedoInstallBiz()
method to support environment variables are well-implemented. These changes enhance the flexibility of business application installations. Ensure that the handling of environment variables in these methods is thoroughly tested, especially with regards to null or empty values.sofa-ark-parent/core-impl/container/src/main/java/com/alipay/sofa/ark/container/model/BizModel.java (1)
- 275-281: The addition of the
start(String[] args, Map<String, String> envs)
method and the modification of the existingstart(String[] args)
method to delegate todoStart(String[] args, Map<String, String> envs)
are well-implemented. These changes align with the objective of supporting environment variables. Please ensure thatnull
or emptyenvs
values are correctly handled in these methods.
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.
LGTM
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- sofa-ark-parent/core-impl/container/src/main/java/com/alipay/sofa/ark/container/model/BizModel.java (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- sofa-ark-parent/core-impl/container/src/main/java/com/alipay/sofa/ark/container/model/BizModel.java
* no export apache for web and netty ark plugin * no lib in ark plugin * parse artifact id with accuracy first * fix test error * add start class in manifest * fix test * remove unused field * add envs for biz start (cherry picked from commit 12d4da4)
* netty support 0.9.x (#843) * modify test for zip fill to support jdk9+ * fix export import config * support multi sdk * format test * support netty 0.9 (cherry picked from commit 92daff0) * Update README.md (#846) (cherry picked from commit 815ea32) * support multi sdk (cherry picked from commit 5f7fe98) * format test (cherry picked from commit 0f8c409) * using 0.9 netty (cherry picked from commit 233f6d7) * no lib for netty ark plugin (cherry picked from commit 68c3509) * set scope = provided for netty (cherry picked from commit 957f714) * fix test error "No Ark Container Jar File Found" (cherry picked from commit e6bfade) * fix test error (#854) (cherry picked from commit 917941c) * fix test error (#855) * fix test error * just warn for stop tomcat * fix test error (cherry picked from commit c8c384c) * fix test error (#856) (cherry picked from commit a77b061) * update guava version to aviod guava cache pin problem (#853) * update guava version * update guava version in container jar * remove file --------- Co-authored-by: leo james <leojames.googol@gmail.com> (cherry picked from commit 51ba5e0) * update version * no maven tree when single bundle * update version * Update README.md (#869) (cherry picked from commit 5971b2a) * add log for file not found (cherry picked from commit 0d7ca0c) * simplify artifact id parser (cherry picked from commit 1969cdb) * Update sofa-ark-parent/core-impl/archive/src/test/java/com/alipay/sofa/ark/loader/test/jar/JarUtilsTest.java Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> (cherry picked from commit 8134069) * fix ark plugin (#877) * no export apache for web and netty ark plugin * no lib in ark plugin (cherry picked from commit af25776) * parse artifact id with accuracy first (#878) * no export apache for web and netty ark plugin * no lib in ark plugin * parse artifact id with accuracy first * fix test error (cherry picked from commit e6ab184) * add start class in manifest (#883) * no export apache for web and netty ark plugin * no lib in ark plugin * parse artifact id with accuracy first * fix test error * add start class in manifest * fix test * remove unused field (cherry picked from commit e74c7ea) * <feature> add bizFailedEvent (#881) * <feature> add bizFailedEvent * format * add notes * rename BizFailedEvent to AfterBizFailedEvent * refactor --------- Co-authored-by: leo james <leojames.googol@gmail.com> (cherry picked from commit 1a30e63) * add envs for biz starter (#885) * no export apache for web and netty ark plugin * no lib in ark plugin * parse artifact id with accuracy first * fix test error * add start class in manifest * fix test * remove unused field * add envs for biz start (cherry picked from commit 12d4da4) * add envs for install operation (#887) * add envs for install operation * fix format * fix potential resource leaks when install biz (cherry picked from commit 24bd60d) * set args as empty array when args = null for startup (#888) * add envs for install operation * fix format * fix potential resource leaks when install biz * fix null args throw exception for springboot (cherry picked from commit e4adbcb) * add bizStateChangeLog (#889) * add more info for biz.toString() * format * format * update bizinfo * format * rename to bizStateRecord * format (cherry picked from commit 6659991) * 1、增加zookeeper注册节点环境变量,新增配置参数com.alipay.sofa.ark.config.env。默认为sofa-ark (#890) * 1、增加zookeeper注册节点环境变量,新增配置参数com.alipay.sofa.ark.config.env。默认为sofa-ark 2、升级curator版本,重构NodeCache已过时 * 1、增加zookeeper注册节点环境变量,新增配置参数com.alipay.sofa.ark.config.env。默认为sofa-ark 2、升级curator版本,重构NodeCache已过时 --------- Co-authored-by: leo james <leojames.googol@gmail.com> (cherry picked from commit 5395cbf) * fix no ark log in ark container (#891) * update logback in ark container * fix ark container log (cherry picked from commit 75fa690) * update biz state record name (#892) * update logback in ark container * fix ark container log * modify biz state record name (cherry picked from commit 6412923) * rename typo (#893) * update logback in ark container * fix ark container log * modify biz state record name * format code (cherry picked from commit 6602b96) * update version * code format * remove springboot 1.x 2.x adapter --------- Co-authored-by: g-stream <ylchen.changshu@gmail.com> Co-authored-by: Lipeng <44571204+gaosaroma@users.noreply.github.com> Co-authored-by: hadoop835 <chenjian835@163.com>
* no export apache for web and netty ark plugin * no lib in ark plugin * parse artifact id with accuracy first * fix test error * add start class in manifest * fix test * remove unused field * add envs for biz start (cherry picked from commit 12d4da4)
* Update README.md (#869) (cherry picked from commit 5971b2a) * add log for file not found (cherry picked from commit 0d7ca0c) * simplify artifact id parser (cherry picked from commit 1969cdb) * Update sofa-ark-parent/core-impl/archive/src/test/java/com/alipay/sofa/ark/loader/test/jar/JarUtilsTest.java Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> (cherry picked from commit 8134069) * fix ark plugin (#877) * no export apache for web and netty ark plugin * no lib in ark plugin (cherry picked from commit af25776) * parse artifact id with accuracy first (#878) * no export apache for web and netty ark plugin * no lib in ark plugin * parse artifact id with accuracy first * fix test error (cherry picked from commit e6ab184) * add start class in manifest (#883) * no export apache for web and netty ark plugin * no lib in ark plugin * parse artifact id with accuracy first * fix test error * add start class in manifest * fix test * remove unused field (cherry picked from commit e74c7ea) * <feature> add bizFailedEvent (#881) * <feature> add bizFailedEvent * format * add notes * rename BizFailedEvent to AfterBizFailedEvent * refactor --------- Co-authored-by: leo james <leojames.googol@gmail.com> (cherry picked from commit 1a30e63) * add envs for biz starter (#885) * no export apache for web and netty ark plugin * no lib in ark plugin * parse artifact id with accuracy first * fix test error * add start class in manifest * fix test * remove unused field * add envs for biz start (cherry picked from commit 12d4da4) * add envs for install operation (#887) * add envs for install operation * fix format * fix potential resource leaks when install biz (cherry picked from commit 24bd60d) * set args as empty array when args = null for startup (#888) * add envs for install operation * fix format * fix potential resource leaks when install biz * fix null args throw exception for springboot (cherry picked from commit e4adbcb) * add bizStateChangeLog (#889) * add more info for biz.toString() * format * format * update bizinfo * format * rename to bizStateRecord * format (cherry picked from commit 6659991) * 1、增加zookeeper注册节点环境变量,新增配置参数com.alipay.sofa.ark.config.env。默认为sofa-ark (#890) * 1、增加zookeeper注册节点环境变量,新增配置参数com.alipay.sofa.ark.config.env。默认为sofa-ark 2、升级curator版本,重构NodeCache已过时 * 1、增加zookeeper注册节点环境变量,新增配置参数com.alipay.sofa.ark.config.env。默认为sofa-ark 2、升级curator版本,重构NodeCache已过时 --------- Co-authored-by: leo james <leojames.googol@gmail.com> (cherry picked from commit 5395cbf) * fix no ark log in ark container (#891) * update logback in ark container * fix ark container log (cherry picked from commit 75fa690) * update biz state record name (#892) * update logback in ark container * fix ark container log * modify biz state record name (cherry picked from commit 6412923) * rename typo (#893) * update logback in ark container * fix ark container log * modify biz state record name * format code (cherry picked from commit 6602b96) * code format * remove springboot 1.x 2.x adapter * update version --------- Co-authored-by: Lipeng <44571204+gaosaroma@users.noreply.github.com> Co-authored-by: hadoop835 <chenjian835@163.com>
模块启动时增加 envs 参数,这个在 jdk 多租户里能用上
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Refactor