Repository navigation
fix(common): resolve classpath resource paths and single-file copies - #20
Open
Hanabi9248 wants to merge 5 commits into
Open
Hanabi9248 wants to merge 5 commits into
Hanabi9248 wants to merge 5 commits into
Conversation
Preserve literal plus signs when resolving local resources. Signed-off-by: Hanabi9248 <hanabi210902@gmail.com>
Signed-off-by: Hanabi9248 <hanabi210902@gmail.com>
Signed-off-by: Hanabi9248 <hanabi210902@gmail.com>
Use the existing copy pipeline for the alert-rule XML caller; preserve directory traversal and JAR behavior. Signed-off-by: Hanabi9248 <hanabi210902@gmail.com>
Use official alert XML, real Spring resolution and nonempty binary data in private filesystem fixtures. Signed-off-by: Hanabi9248 <hanabi210902@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AsyncTask.createMonitorextracts classpath resources and usesSshUtil.getCurrentDirPath()for the local archive path. Two existing helper behaviors break that flow: encoded file URLs leave a literal%20in paths containing spaces, andAlertAutoScalingServiceImpl.parseRuleXmlpasses the actualmonitor/ivory/alert-rule.xmlfile tocopyDirFilesFromJar, whose IDE branch unconditionally traverses it as a directory and dereferences a nulllistFiles()result.This change decodes the two existing file-URL boundaries once, preserving literal
+. In the IDE resource branch, a regular file is now copied through the existingcopy(dirPath)pipeline and returns; directory recursion and the JAR branch remain unchanged.getAllFilekeeps its directory contract. The existing CodeSource selection, JAR-path truncation, output-directory/CWD policy, SSH behavior and build configuration are unchanged.Validation used the complete real
SshUtilplus five unchanged official support classes, real cached dependencies, real URLClassLoader/TCCL, Spring resource resolution, filesystem streams/copies and private byte-for-byte Spring JAR copies. No replacement Spring/JSch/copy implementation or service was used. Two distinct rounds were run:The standalone runners are in
tests/regression. After compiling the complete production/support classes and the runners with the real dependencies, useResourcePathRegression <private-ASCII-directory> <classes> <spring-core.jar> <other-runtime-jars...>for the first suite, andResourceFileRegression ide <private-directory> <classes> <spring-core.jar> cloudnative/src/main/resources/monitor/ivory/alert-rule.xml <other-runtime-jars...>for the new suite. The shared marker isResourcePathMarker. Published runners differ from the executed files only by license comments.Environment: Windows, JDK 25.0.4.101 with
--release 8; existing Spring core/jcl 5.2.10.RELEASE, Hutool 5.8.20, JSch 0.1.55, commons-io 2.6, slf4j-api 1.7.30 and Lombok 1.18.42. The project declares Lombok 1.18.20, which was not tested. SLF4J used its standard NOP fallback; log contents were not tested.Not run: Maven/full backend, original Lombok 1.18.20/JDK 8 runtime, Linux, Unix JAR resource control or Windows JAR branch, Spring Boot packaging, actual monitor readiness/controller/database flow, deployment/SSH/SCP, or arbitrary-working-directory behavior. The XML test invokes the real copy helper and parses its copied XML; it does not instantiate the whole alert service. No full deployment success is claimed.