)]}'
{"releasenotes/notes/support-template-prototype-f9552fef4fc66122.yaml":[{"author":{"_account_id":19184,"name":"Idan Hefetz","email":"idan.hefetz@nokia.com","username":"idan-hefetz"},"change_message_id":"36a0ff595411c2fd90a476802f9ceeff2dbb7afe","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"prelude: \u003e"},{"line_number":3,"context_line":"    Replace this text with content to appear at the top of the section for this"},{"line_number":4,"context_line":"    release. All of the prelude content is merged together and then rendered"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"9fdfeff1_77ba9b0a","line":1,"range":{"start_line":1,"start_character":0,"end_line":1,"end_character":3},"updated":"2019-01-28 12:28:55.000000000","message":"Should probably write something here :)","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"1b30556ac9e6ae130ece2d8c0384f34b88f2e08e","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"prelude: \u003e"},{"line_number":3,"context_line":"    Replace this text with content to appear at the top of the section for this"},{"line_number":4,"context_line":"    release. All of the prelude content is merged together and then rendered"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"9fdfeff1_957156e1","line":1,"range":{"start_line":1,"start_character":0,"end_line":1,"end_character":3},"in_reply_to":"9fdfeff1_77ba9b0a","updated":"2019-02-11 10:45:57.000000000","message":"Done","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"},{"author":{"_account_id":19184,"name":"Idan Hefetz","email":"idan.hefetz@nokia.com","username":"idan-hefetz"},"change_message_id":"2deeaac6f058b6e6851aaa7d734d409eda4088d4","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"prelude: \u003e"},{"line_number":3,"context_line":"    Replace this text with content to appear at the top of the section for this"},{"line_number":4,"context_line":"    release. All of the prelude content is merged together and then rendered"},{"line_number":5,"context_line":"    separately from the items listed in other parts of the file, so the text"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"9fdfeff1_bb0ec9e2","line":2,"range":{"start_line":1,"start_character":0,"end_line":2,"end_character":10},"updated":"2019-02-11 11:34:29.000000000","message":"remove this file","commit_id":"7db49f53c60df91d11982ffae63ee33cc8e4ecd5"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"f82ef3724415cc2c8087a8d7e390644bf43ad540","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"prelude: \u003e"},{"line_number":3,"context_line":"    Replace this text with content to appear at the top of the section for this"},{"line_number":4,"context_line":"    release. All of the prelude content is merged together and then rendered"},{"line_number":5,"context_line":"    separately from the items listed in other parts of the file, so the text"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"9fdfeff1_1ebb43c4","line":2,"range":{"start_line":1,"start_character":0,"end_line":2,"end_character":10},"in_reply_to":"9fdfeff1_bb0ec9e2","updated":"2019-02-11 12:25:17.000000000","message":"Done","commit_id":"7db49f53c60df91d11982ffae63ee33cc8e4ecd5"}],"vitrage/api_handler/apis/template.py":[{"author":{"_account_id":19134,"name":"Eyal","email":"eyalb1@gmail.com","username":"eyalb"},"change_message_id":"df4ae52c1d3150f2ab6475ab670b901fbad020ba","unresolved":false,"context_lines":[{"line_number":51,"context_line":"         LOADING that needs to be handled."},{"line_number":52,"context_line":"        \"\"\""},{"line_number":53,"context_line":"        LOG.debug(\"TemplateApis add_template type: %s content: %s params: %s\","},{"line_number":54,"context_line":"                  str(template_type), str(templates), str(params))"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        files_content \u003d [t[1] for t in templates]"},{"line_number":57,"context_line":"        db_rows \u003d template_repo.add_templates_to_db(self.db, files_content,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_a4d8bc52","line":54,"range":{"start_line":54,"start_character":16,"end_line":54,"end_character":66},"updated":"2019-02-13 09:41:50.000000000","message":"no need for str here","commit_id":"05d3375c8b7b60152afc27df1b7407e13f37ec35"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"64157d7aadd4e5dca00097a15efd51765001107b","unresolved":false,"context_lines":[{"line_number":51,"context_line":"         LOADING that needs to be handled."},{"line_number":52,"context_line":"        \"\"\""},{"line_number":53,"context_line":"        LOG.debug(\"TemplateApis add_template type: %s content: %s params: %s\","},{"line_number":54,"context_line":"                  str(template_type), str(templates), str(params))"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        files_content \u003d [t[1] for t in templates]"},{"line_number":57,"context_line":"        db_rows \u003d template_repo.add_templates_to_db(self.db, files_content,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_646e5401","line":54,"range":{"start_line":54,"start_character":16,"end_line":54,"end_character":66},"in_reply_to":"9fdfeff1_a4d8bc52","updated":"2019-02-13 12:05:17.000000000","message":"Done","commit_id":"05d3375c8b7b60152afc27df1b7407e13f37ec35"}],"vitrage/evaluator/template_data.py":[{"author":{"_account_id":19184,"name":"Idan Hefetz","email":"idan.hefetz@nokia.com","username":"idan-hefetz"},"change_message_id":"36a0ff595411c2fd90a476802f9ceeff2dbb7afe","unresolved":false,"context_lines":[{"line_number":19,"context_line":"    \u0027ActionSpecs\u0027, [\u0027id\u0027, \u0027type\u0027, \u0027targets\u0027, \u0027properties\u0027])"},{"line_number":20,"context_line":"EdgeDescription \u003d namedtuple(\u0027EdgeDescription\u0027, [\u0027edge\u0027, \u0027source\u0027, \u0027target\u0027])"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Parameter \u003d namedtuple(\u0027Parameter\u0027, [\u0027description\u0027, \u0027default\u0027])"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"ENTITY \u003d \u0027entity\u0027"},{"line_number":25,"context_line":"RELATIONSHIP \u003d \u0027relationship\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_72baa90a","line":22,"range":{"start_line":22,"start_character":0,"end_line":22,"end_character":63},"updated":"2019-01-28 12:28:55.000000000","message":"Do we need this namedtuple? didn\u0027t see it is used anywhere.","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"1b30556ac9e6ae130ece2d8c0384f34b88f2e08e","unresolved":false,"context_lines":[{"line_number":19,"context_line":"    \u0027ActionSpecs\u0027, [\u0027id\u0027, \u0027type\u0027, \u0027targets\u0027, \u0027properties\u0027])"},{"line_number":20,"context_line":"EdgeDescription \u003d namedtuple(\u0027EdgeDescription\u0027, [\u0027edge\u0027, \u0027source\u0027, \u0027target\u0027])"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Parameter \u003d namedtuple(\u0027Parameter\u0027, [\u0027description\u0027, \u0027default\u0027])"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"ENTITY \u003d \u0027entity\u0027"},{"line_number":25,"context_line":"RELATIONSHIP \u003d \u0027relationship\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_f54b0284","line":22,"range":{"start_line":22,"start_character":0,"end_line":22,"end_character":63},"in_reply_to":"9fdfeff1_72baa90a","updated":"2019-02-11 10:45:57.000000000","message":"Done","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"}],"vitrage/evaluator/template_db/template_repository.py":[{"author":{"_account_id":19184,"name":"Idan Hefetz","email":"idan.hefetz@nokia.com","username":"idan-hefetz"},"change_message_id":"36a0ff595411c2fd90a476802f9ceeff2dbb7afe","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                                             \"Unknown template type\"))"},{"line_number":40,"context_line":"            continue"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        result \u003d _validate_template(db, template, final_type, params)"},{"line_number":43,"context_line":"        if result.is_valid_config:"},{"line_number":44,"context_line":"            result \u003d resolve_parameters(template, params)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        template_name \u003d _template_name(template)  # after resolved parameters"},{"line_number":47,"context_line":"        if not template_name:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_b293315b","line":44,"range":{"start_line":42,"start_character":0,"end_line":44,"end_character":57},"updated":"2019-01-28 12:28:55.000000000","message":"shouldn\u0027t validate also run after resolving parameters?\nIf so, most changes in this file are not needed.","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"},{"author":{"_account_id":19184,"name":"Idan Hefetz","email":"idan.hefetz@nokia.com","username":"idan-hefetz"},"change_message_id":"2deeaac6f058b6e6851aaa7d734d409eda4088d4","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                                             \"Unknown template type\"))"},{"line_number":40,"context_line":"            continue"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        result \u003d _validate_template(db, template, final_type, params)"},{"line_number":43,"context_line":"        if result.is_valid_config:"},{"line_number":44,"context_line":"            result \u003d resolve_parameters(template, params)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        template_name \u003d _template_name(template)  # after resolved parameters"},{"line_number":47,"context_line":"        if not template_name:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_bbaa4982","line":44,"range":{"start_line":42,"start_character":0,"end_line":44,"end_character":57},"in_reply_to":"9fdfeff1_955ab64d","updated":"2019-02-11 11:34:29.000000000","message":"For example a raise_alarm, target can be get_param.\nMeaning it could be a template id, that requires validation.\nI would suggest to remove the template name validation, and run a full validation.","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"1b30556ac9e6ae130ece2d8c0384f34b88f2e08e","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                                             \"Unknown template type\"))"},{"line_number":40,"context_line":"            continue"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        result \u003d _validate_template(db, template, final_type, params)"},{"line_number":43,"context_line":"        if result.is_valid_config:"},{"line_number":44,"context_line":"            result \u003d resolve_parameters(template, params)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        template_name \u003d _template_name(template)  # after resolved parameters"},{"line_number":47,"context_line":"        if not template_name:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_955ab64d","line":44,"range":{"start_line":42,"start_character":0,"end_line":44,"end_character":57},"in_reply_to":"9fdfeff1_b293315b","updated":"2019-02-11 10:45:57.000000000","message":"I\u0027m not sure. If the template validation succeeded, and all parameters were resolved (if not, there is an error), then why run validate again?","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"f82ef3724415cc2c8087a8d7e390644bf43ad540","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                                             \"Unknown template type\"))"},{"line_number":40,"context_line":"            continue"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        result \u003d _validate_template(db, template, final_type, params)"},{"line_number":43,"context_line":"        if result.is_valid_config:"},{"line_number":44,"context_line":"            result \u003d resolve_parameters(template, params)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        template_name \u003d _template_name(template)  # after resolved parameters"},{"line_number":47,"context_line":"        if not template_name:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_5ea78ba8","line":44,"range":{"start_line":42,"start_character":0,"end_line":44,"end_character":57},"in_reply_to":"9fdfeff1_bbaa4982","updated":"2019-02-11 12:25:17.000000000","message":"Done","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"},{"author":{"_account_id":19184,"name":"Idan Hefetz","email":"idan.hefetz@nokia.com","username":"idan-hefetz"},"change_message_id":"36a0ff595411c2fd90a476802f9ceeff2dbb7afe","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        if result.is_valid_config:"},{"line_number":44,"context_line":"            result \u003d resolve_parameters(template, params)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        template_name \u003d _template_name(template)  # after resolved parameters"},{"line_number":47,"context_line":"        if not template_name:"},{"line_number":48,"context_line":"            db_rows.append(_get_error_result(template, final_type,"},{"line_number":49,"context_line":"                                             \"Empty template name\"))"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_92faadba","line":46,"range":{"start_line":46,"start_character":24,"end_line":46,"end_character":48},"updated":"2019-01-28 12:28:55.000000000","message":"template.get(METADATA, {}).get(NAME)\n\ninstead of a function","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"1b30556ac9e6ae130ece2d8c0384f34b88f2e08e","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        if result.is_valid_config:"},{"line_number":44,"context_line":"            result \u003d resolve_parameters(template, params)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        template_name \u003d _template_name(template)  # after resolved parameters"},{"line_number":47,"context_line":"        if not template_name:"},{"line_number":48,"context_line":"            db_rows.append(_get_error_result(template, final_type,"},{"line_number":49,"context_line":"                                             \"Empty template name\"))"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_35598a59","line":46,"range":{"start_line":46,"start_character":24,"end_line":46,"end_character":48},"in_reply_to":"9fdfeff1_92faadba","updated":"2019-02-11 10:45:57.000000000","message":"Done","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"},{"author":{"_account_id":19184,"name":"Idan Hefetz","email":"idan.hefetz@nokia.com","username":"idan-hefetz"},"change_message_id":"2deeaac6f058b6e6851aaa7d734d409eda4088d4","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            result \u003d resolve_parameters(template, params)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        # template_name might be a parameter, take it after resolve parameters"},{"line_number":47,"context_line":"        template_name \u003d template.get(METADATA, {}).get(NAME)"},{"line_number":48,"context_line":"        if not template_name:"},{"line_number":49,"context_line":"            db_rows.append(_get_error_result(template, final_type,"},{"line_number":50,"context_line":"                                             \"Empty template name\"))"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_3b9e5963","line":47,"range":{"start_line":47,"start_character":24,"end_line":47,"end_character":50},"updated":"2019-02-11 11:34:29.000000000","message":"as it was validated that metadata exists. this can be replaced by: template[METADATA].get(NAME)","commit_id":"7db49f53c60df91d11982ffae63ee33cc8e4ecd5"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"f82ef3724415cc2c8087a8d7e390644bf43ad540","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            result \u003d resolve_parameters(template, params)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        # template_name might be a parameter, take it after resolve parameters"},{"line_number":47,"context_line":"        template_name \u003d template.get(METADATA, {}).get(NAME)"},{"line_number":48,"context_line":"        if not template_name:"},{"line_number":49,"context_line":"            db_rows.append(_get_error_result(template, final_type,"},{"line_number":50,"context_line":"                                             \"Empty template name\"))"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_9e8f332d","line":47,"range":{"start_line":47,"start_character":24,"end_line":47,"end_character":50},"in_reply_to":"9fdfeff1_3b9e5963","updated":"2019-02-11 12:25:17.000000000","message":"Done","commit_id":"7db49f53c60df91d11982ffae63ee33cc8e4ecd5"}],"vitrage/evaluator/template_functions/__init__.py":[{"author":{"_account_id":19184,"name":"Idan Hefetz","email":"idan.hefetz@nokia.com","username":"idan-hefetz"},"change_message_id":"75cb327f1c80ba6a8d59aede0608af41949bd347","unresolved":false,"context_lines":[{"line_number":13,"context_line":"# under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"# Function names"},{"line_number":16,"context_line":"GET_ATTR \u003d \u0027get_attr\u0027"},{"line_number":17,"context_line":"GET_PARAM \u003d \u0027get_param\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_be7f80dd","line":17,"range":{"start_line":16,"start_character":0,"end_line":17,"end_character":23},"updated":"2019-02-12 10:58:49.000000000","message":"perhaps this should be in function_resolver.py","commit_id":"7614265f7c0471620bd8413870af8f198a79feda"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"6bd218ff8971c11105239cd2e2532c7df9258dc5","unresolved":false,"context_lines":[{"line_number":13,"context_line":"# under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"# Function names"},{"line_number":16,"context_line":"GET_ATTR \u003d \u0027get_attr\u0027"},{"line_number":17,"context_line":"GET_PARAM \u003d \u0027get_param\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_9c74046a","line":17,"range":{"start_line":16,"start_character":0,"end_line":17,"end_character":23},"in_reply_to":"9fdfeff1_be7f80dd","updated":"2019-02-12 13:13:16.000000000","message":"function_resolver is general and should not refer specific functions. \nI tried to move it under v2/functions, but it caused an import loop...","commit_id":"7614265f7c0471620bd8413870af8f198a79feda"}],"vitrage/evaluator/template_functions/function_resolver.py":[{"author":{"_account_id":19184,"name":"Idan Hefetz","email":"idan.hefetz@nokia.com","username":"idan-hefetz"},"change_message_id":"36a0ff595411c2fd90a476802f9ceeff2dbb7afe","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        for key, value in template_block.items():"},{"line_number":44,"context_line":"            if result.is_valid_config:"},{"line_number":45,"context_line":"                if isinstance(value, six.string_types) and is_function(value):"},{"line_number":46,"context_line":"                    result, resolved_value \u003d func(value, template, **kwargs)"},{"line_number":47,"context_line":"                    if result.is_valid_config:"},{"line_number":48,"context_line":"                        if not resolved_value:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_7271490c","line":45,"range":{"start_line":45,"start_character":59,"end_line":45,"end_character":78},"updated":"2019-01-28 12:28:55.000000000","message":"is_function should check the actual func name.\nIn v3 commit I added similar logic.","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"1b30556ac9e6ae130ece2d8c0384f34b88f2e08e","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        for key, value in template_block.items():"},{"line_number":44,"context_line":"            if result.is_valid_config:"},{"line_number":45,"context_line":"                if isinstance(value, six.string_types) and is_function(value):"},{"line_number":46,"context_line":"                    result, resolved_value \u003d func(value, template, **kwargs)"},{"line_number":47,"context_line":"                    if result.is_valid_config:"},{"line_number":48,"context_line":"                        if not resolved_value:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_b53a5ae4","line":45,"range":{"start_line":45,"start_character":59,"end_line":45,"end_character":78},"in_reply_to":"9fdfeff1_7271490c","updated":"2019-02-11 10:45:57.000000000","message":"Done","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"},{"author":{"_account_id":19184,"name":"Idan Hefetz","email":"idan.hefetz@nokia.com","username":"idan-hefetz"},"change_message_id":"2deeaac6f058b6e6851aaa7d734d409eda4088d4","unresolved":false,"context_lines":[{"line_number":55,"context_line":"                    func \u003d func_info.func"},{"line_number":56,"context_line":"                    if not func:"},{"line_number":57,"context_line":"                        status \u003d func_info.error_code"},{"line_number":58,"context_line":"                        LOG.error(\u0027%s status code: %s\u0027 %"},{"line_number":59,"context_line":"                                  (status_msgs[status], status))"},{"line_number":60,"context_line":"                        return get_content_fault_result(status)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"                    result, resolved_value \u003d func(value, template, **kwargs)"},{"line_number":63,"context_line":"                    if result.is_valid_config and resolve:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_1b17d5a5","line":60,"range":{"start_line":58,"start_character":0,"end_line":60,"end_character":63},"updated":"2019-02-11 11:34:29.000000000","message":"consider replacing this with raise ValidationError(func_info.error_code).","commit_id":"7db49f53c60df91d11982ffae63ee33cc8e4ecd5"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"f82ef3724415cc2c8087a8d7e390644bf43ad540","unresolved":false,"context_lines":[{"line_number":55,"context_line":"                    func \u003d func_info.func"},{"line_number":56,"context_line":"                    if not func:"},{"line_number":57,"context_line":"                        status \u003d func_info.error_code"},{"line_number":58,"context_line":"                        LOG.error(\u0027%s status code: %s\u0027 %"},{"line_number":59,"context_line":"                                  (status_msgs[status], status))"},{"line_number":60,"context_line":"                        return get_content_fault_result(status)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"                    result, resolved_value \u003d func(value, template, **kwargs)"},{"line_number":63,"context_line":"                    if result.is_valid_config and resolve:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_7e7daf1a","line":60,"range":{"start_line":58,"start_character":0,"end_line":60,"end_character":63},"in_reply_to":"9fdfeff1_1b17d5a5","updated":"2019-02-11 12:25:17.000000000","message":"Will do it in the next commit, while adding parameters to template version 3","commit_id":"7db49f53c60df91d11982ffae63ee33cc8e4ecd5"}],"vitrage/evaluator/template_functions/v2/__init__.py":[{"author":{"_account_id":19134,"name":"Eyal","email":"eyalb1@gmail.com","username":"eyalb"},"change_message_id":"df4ae52c1d3150f2ab6475ab670b901fbad020ba","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    if not result.is_valid_config:"},{"line_number":36,"context_line":"        return result"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    get_param \u003d template_schema.functions.get(GET_PARAM)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    return FunctionResolver().resolve_function("},{"line_number":41,"context_line":"        func_info\u003dFuncInfo(name\u003dGET_PARAM, func\u003dget_param, error_code\u003d160),"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_e4700443","line":38,"range":{"start_line":38,"start_character":3,"end_line":38,"end_character":56},"updated":"2019-02-13 09:41:50.000000000","message":"can this be None if it None will it work ?","commit_id":"05d3375c8b7b60152afc27df1b7407e13f37ec35"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"64157d7aadd4e5dca00097a15efd51765001107b","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    if not result.is_valid_config:"},{"line_number":36,"context_line":"        return result"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    get_param \u003d template_schema.functions.get(GET_PARAM)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    return FunctionResolver().resolve_function("},{"line_number":41,"context_line":"        func_info\u003dFuncInfo(name\u003dGET_PARAM, func\u003dget_param, error_code\u003d160),"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_e4524435","line":38,"range":{"start_line":38,"start_character":3,"end_line":38,"end_character":56},"in_reply_to":"9fdfeff1_e4700443","updated":"2019-02-13 12:05:17.000000000","message":"It is None for version 1 (and temporarily also for version 3, until I fix it). The FunctionResolver checks for None and issues a validation error in this case, with the error_code given below (160).\n\nThe reason that I don\u0027t check it here is that I want to issue an error only if there is an attempt to call get_param. It is on if the function is None but get_param is not used anywhere.","commit_id":"05d3375c8b7b60152afc27df1b7407e13f37ec35"}],"vitrage/evaluator/template_functions/v2/functions.py":[{"author":{"_account_id":19184,"name":"Idan Hefetz","email":"idan.hefetz@nokia.com","username":"idan-hefetz"},"change_message_id":"36a0ff595411c2fd90a476802f9ceeff2dbb7afe","unresolved":false,"context_lines":[{"line_number":83,"context_line":"    return attr"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"def get_param(param_name, template, **kwargs):"},{"line_number":87,"context_line":"    param_defs \u003d template.get(TemplateFields.PARAMETERS)"},{"line_number":88,"context_line":"    actual_params \u003d kwargs.get(\u0027actual_params\u0027)"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_6d172c47","line":86,"range":{"start_line":86,"start_character":0,"end_line":86,"end_character":46},"updated":"2019-01-28 12:28:55.000000000","message":"Please rename \u0027param_name\u0027 it is very confusing, maybe \u0027function_call_str\u0027.\nAlso, it\u0027s not quite clear what does this function do.\nIt performs validation?","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"1b30556ac9e6ae130ece2d8c0384f34b88f2e08e","unresolved":false,"context_lines":[{"line_number":83,"context_line":"    return attr"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"def get_param(param_name, template, **kwargs):"},{"line_number":87,"context_line":"    param_defs \u003d template.get(TemplateFields.PARAMETERS)"},{"line_number":88,"context_line":"    actual_params \u003d kwargs.get(\u0027actual_params\u0027)"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_9508762d","line":86,"range":{"start_line":86,"start_character":0,"end_line":86,"end_character":46},"in_reply_to":"9fdfeff1_6d172c47","updated":"2019-02-11 10:45:57.000000000","message":"param_name is the name of the parameter to get. Why do you think it is not clear? I don\u0027t like function_call_str, because it is a specific function for get parameter value. I added documentation.","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"}],"vitrage/evaluator/template_loading/__init__.py":[{"author":{"_account_id":19184,"name":"Idan Hefetz","email":"idan.hefetz@nokia.com","username":"idan-hefetz"},"change_message_id":"75cb327f1c80ba6a8d59aede0608af41949bd347","unresolved":false,"context_lines":[{"line_number":27,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def resolve_parameters(template_def, params\u003dNone):"},{"line_number":31,"context_line":"    if not params:"},{"line_number":32,"context_line":"        return get_content_correct_result()"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_7e2838e1","line":30,"range":{"start_line":30,"start_character":0,"end_line":30,"end_character":50},"updated":"2019-02-12 10:58:49.000000000","message":"perhaps this should be in function_resolver.py","commit_id":"7614265f7c0471620bd8413870af8f198a79feda"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"6bd218ff8971c11105239cd2e2532c7df9258dc5","unresolved":false,"context_lines":[{"line_number":27,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def resolve_parameters(template_def, params\u003dNone):"},{"line_number":31,"context_line":"    if not params:"},{"line_number":32,"context_line":"        return get_content_correct_result()"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_5c453cb3","line":30,"range":{"start_line":30,"start_character":0,"end_line":30,"end_character":50},"in_reply_to":"9fdfeff1_7e2838e1","updated":"2019-02-12 13:13:16.000000000","message":"I don\u0027t think it belongs in function_resolver, since function_resolver is a general traversal and resolve_parameters is specific to parameters. I moved it under template_functions/v2/__init__.py","commit_id":"7614265f7c0471620bd8413870af8f198a79feda"}],"vitrage/evaluator/template_validation/content/template_content_validator.py":[{"author":{"_account_id":19184,"name":"Idan Hefetz","email":"idan.hefetz@nokia.com","username":"idan-hefetz"},"change_message_id":"36a0ff595411c2fd90a476802f9ceeff2dbb7afe","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"def parameters_validation(template_schema, template, actual_params):"},{"line_number":108,"context_line":"    result \u003d get_content_correct_result()"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    params_validator \u003d \\"},{"line_number":111,"context_line":"        template_schema.validators.get(TemplateFields.PARAMETERS) \\"},{"line_number":112,"context_line":"        if template_schema else None"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    # validate parameter definitions"},{"line_number":115,"context_line":"    if params_validator:"},{"line_number":116,"context_line":"        result \u003d params_validator.validate(template, actual_params)"},{"line_number":117,"context_line":"    else:"},{"line_number":118,"context_line":"        result.is_valid_config \u003d False  # Not supposed to happen"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    return result"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_8dc7f096","line":120,"range":{"start_line":108,"start_character":0,"end_line":120,"end_character":17},"updated":"2019-01-28 12:28:55.000000000","message":"Since it\u0027s not supposed to happen, the following is much shorter:\n\nparams_validator \u003d template_schema.validators.get(TemplateFields.PARAMETERS)\nreturn params_validator.validate(template, actual_params)","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"1b30556ac9e6ae130ece2d8c0384f34b88f2e08e","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"def parameters_validation(template_schema, template, actual_params):"},{"line_number":108,"context_line":"    result \u003d get_content_correct_result()"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    params_validator \u003d \\"},{"line_number":111,"context_line":"        template_schema.validators.get(TemplateFields.PARAMETERS) \\"},{"line_number":112,"context_line":"        if template_schema else None"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    # validate parameter definitions"},{"line_number":115,"context_line":"    if params_validator:"},{"line_number":116,"context_line":"        result \u003d params_validator.validate(template, actual_params)"},{"line_number":117,"context_line":"    else:"},{"line_number":118,"context_line":"        result.is_valid_config \u003d False  # Not supposed to happen"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    return result"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_f8753799","line":120,"range":{"start_line":108,"start_character":0,"end_line":120,"end_character":17},"in_reply_to":"9fdfeff1_8dc7f096","updated":"2019-02-11 10:45:57.000000000","message":"I think I wrote it this way for some other validator, and got a comment \u0027what if it\u0027s none\u0027 ... \n\nI\u0027ll change it","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"}],"vitrage/evaluator/template_validation/content/v1/parameters_validator.py":[{"author":{"_account_id":19184,"name":"Idan Hefetz","email":"idan.hefetz@nokia.com","username":"idan-hefetz"},"change_message_id":"75cb327f1c80ba6a8d59aede0608af41949bd347","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from vitrage.evaluator.template_functions import GET_PARAM"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class ParametersValidator(object):"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    @classmethod"},{"line_number":25,"context_line":"    def validate(cls, template, actual_params):"},{"line_number":26,"context_line":"        # if there is a get_param in the template, an error message will be"},{"line_number":27,"context_line":"        # returned since func is None"},{"line_number":28,"context_line":"        return FunctionResolver().validate_function("},{"line_number":29,"context_line":"            func_info\u003dFuncInfo(name\u003dGET_PARAM, func\u003dNone, error_code\u003d160),"},{"line_number":30,"context_line":"            template\u003dtemplate,"},{"line_number":31,"context_line":"            actual_params\u003dactual_params)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_7e77d8d5","line":31,"range":{"start_line":22,"start_character":0,"end_line":31,"end_character":40},"updated":"2019-02-12 10:58:49.000000000","message":"i think this should be removed. Version 1 doesn\u0027t support many features, but we don\u0027t actively verify they are not in use (causing_alarm for example)","commit_id":"7614265f7c0471620bd8413870af8f198a79feda"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"6bd218ff8971c11105239cd2e2532c7df9258dc5","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from vitrage.evaluator.template_functions import GET_PARAM"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class ParametersValidator(object):"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    @classmethod"},{"line_number":25,"context_line":"    def validate(cls, template, actual_params):"},{"line_number":26,"context_line":"        # if there is a get_param in the template, an error message will be"},{"line_number":27,"context_line":"        # returned since func is None"},{"line_number":28,"context_line":"        return FunctionResolver().validate_function("},{"line_number":29,"context_line":"            func_info\u003dFuncInfo(name\u003dGET_PARAM, func\u003dNone, error_code\u003d160),"},{"line_number":30,"context_line":"            template\u003dtemplate,"},{"line_number":31,"context_line":"            actual_params\u003dactual_params)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_b7cec357","line":31,"range":{"start_line":22,"start_character":0,"end_line":31,"end_character":40},"in_reply_to":"9fdfeff1_7e77d8d5","updated":"2019-02-12 13:13:16.000000000","message":"I think we should verify it. It is very easy for a user to mistakenly copy a version 1 template and try to add get_param. Understanding why it doesn\u0027t work may take some time... if we can give a quick error message that parameters are not supported in version 1, we should definitely do it.","commit_id":"7614265f7c0471620bd8413870af8f198a79feda"}],"vitrage/evaluator/template_validation/content/v2/parameters_validator.py":[{"author":{"_account_id":19184,"name":"Idan Hefetz","email":"idan.hefetz@nokia.com","username":"idan-hefetz"},"change_message_id":"75cb327f1c80ba6a8d59aede0608af41949bd347","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from vitrage.evaluator.template_functions.v2.functions import get_param"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class ParametersValidator(object):"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    @classmethod"},{"line_number":26,"context_line":"    def validate(cls, template, actual_params):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_7e7ef819","line":23,"range":{"start_line":23,"start_character":6,"end_line":23,"end_character":25},"updated":"2019-02-12 10:58:49.000000000","message":"As this only validates the get_param function,class and filename should changed to get_param_validator.\nAlso the constant used in template_schemas.py","commit_id":"7614265f7c0471620bd8413870af8f198a79feda"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"6bd218ff8971c11105239cd2e2532c7df9258dc5","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from vitrage.evaluator.template_functions.v2.functions import get_param"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class ParametersValidator(object):"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    @classmethod"},{"line_number":26,"context_line":"    def validate(cls, template, actual_params):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_61a5fd46","line":23,"range":{"start_line":23,"start_character":6,"end_line":23,"end_character":25},"in_reply_to":"9fdfeff1_7e7ef819","updated":"2019-02-12 13:13:16.000000000","message":"Done","commit_id":"7614265f7c0471620bd8413870af8f198a79feda"}],"vitrage/evaluator/template_validation/status_messages.py":[{"author":{"_account_id":19184,"name":"Idan Hefetz","email":"idan.hefetz@nokia.com","username":"idan-hefetz"},"change_message_id":"36a0ff595411c2fd90a476802f9ceeff2dbb7afe","unresolved":false,"context_lines":[{"line_number":107,"context_line":"         \u0027\\\u0027parameters\\\u0027 block\u0027,"},{"line_number":108,"context_line":"    163: \u0027malformed get_param() clause\u0027,"},{"line_number":109,"context_line":"    164: \u0027Failed to resolve function\u0027,"},{"line_number":110,"context_line":"    # 164: \u0027Parameter was not assigned an actual value\u0027,"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"}"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_ed431c12","line":110,"range":{"start_line":110,"start_character":4,"end_line":110,"end_character":10},"updated":"2019-01-28 12:28:55.000000000","message":"?","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"1b30556ac9e6ae130ece2d8c0384f34b88f2e08e","unresolved":false,"context_lines":[{"line_number":107,"context_line":"         \u0027\\\u0027parameters\\\u0027 block\u0027,"},{"line_number":108,"context_line":"    163: \u0027malformed get_param() clause\u0027,"},{"line_number":109,"context_line":"    164: \u0027Failed to resolve function\u0027,"},{"line_number":110,"context_line":"    # 164: \u0027Parameter was not assigned an actual value\u0027,"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"}"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_38e65f46","line":110,"range":{"start_line":110,"start_character":4,"end_line":110,"end_character":10},"in_reply_to":"9fdfeff1_ed431c12","updated":"2019-02-11 10:45:57.000000000","message":"Done","commit_id":"f2b63ba90571f15352055eb7cf694fda7ca81bc4"}],"vitrage/tests/functional/api_handler/test_templates.py":[{"author":{"_account_id":19134,"name":"Eyal","email":"eyalb1@gmail.com","username":"eyalb"},"change_message_id":"df4ae52c1d3150f2ab6475ab670b901fbad020ba","unresolved":false,"context_lines":[{"line_number":152,"context_line":"            self.assertEqual(\u0027ERROR\u0027, added_templates[0][\u0027status\u0027])"},{"line_number":153,"context_line":"            self.assertEqual(\u0027Failed to resolve parameter\u0027,"},{"line_number":154,"context_line":"                             added_templates[0][\u0027status details\u0027])"},{"line_number":155,"context_line":"        finally:"},{"line_number":156,"context_line":"            self.apis.delete_template(ctx\u003dNone,"},{"line_number":157,"context_line":"                                      uuids\u003d[added_templates[0][\u0027uuid\u0027]])"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def test_add_template_with_missing_param(self):"},{"line_number":160,"context_line":"        # Setup"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_841498a1","line":157,"range":{"start_line":155,"start_character":7,"end_line":157,"end_character":73},"updated":"2019-02-13 09:41:50.000000000","message":"use a teardown method","commit_id":"05d3375c8b7b60152afc27df1b7407e13f37ec35"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"64157d7aadd4e5dca00097a15efd51765001107b","unresolved":false,"context_lines":[{"line_number":152,"context_line":"            self.assertEqual(\u0027ERROR\u0027, added_templates[0][\u0027status\u0027])"},{"line_number":153,"context_line":"            self.assertEqual(\u0027Failed to resolve parameter\u0027,"},{"line_number":154,"context_line":"                             added_templates[0][\u0027status details\u0027])"},{"line_number":155,"context_line":"        finally:"},{"line_number":156,"context_line":"            self.apis.delete_template(ctx\u003dNone,"},{"line_number":157,"context_line":"                                      uuids\u003d[added_templates[0][\u0027uuid\u0027]])"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def test_add_template_with_missing_param(self):"},{"line_number":160,"context_line":"        # Setup"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_95d36038","line":157,"range":{"start_line":155,"start_character":7,"end_line":157,"end_character":73},"in_reply_to":"9fdfeff1_841498a1","updated":"2019-02-13 12:05:17.000000000","message":"Done","commit_id":"05d3375c8b7b60152afc27df1b7407e13f37ec35"},{"author":{"_account_id":26339,"name":"Muhamad Najjar","email":"muhamad.najjar@nokia.com","username":"7mode3294"},"change_message_id":"1582bd63a0b3eea06a5d0f7e82407bbe3f26ea72","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2019 - Nokia"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"# not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":6,"id":"9fdfeff1_6e31460b","line":1,"updated":"2019-02-13 17:24:08.000000000","message":"is one or more of the following cases can be checked ?\ntest with wrong def param\nor extra param\nor extra def","commit_id":"e785af94586bf79a704fd6e135477e5973edd1a7"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"87717cb82e233ac5fa7be46bd682f9ef90003fb0","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2019 - Nokia"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"# not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":6,"id":"9fdfeff1_602ce0ab","line":1,"in_reply_to":"9fdfeff1_6e31460b","updated":"2019-02-14 13:44:29.000000000","message":"There is no such thing as wrong def param - every param is a string and its actual value depends on the logic and can\u0027t be verified in a test.\n\nI added tests for extra param and extra param def.","commit_id":"e785af94586bf79a704fd6e135477e5973edd1a7"}]}
