-
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
support cutomize outputFile when ark maven #920
Conversation
WalkthroughThis update features enhancements to unit testing workflows and a Java plugin. The GitHub Actions workflows for Linux and Windows have been updated to utilize a newer version of the Codecov action. Additionally, the Java component related to the SOFA Ark project has improved handling of output files, introducing a more flexible approach based on user-defined properties. 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 (
|
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: 1
String outputPath = baseDir.getAbsolutePath() + "/deps.log." + System.currentTimeMillis(); | ||
List<String> goals = Stream.of("dependency:tree", "-DappendOutput=true", "-DoutputFile=\"" + outputPath + "\"").collect(Collectors.toList()); | ||
if (userProperties != null) { | ||
userProperties.forEach((key, value) -> goals.add(String.format("-D%s=%s", key, value))); | ||
if (userProperties.containsKey("outputFile")) { | ||
goals.removeIf(s -> s.startsWith("-DoutputFile")); | ||
outputPath = userProperties.getProperty("outputFile") + "." + System.currentTimeMillis(); | ||
goals.add(String.format("-DoutputFile=\"%s\"", outputPath)); | ||
} | ||
userProperties.forEach((key, value) -> { | ||
if (key instanceof String && StringUtils.equals("outputFile", (String) key)) { | ||
return; | ||
} | ||
goals.add(String.format("-D%s=%s", key, value)); | ||
}); |
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.
Refactor the handling of outputFile
user property to avoid unnecessary code execution.
- userProperties.forEach((key, value) -> {
- if (key instanceof String && StringUtils.equals("outputFile", (String) key)) {
- return;
- }
- goals.add(String.format("-D%s=%s", key, value));
- });
+ userProperties.forEach((key, value) -> goals.add(String.format("-D%s=%s", key, value)));
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.
String outputPath = baseDir.getAbsolutePath() + "/deps.log." + System.currentTimeMillis(); | |
List<String> goals = Stream.of("dependency:tree", "-DappendOutput=true", "-DoutputFile=\"" + outputPath + "\"").collect(Collectors.toList()); | |
if (userProperties != null) { | |
userProperties.forEach((key, value) -> goals.add(String.format("-D%s=%s", key, value))); | |
if (userProperties.containsKey("outputFile")) { | |
goals.removeIf(s -> s.startsWith("-DoutputFile")); | |
outputPath = userProperties.getProperty("outputFile") + "." + System.currentTimeMillis(); | |
goals.add(String.format("-DoutputFile=\"%s\"", outputPath)); | |
} | |
userProperties.forEach((key, value) -> { | |
if (key instanceof String && StringUtils.equals("outputFile", (String) key)) { | |
return; | |
} | |
goals.add(String.format("-D%s=%s", key, value)); | |
}); | |
String outputPath = baseDir.getAbsolutePath() + "/deps.log." + System.currentTimeMillis(); | |
List<String> goals = Stream.of("dependency:tree", "-DappendOutput=true", "-DoutputFile=\"" + outputPath + "\"").collect(Collectors.toList()); | |
if (userProperties != null) { | |
userProperties.forEach((key, value) -> goals.add(String.format("-D%s=%s", key, value))); |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #920 +/- ##
============================================
- 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. |
* support customize outputfile when package ark biz (cherry picked from commit bbe3deb)
* support customize outputfile when package ark biz (cherry picked from commit bbe3deb)
* 1. 删除前先标记文件夹已经被回收 2.即使删除失败也不会影响下次模块安装 (#907) * 1. 删除前先标记文件夹已经被回收,2.对外暴露方法查询文件夹是否被删除 * format file FileUtils.java and FileUtilsTest.java * fix ut * fix ut * Refactor to improve error handling and avoid swallowing exceptions * fix format check * fix ut * refactor fix constant name * use move file to mark dir is recycled --------- Co-authored-by: maixiyuan.mxy <maixiyuan.mxy@antgroup.com> (cherry picked from commit bdea92e) * Bump org.eclipse.jgit:org.eclipse.jgit in /sofa-ark-bom (#905) Bumps org.eclipse.jgit:org.eclipse.jgit from 5.9.0.202009080501-r to 5.13.3.202401111512-r. --- updated-dependencies: - dependency-name: org.eclipse.jgit:org.eclipse.jgit dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: leo james <leojames.googol@gmail.com> (cherry picked from commit bae37b8) * fix "The host does not contain a Context" (#909) * fix test can't not find tomcat when start web-ark-plugin (#915) (cherry picked from commit a6a4a3f) * switch classLoader for web biz to using same bizclassloader for startup and runtime (#913) * fix classLoader changed for tomcat web handler * add order * add switch classLoader in web ark plugin * format * enable switch classLoader filter in both base and biz * fix on trigger event * add codecov token * remove unused import (cherry picked from commit 6303e9c) * fix codecov missing (#917) * try to fix codecov error (cherry picked from commit f9cb08d) * support customize outputfile when package ark biz (#919) support customize outputfile when package ark biz (cherry picked from commit ffe9332) * support cutomize outputFile when ark maven (#920) * support customize outputfile when package ark biz (cherry picked from commit bbe3deb) * add endpoint for springboot3 * modify switch classLoader for web in springboot3 * fix test for sprintboot3 endpoint * update version to 3.1.3 * format test --------- Co-authored-by: Mak <xiyuanmak@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* 1. 删除前先标记文件夹已经被回收 2.即使删除失败也不会影响下次模块安装 (#907) * 1. 删除前先标记文件夹已经被回收,2.对外暴露方法查询文件夹是否被删除 * format file FileUtils.java and FileUtilsTest.java * fix ut * fix ut * Refactor to improve error handling and avoid swallowing exceptions * fix format check * fix ut * refactor fix constant name * use move file to mark dir is recycled --------- Co-authored-by: maixiyuan.mxy <maixiyuan.mxy@antgroup.com> (cherry picked from commit bdea92e) * Bump org.eclipse.jgit:org.eclipse.jgit in /sofa-ark-bom (#905) Bumps org.eclipse.jgit:org.eclipse.jgit from 5.9.0.202009080501-r to 5.13.3.202401111512-r. --- updated-dependencies: - dependency-name: org.eclipse.jgit:org.eclipse.jgit dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: leo james <leojames.googol@gmail.com> (cherry picked from commit bae37b8) * fix "The host does not contain a Context" (#909) * fix test can't not find tomcat when start web-ark-plugin (#915) (cherry picked from commit a6a4a3f) * switch classLoader for web biz to using same bizclassloader for startup and runtime (#913) * fix classLoader changed for tomcat web handler * add order * add switch classLoader in web ark plugin * format * enable switch classLoader filter in both base and biz * fix on trigger event * add codecov token * remove unused import (cherry picked from commit 6303e9c) * fix codecov missing (#917) * try to fix codecov error (cherry picked from commit f9cb08d) * support customize outputfile when package ark biz (#919) support customize outputfile when package ark biz (cherry picked from commit ffe9332) * support cutomize outputFile when ark maven (#920) * support customize outputfile when package ark biz (cherry picked from commit bbe3deb) * add endpoint for springboot3 * modify switch classLoader for web in springboot3 * udpate version to 3.0.5-SNAPSHOT * fix test for sprintboot3 endpoint * format test --------- Co-authored-by: Mak <xiyuanmak@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Summary by CodeRabbit
Chores
Refactor