-
Notifications
You must be signed in to change notification settings - Fork 70
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
fix(configdocsgenerator): use Spring to parse Yaml into InspectitConfig #1362
fix(configdocsgenerator): use Spring to parse Yaml into InspectitConfig #1362
Conversation
bbcf80e
to
4a7635f
Compare
Codecov Report
@@ Coverage Diff @@
## master #1362 +/- ##
============================================
- Coverage 83.00% 81.14% -1.86%
- Complexity 1736 2070 +334
============================================
Files 174 210 +36
Lines 5366 6591 +1225
Branches 650 784 +134
============================================
+ Hits 4454 5348 +894
- Misses 675 945 +270
- Partials 237 298 +61
|
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.
Reviewed 8 of 8 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @aaronweissler)
components/inspectit-ocelot-configdocsgenerator/src/main/java/inspectit/ocelot/configdocsgenerator/parsing/ConfigParser.java, line 42 at r2 (raw file):
if (!StringUtils.isEmpty(configYaml)) { File tempFile = File.createTempFile("temp-", ".tmp");
The file is then named temp-{...}.tmp
?
Maybe sth like inspectit-config-{...}
is more appropriate?
components/inspectit-ocelot-configdocsgenerator/src/main/java/inspectit/ocelot/configdocsgenerator/parsing/ConfigParser.java, line 49 at r2 (raw file):
// Read yaml into Properties YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean(); factory.setResources(new FileUrlResource(tempFile.getAbsolutePath()));
What is the difference between these lines of code and StringUtils.readYamlFiles(new FileUrlResource(tempFile.getAbsolutePath()));
?
components/inspectit-ocelot-configdocsgenerator/src/main/java/inspectit/ocelot/configdocsgenerator/parsing/ConfigParser.java, line 51 at r2 (raw file):
factory.setResources(new FileUrlResource(tempFile.getAbsolutePath())); factory.setDocumentMatchers((profile) -> YamlProcessor.MatchStatus.FOUND); factory.afterPropertiesSet();
I think this line has no effect if you are not calling factory.setSingleton()
before.
And I think this is also redundant if you call factory.getObject()
immediately afterwards.
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.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @aaronweissler)
This change is