[ 
https://issues.apache.org/jira/browse/MINIFI-117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15616388#comment-15616388
 ] 

ASF GitHub Bot commented on MINIFI-117:
---------------------------------------

Github user JPercivall commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi/pull/45#discussion_r85600674
  
    --- Diff: 
minifi-commons/minifi-commons-schema/src/main/java/org/apache/nifi/minifi/commons/schema/serialization/SchemaLoader.java
 ---
    @@ -78,6 +80,27 @@ public static ConfigSchema 
loadConfigSchemaFromYaml(Map<String, Object> yamlAsMa
     
         public static ConvertableSchema<ConfigSchema> 
loadConvertableSchemaFromYaml(Map<String, Object> yamlAsMap) throws 
SchemaLoaderException {
             String version = 
String.valueOf(yamlAsMap.get(ConfigSchema.VERSION));
    +        if (StringUtil.isNullOrEmpty(version) || String.valueOf((Object) 
null).equals(version)) {
    --- End diff --
    
    @brosander what was the motivation to move all of this logging here and 
potentially change which yaml version gets used? I preferred keeping the 
version as a required property and assuming that null and "" were v1 (makes 
things much simpler in the long run). 
    
    A side effect of the logging is weird messages when doing simple validation 
or conversion using the toolkit (test.yml has no config version listed):
    
    ![screen shot 2016-10-28 at 4 02 51 
pm](https://cloud.githubusercontent.com/assets/11302527/19820530/cc7af110-9d27-11e6-8e9f-279f6a79a091.png)
    



> Maintainable Configuration Versioning
> -------------------------------------
>
>                 Key: MINIFI-117
>                 URL: https://issues.apache.org/jira/browse/MINIFI-117
>             Project: Apache NiFi MiNiFi
>          Issue Type: Bug
>            Reporter: Bryan Rosander
>            Assignee: Bryan Rosander
>
> In order to avoid a tangled web of if/else statements around every possible 
> permutation of config.yml and an equally complicated validation routine, we 
> need to utilize a versioning strategy that allows for specific parsing and 
> validation code for each version of the ConfigSchema.
> This will allow us to determine if a schema will be compatible with an older 
> MiNiFi instance more easily by validating the structure of the file at a 
> given version while still supporting an upconvert on read to the latest 
> ConfigSchema while parsing at runtime.
> It should also facilitate a deprecation strategy of removing older versions' 
> classes without needing to touch current implementation



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to