-
Notifications
You must be signed in to change notification settings - Fork 498
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
优化排包配置 #918
优化排包配置 #918
Conversation
# Conflicts: # sofa-ark-parent/core-impl/container/src/main/java/com/alipay/sofa/ark/container/model/BizModel.java
WalkthroughThe update focuses on optimizing the configuration of dependency exclusions in the SOFA Ark Maven plugin by introducing standardized methods through properties and YAML files. This aims to enhance consistency in configurations and resolve issues related to discrepancies in directory handling during setup and configuration parsing. Changes
Assessment against linked issues
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 ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #918 +/- ##
============================================
- Coverage 78.70% 78.59% -0.12%
- Complexity 836 850 +14
============================================
Files 164 167 +3
Lines 6796 6866 +70
Branches 1009 1016 +7
============================================
+ Hits 5349 5396 +47
- Misses 923 945 +22
- Partials 524 525 +1 ☔ 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.
Actionable comments posted: 0
Out of diff range and nitpick comments (2)
sofa-ark-parent/support/ark-maven-plugin/src/test/resources/baseDir/src/main/resources/ark.properties (1)
1-6
: Ensure the comments are translated to English to maintain consistency in codebase documentation.sofa-ark-parent/support/ark-maven-plugin/src/test/resources/baseDir/src/main/resources/ark.yml (1)
1-10
: Ensure the comments are translated to English to maintain consistency in codebase documentation.
|
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.
Actionable comments posted: 2
protected void extensionExcludeArtifactsFromProp() { | ||
String configPath = baseDir + File.separator + RESOURCES_DIR + File.separator | ||
+ ARK_PROPERTIES_FILE; | ||
File configFile = com.alipay.sofa.ark.common.util.FileUtils.file(configPath); | ||
if (!configFile.exists()) { | ||
getLog().info( | ||
String.format( | ||
"sofa-ark-maven-plugin: extension-config %s not found, will not config it", | ||
configPath)); | ||
return; | ||
} | ||
|
||
getLog().info( | ||
String.format("sofa-ark-maven-plugin: find extension-config %s and will config it", | ||
configPath)); | ||
|
||
Properties prop = new Properties(); | ||
try (FileInputStream fis = new FileInputStream(configPath)) { | ||
prop.load(fis); | ||
|
||
parseExcludeProp(excludes, prop, EXTENSION_EXCLUDES); | ||
parseExcludeProp(excludeGroupIds, prop, EXTENSION_EXCLUDES_GROUPIDS); | ||
parseExcludeProp(excludeArtifactIds, prop, EXTENSION_EXCLUDES_ARTIFACTIDS); | ||
} catch (IOException ex) { | ||
getLog().error( | ||
String.format("failed to parse excludes artifacts from %s.", configPath), ex); | ||
} | ||
} |
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.
Method extensionExcludeArtifactsFromProp
effectively handles properties file for artifact exclusion. Consider adding a debug log before returning when the config file does not exist for better traceability.
652a653
> getLog().debug("Config file does not exist: " + configPath);
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
protected void extensionExcludeArtifactsFromProp() { | |
String configPath = baseDir + File.separator + RESOURCES_DIR + File.separator | |
+ ARK_PROPERTIES_FILE; | |
File configFile = com.alipay.sofa.ark.common.util.FileUtils.file(configPath); | |
if (!configFile.exists()) { | |
getLog().info( | |
String.format( | |
"sofa-ark-maven-plugin: extension-config %s not found, will not config it", | |
configPath)); | |
return; | |
} | |
getLog().info( | |
String.format("sofa-ark-maven-plugin: find extension-config %s and will config it", | |
configPath)); | |
Properties prop = new Properties(); | |
try (FileInputStream fis = new FileInputStream(configPath)) { | |
prop.load(fis); | |
parseExcludeProp(excludes, prop, EXTENSION_EXCLUDES); | |
parseExcludeProp(excludeGroupIds, prop, EXTENSION_EXCLUDES_GROUPIDS); | |
parseExcludeProp(excludeArtifactIds, prop, EXTENSION_EXCLUDES_ARTIFACTIDS); | |
} catch (IOException ex) { | |
getLog().error( | |
String.format("failed to parse excludes artifacts from %s.", configPath), ex); | |
} | |
} | |
protected void extensionExcludeArtifactsFromProp() { | |
String configPath = baseDir + File.separator + RESOURCES_DIR + File.separator | |
+ ARK_PROPERTIES_FILE; | |
File configFile = com.alipay.sofa.ark.common.util.FileUtils.file(configPath); | |
if (!configFile.exists()) { | |
getLog().info( | |
String.format( | |
"sofa-ark-maven-plugin: extension-config %s not found, will not config it", | |
configPath)); | |
getLog().debug("Config file does not exist: " + configPath); | |
return; | |
} | |
getLog().info( | |
String.format("sofa-ark-maven-plugin: find extension-config %s and will config it", | |
configPath)); | |
Properties prop = new Properties(); | |
try (FileInputStream fis = new FileInputStream(configPath)) { | |
prop.load(fis); | |
parseExcludeProp(excludes, prop, EXTENSION_EXCLUDES); | |
parseExcludeProp(excludeGroupIds, prop, EXTENSION_EXCLUDES_GROUPIDS); | |
parseExcludeProp(excludeArtifactIds, prop, EXTENSION_EXCLUDES_ARTIFACTIDS); | |
} catch (IOException ex) { | |
getLog().error( | |
String.format("failed to parse excludes artifacts from %s.", configPath), ex); | |
} | |
} |
protected void extensionExcludeArtifactsFromYaml() { | ||
String configPath = baseDir + File.separator + RESOURCES_DIR + File.separator | ||
+ ARK_YML_FILE; | ||
File configFile = com.alipay.sofa.ark.common.util.FileUtils.file(configPath); | ||
if (!configFile.exists()) { | ||
getLog().info( | ||
String.format( | ||
"sofa-ark-maven-plugin: extension-config %s not found, will not config it", | ||
configPath)); | ||
return; | ||
} | ||
|
||
getLog().info( | ||
String.format("sofa-ark-maven-plugin: find extension-config %s and will config it", | ||
configPath)); | ||
|
||
try (FileInputStream fis = new FileInputStream(configPath)) { | ||
Yaml yaml = new Yaml(); | ||
Map<String, List<String>> parsedYaml = yaml.load(fis); | ||
parseExcludeYaml(excludes, parsedYaml, EXTENSION_EXCLUDES); | ||
parseExcludeYaml(excludeGroupIds, parsedYaml, EXTENSION_EXCLUDES_GROUPIDS); | ||
parseExcludeYaml(excludeArtifactIds, parsedYaml, EXTENSION_EXCLUDES_ARTIFACTIDS); | ||
|
||
} catch (IOException ex) { | ||
getLog().error( | ||
String.format("failed to parse excludes artifacts from %s.", configPath), ex); | ||
} | ||
} |
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.
Method extensionExcludeArtifactsFromYaml
is well-implemented for parsing YAML configurations. Similar to the previous method, consider adding a debug log for missing config files.
681a682
> getLog().debug("Config file does not exist: " + configPath);
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
protected void extensionExcludeArtifactsFromYaml() { | |
String configPath = baseDir + File.separator + RESOURCES_DIR + File.separator | |
+ ARK_YML_FILE; | |
File configFile = com.alipay.sofa.ark.common.util.FileUtils.file(configPath); | |
if (!configFile.exists()) { | |
getLog().info( | |
String.format( | |
"sofa-ark-maven-plugin: extension-config %s not found, will not config it", | |
configPath)); | |
return; | |
} | |
getLog().info( | |
String.format("sofa-ark-maven-plugin: find extension-config %s and will config it", | |
configPath)); | |
try (FileInputStream fis = new FileInputStream(configPath)) { | |
Yaml yaml = new Yaml(); | |
Map<String, List<String>> parsedYaml = yaml.load(fis); | |
parseExcludeYaml(excludes, parsedYaml, EXTENSION_EXCLUDES); | |
parseExcludeYaml(excludeGroupIds, parsedYaml, EXTENSION_EXCLUDES_GROUPIDS); | |
parseExcludeYaml(excludeArtifactIds, parsedYaml, EXTENSION_EXCLUDES_ARTIFACTIDS); | |
} catch (IOException ex) { | |
getLog().error( | |
String.format("failed to parse excludes artifacts from %s.", configPath), ex); | |
} | |
} | |
protected void extensionExcludeArtifactsFromYaml() { | |
String configPath = baseDir + File.separator + RESOURCES_DIR + File.separator | |
+ ARK_YML_FILE; | |
File configFile = com.alipay.sofa.ark.common.util.FileUtils.file(configPath); | |
if (!configFile.exists()) { | |
getLog().info( | |
String.format( | |
"sofa-ark-maven-plugin: extension-config %s not found, will not config it", | |
configPath)); | |
getLog().debug("Config file does not exist: " + configPath); | |
return; | |
} | |
getLog().info( | |
String.format("sofa-ark-maven-plugin: find extension-config %s and will config it", | |
configPath)); | |
try (FileInputStream fis = new FileInputStream(configPath)) { | |
Yaml yaml = new Yaml(); | |
Map<String, List<String>> parsedYaml = yaml.load(fis); | |
parseExcludeYaml(excludes, parsedYaml, EXTENSION_EXCLUDES); | |
parseExcludeYaml(excludeGroupIds, parsedYaml, EXTENSION_EXCLUDES_GROUPIDS); | |
parseExcludeYaml(excludeArtifactIds, parsedYaml, EXTENSION_EXCLUDES_ARTIFACTIDS); | |
} catch (IOException ex) { | |
getLog().error( | |
String.format("failed to parse excludes artifacts from %s.", configPath), ex); | |
} | |
} |
+ ARK_PROPERTIES_FILE; | ||
File configFile = com.alipay.sofa.ark.common.util.FileUtils.file(configPath); | ||
if (!configFile.exists()) { | ||
getLog().info( |
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.
warn 级别
+ ARK_YML_FILE; | ||
File configFile = com.alipay.sofa.ark.common.util.FileUtils.file(configPath); | ||
if (!configFile.exists()) { | ||
getLog().info( |
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.
warn 级别
Others LGTM |
* 优化排包配置 (#918) * 优化显示 * fix as bizStateRecords * 更新显示 * 优化自动排包配置 * 更新排包描述 --------- Co-authored-by: leo james <leojames.googol@gmail.com> (cherry picked from commit 5a13e01) * runtime中静态合并部署时多模块并行执行createTempDir时异常 (#911) Co-authored-by: jiyunfei <jiyunfei@come-future.com> Co-authored-by: leo james <leojames.googol@gmail.com> (cherry picked from commit 67a0bdf) * add string contains (#926) (cherry picked from commit 07009d7) * fix ReactiveWebServerFactoryAutoConfiguration not support sprintboot 1.x (#927) (cherry picked from commit 41d3cda) * add biz jar url in biz module (#928) (cherry picked from commit e1f5872) * update netty version (#931) * update netty version * fix version netty --------- Co-authored-by: tangjiafu <tangjiafu@kuaishou.com> Co-authored-by: leojames <leojames.googol@gmail.com> (cherry picked from commit fb233cf) * update version to 3.0.6-SNAPSHOT --------- Co-authored-by: Lipeng <44571204+gaosaroma@users.noreply.github.com> Co-authored-by: FFF <31267018+1034323716@users.noreply.github.com> Co-authored-by: Laglangyue <35491928+laglangyue@users.noreply.github.com>
* 优化排包配置 (#918) * 优化显示 * fix as bizStateRecords * 更新显示 * 优化自动排包配置 * 更新排包描述 --------- Co-authored-by: leo james <leojames.googol@gmail.com> (cherry picked from commit 5a13e01) * runtime中静态合并部署时多模块并行执行createTempDir时异常 (#911) Co-authored-by: jiyunfei <jiyunfei@come-future.com> Co-authored-by: leo james <leojames.googol@gmail.com> (cherry picked from commit 67a0bdf) * add string contains (#926) (cherry picked from commit 07009d7) * fix ReactiveWebServerFactoryAutoConfiguration not support sprintboot 1.x (#927) (cherry picked from commit 41d3cda) * add biz jar url in biz module (#928) (cherry picked from commit e1f5872) * update netty version (#931) * update netty version * fix version netty --------- Co-authored-by: tangjiafu <tangjiafu@kuaishou.com> Co-authored-by: leojames <leojames.googol@gmail.com> (cherry picked from commit fb233cf) * update version to 3.1.4-SNAPSHOT * fix multi ark boot runner test --------- Co-authored-by: Lipeng <44571204+gaosaroma@users.noreply.github.com> Co-authored-by: FFF <31267018+1034323716@users.noreply.github.com> Co-authored-by: Laglangyue <35491928+laglangyue@users.noreply.github.com>
Motivation
优化排包配置
Modification
Describe the idea and modifications you've done.
Result
fix koupleless/koupleless#117
Summary by CodeRabbit
New Features
Enhancements
Bug Fixes
Tests