Skip to content
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

Make yaml parsing type safe #114

Merged
merged 3 commits into from
Jul 1, 2020
Merged

Make yaml parsing type safe #114

merged 3 commits into from
Jul 1, 2020

Conversation

jetersen
Copy link
Member

@jetersen jetersen commented Jul 1, 2020

fixes #113

@jetersen
Copy link
Member Author

jetersen commented Jul 1, 2020

Feel free to test this with build-timeout @ricksbrown

Heck, let me add a test 😆

@timja timja added the enhancement New feature or request label Jul 1, 2020
@timja timja changed the title make yaml parsing type safe Make yaml parsing type safe Jul 1, 2020
Co-authored-by: Tim Jacomb <t.jacomb@kainos.com>
@@ -69,37 +69,32 @@
public List<Plugin> parsePluginYamlFile(File pluginYamlFile) {
List<Plugin> pluginsFromYaml = new ArrayList<>();
if (fileExists(pluginYamlFile)) {
Yaml yaml = new Yaml();
Representer representer = new Representer();
representer.getPropertyUtils().setSkipMissingProperties(true);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test will fail without ignoring missing properties 👍 Especially the bad format tests

@timja timja merged commit 5028631 into jenkinsci:master Jul 1, 2020
@jetersen jetersen deleted the fix/typeSafeYamlParser branch July 1, 2020 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants