)]}'
{"test-requirements.txt":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"56157e3b3e58f0b3ae0e8b60036c2c362e8479ab","unresolved":false,"context_lines":[{"line_number":13,"context_line":"testrepository\u003e\u003d0.0.18 # Apache-2.0/BSD"},{"line_number":14,"context_line":"testscenarios\u003e\u003d0.4 # Apache-2.0/BSD"},{"line_number":15,"context_line":"testtools\u003e\u003d1.4.0 # MIT"},{"line_number":16,"context_line":"voluptuous\u003e\u003d0.8.6 # BSD License"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"# Doc requirements"},{"line_number":19,"context_line":"oslosphinx!\u003d3.4.0,\u003e\u003d2.5.0 # Apache-2.0"}],"source_content_type":"text/plain","patch_set":1,"id":"da0c15f0_bef91ccb","line":16,"range":{"start_line":16,"start_character":0,"end_line":16,"end_character":31},"updated":"2016-03-29 09:07:38.000000000","message":"This is already in the requirements.txt file (see https://github.com/openstack/watcher/blob/master/requirements.txt#L22)","commit_id":"c325c78315525b57e70884e3066d5e633ff147ba"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"42d084e2f47ef559354df39997bcf060010d1f73","unresolved":false,"context_lines":[{"line_number":13,"context_line":"testrepository\u003e\u003d0.0.18 # Apache-2.0/BSD"},{"line_number":14,"context_line":"testscenarios\u003e\u003d0.4 # Apache-2.0/BSD"},{"line_number":15,"context_line":"testtools\u003e\u003d1.4.0 # MIT"},{"line_number":16,"context_line":"voluptuous\u003e\u003d0.8.6 # BSD License"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"# Doc requirements"},{"line_number":19,"context_line":"oslosphinx!\u003d3.4.0,\u003e\u003d2.5.0 # Apache-2.0"}],"source_content_type":"text/plain","patch_set":1,"id":"ba0121b8_cc5ebde8","line":16,"range":{"start_line":16,"start_character":0,"end_line":16,"end_character":31},"in_reply_to":"da0c15f0_bef91ccb","updated":"2016-03-30 03:14:40.000000000","message":"Ok.","commit_id":"c325c78315525b57e70884e3066d5e633ff147ba"}],"watcher/api/controllers/v1/audit.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"56157e3b3e58f0b3ae0e8b60036c2c362e8479ab","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                                          mandatory\u003dFalse)"},{"line_number":147,"context_line":"    \"\"\"The name of the audit template this audit refers to\"\"\""},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    parameter \u003d {wtypes.text: types.jsontype}"},{"line_number":150,"context_line":"    \"\"\"The strategy parameters for this audit\"\"\""},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    links \u003d wsme.wsattr([link.Link], readonly\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_9e1d3812","line":149,"range":{"start_line":149,"start_character":4,"end_line":149,"end_character":13},"updated":"2016-03-29 09:07:38.000000000","message":"s/parameter/parameters","commit_id":"c325c78315525b57e70884e3066d5e633ff147ba"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"42d084e2f47ef559354df39997bcf060010d1f73","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                                          mandatory\u003dFalse)"},{"line_number":147,"context_line":"    \"\"\"The name of the audit template this audit refers to\"\"\""},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    parameter \u003d {wtypes.text: types.jsontype}"},{"line_number":150,"context_line":"    \"\"\"The strategy parameters for this audit\"\"\""},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    links \u003d wsme.wsattr([link.Link], readonly\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba0121b8_6cc4d15e","line":149,"range":{"start_line":149,"start_character":4,"end_line":149,"end_character":13},"in_reply_to":"da0c15f0_9e1d3812","updated":"2016-03-30 03:14:40.000000000","message":"ok","commit_id":"c325c78315525b57e70884e3066d5e633ff147ba"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"7cbe49c1bfc0372301a77527379903a4094b2d9b","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    state \u003d wsme.wsattr(wtypes.text, readonly\u003dTrue,"},{"line_number":61,"context_line":"                        default\u003dobjects.audit.State.PENDING)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    parameter \u003d wtypes.wsattr({wtypes.text: types.jsontype}, mandatory\u003dFalse)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def as_audit(self):"},{"line_number":66,"context_line":"        audit_type_values \u003d [val.value for val in objects.audit.AuditType]"}],"source_content_type":"text/x-python","patch_set":7,"id":"9abb7d3a_007659a3","line":63,"range":{"start_line":63,"start_character":4,"end_line":63,"end_character":13},"updated":"2016-06-02 08:17:18.000000000","message":"s/parameter/parameters","commit_id":"770b774c16c78676687289c219f942deea566526"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"7cbe49c1bfc0372301a77527379903a4094b2d9b","unresolved":false,"context_lines":[{"line_number":152,"context_line":"                                          mandatory\u003dFalse)"},{"line_number":153,"context_line":"    \"\"\"The name of the audit template this audit refers to\"\"\""},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    parameter \u003d {wtypes.text: types.jsontype}"},{"line_number":156,"context_line":"    \"\"\"The strategy parameters for this audit\"\"\""},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    links \u003d wsme.wsattr([link.Link], readonly\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9abb7d3a_a05dcd16","line":155,"range":{"start_line":155,"start_character":4,"end_line":155,"end_character":13},"updated":"2016-06-02 08:17:18.000000000","message":"ditto","commit_id":"770b774c16c78676687289c219f942deea566526"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"0378a4456c4a4bc0999786148eb6d616d77a6c61","unresolved":false,"context_lines":[{"line_number":387,"context_line":"                    audit.parameters)"},{"line_number":388,"context_line":""},{"line_number":389,"context_line":"        if no_schema and audit.parameters:"},{"line_number":390,"context_line":"            raise exception.Invalid(\u0027Specify parameters but no predefined \u0027"},{"line_number":391,"context_line":"                                    \u0027strategy for audit template, or no \u0027"},{"line_number":392,"context_line":"                                    \u0027parameter support in predefined strategy\u0027)"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"        audit_dict \u003d audit.as_dict()"},{"line_number":395,"context_line":"        context \u003d pecan.request.context"}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_a9ca1f6c","line":392,"range":{"start_line":390,"start_character":36,"end_line":392,"end_character":78},"updated":"2016-06-23 12:56:42.000000000","message":"nit: should be translatable so can you wrap it with a _() please ?","commit_id":"6f1b8e5ade58f3f5f773522bf195aa2663450627"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"14a851680a179a33352d6b30f62b60d9643ed258","unresolved":false,"context_lines":[{"line_number":387,"context_line":"                    audit.parameters)"},{"line_number":388,"context_line":""},{"line_number":389,"context_line":"        if no_schema and audit.parameters:"},{"line_number":390,"context_line":"            raise exception.Invalid(\u0027Specify parameters but no predefined \u0027"},{"line_number":391,"context_line":"                                    \u0027strategy for audit template, or no \u0027"},{"line_number":392,"context_line":"                                    \u0027parameter support in predefined strategy\u0027)"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"        audit_dict \u003d audit.as_dict()"},{"line_number":395,"context_line":"        context \u003d pecan.request.context"}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_557b1a28","line":392,"range":{"start_line":390,"start_character":36,"end_line":392,"end_character":78},"in_reply_to":"3aaa91ec_a9ca1f6c","updated":"2016-06-24 07:55:33.000000000","message":"done.","commit_id":"6f1b8e5ade58f3f5f773522bf195aa2663450627"}],"watcher/api/controllers/v1/audit_template.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"56157e3b3e58f0b3ae0e8b60036c2c362e8479ab","unresolved":false,"context_lines":[{"line_number":312,"context_line":"        # Set the HTTP Location Header"},{"line_number":313,"context_line":"        pecan.response.location \u003d link.build_url(\u0027audit_templates\u0027,"},{"line_number":314,"context_line":"                                                 new_audit_template.uuid)"},{"line_number":315,"context_line":"        dc_client \u003d rpcapi.DecisionEngineAPI()"},{"line_number":316,"context_line":"        dc_client.setup_audit_template(context, new_audit_template.uuid)"},{"line_number":317,"context_line":""},{"line_number":318,"context_line":"        return AuditTemplate.convert_with_links(new_audit_template)"},{"line_number":319,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_be5e3c43","line":316,"range":{"start_line":315,"start_character":0,"end_line":316,"end_character":72},"updated":"2016-03-29 09:07:38.000000000","message":"The Watcher API can be decoupled from the Decision Engine here. So the idea here would be populate the DB with the list of all the existing strategies along with their parameters info.","commit_id":"c325c78315525b57e70884e3066d5e633ff147ba"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"42d084e2f47ef559354df39997bcf060010d1f73","unresolved":false,"context_lines":[{"line_number":312,"context_line":"        # Set the HTTP Location Header"},{"line_number":313,"context_line":"        pecan.response.location \u003d link.build_url(\u0027audit_templates\u0027,"},{"line_number":314,"context_line":"                                                 new_audit_template.uuid)"},{"line_number":315,"context_line":"        dc_client \u003d rpcapi.DecisionEngineAPI()"},{"line_number":316,"context_line":"        dc_client.setup_audit_template(context, new_audit_template.uuid)"},{"line_number":317,"context_line":""},{"line_number":318,"context_line":"        return AuditTemplate.convert_with_links(new_audit_template)"},{"line_number":319,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ba0121b8_6cc0512b","line":316,"range":{"start_line":315,"start_character":0,"end_line":316,"end_character":72},"in_reply_to":"da0c15f0_be5e3c43","updated":"2016-03-30 03:14:40.000000000","message":"Vincent,\nIt is only valid after your changes to the strategy/goal, right?","commit_id":"c325c78315525b57e70884e3066d5e633ff147ba"}],"watcher/api/controllers/v1/strategy.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"7cbe49c1bfc0372301a77527379903a4094b2d9b","unresolved":false,"context_lines":[{"line_number":97,"context_line":"                                mandatory\u003dTrue)"},{"line_number":98,"context_line":"    \"\"\"The UUID of the goal this audit refers to\"\"\""},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    param_info \u003d {wtypes.text: types.jsontype}"},{"line_number":101,"context_line":"    \"\"\" Parameters info dict\"\"\""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def __init__(self, **kwargs):"}],"source_content_type":"text/x-python","patch_set":7,"id":"9abb7d3a_80dfe967","line":100,"range":{"start_line":100,"start_character":4,"end_line":100,"end_character":14},"updated":"2016-06-02 08:17:18.000000000","message":"IMHO, we should call this parameters_schema or parameters_spec","commit_id":"770b774c16c78676687289c219f942deea566526"}],"watcher/common/utils.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"0378a4456c4a4bc0999786148eb6d616d77a6c61","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"\"\"\"Utilities and helper functions.\"\"\""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from jsonschema import Draft4Validator"},{"line_number":20,"context_line":"from jsonschema import validators"},{"line_number":21,"context_line":"from oslo_config import cfg"},{"line_number":22,"context_line":"from oslo_log import log as logging"}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_a9cdff5e","line":19,"range":{"start_line":19,"start_character":23,"end_line":19,"end_character":38},"updated":"2016-06-23 12:56:42.000000000","message":"can you import the module instead of the class here please?","commit_id":"6f1b8e5ade58f3f5f773522bf195aa2663450627"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"14a851680a179a33352d6b30f62b60d9643ed258","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"\"\"\"Utilities and helper functions.\"\"\""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from jsonschema import Draft4Validator"},{"line_number":20,"context_line":"from jsonschema import validators"},{"line_number":21,"context_line":"from oslo_config import cfg"},{"line_number":22,"context_line":"from oslo_log import log as logging"}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_2753c56c","line":19,"range":{"start_line":19,"start_character":23,"end_line":19,"end_character":38},"in_reply_to":"3aaa91ec_a9cdff5e","updated":"2016-06-24 07:55:33.000000000","message":"jsonschema/__init__.py import all commonly used class for usage. jsonschema\u0027s example also uses \u0027import Draft4Validator\u0027. \n\nAnyway, I\u0027ll change it:)","commit_id":"6f1b8e5ade58f3f5f773522bf195aa2663450627"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"0378a4456c4a4bc0999786148eb6d616d77a6c61","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    validate_properties \u003d validator_class.VALIDATORS[\"properties\"]"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    def set_defaults(validator, properties, instance, schema):"},{"line_number":141,"context_line":"        for property, subschema in properties.iteritems():"},{"line_number":142,"context_line":"            if \"default\" in subschema:"},{"line_number":143,"context_line":"                instance.setdefault(property, subschema[\"default\"])"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_61104ba9","line":141,"range":{"start_line":141,"start_character":46,"end_line":141,"end_character":55},"updated":"2016-06-23 12:56:42.000000000","message":"iteritems() is not a py34 valid syntax: use items() instead","commit_id":"6f1b8e5ade58f3f5f773522bf195aa2663450627"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"0378a4456c4a4bc0999786148eb6d616d77a6c61","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    validate_properties \u003d validator_class.VALIDATORS[\"properties\"]"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    def set_defaults(validator, properties, instance, schema):"},{"line_number":141,"context_line":"        for property, subschema in properties.iteritems():"},{"line_number":142,"context_line":"            if \"default\" in subschema:"},{"line_number":143,"context_line":"                instance.setdefault(property, subschema[\"default\"])"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_899ac361","line":141,"range":{"start_line":141,"start_character":12,"end_line":141,"end_character":20},"updated":"2016-06-23 12:56:42.000000000","message":"nit: can you rename \u0027property\u0027 since it\u0027s overriding the python built-in property() decorator?","commit_id":"6f1b8e5ade58f3f5f773522bf195aa2663450627"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"14a851680a179a33352d6b30f62b60d9643ed258","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    validate_properties \u003d validator_class.VALIDATORS[\"properties\"]"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    def set_defaults(validator, properties, instance, schema):"},{"line_number":141,"context_line":"        for property, subschema in properties.iteritems():"},{"line_number":142,"context_line":"            if \"default\" in subschema:"},{"line_number":143,"context_line":"                instance.setdefault(property, subschema[\"default\"])"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_67a82d78","line":141,"range":{"start_line":141,"start_character":46,"end_line":141,"end_character":55},"in_reply_to":"3aaa91ec_61104ba9","updated":"2016-06-24 07:55:33.000000000","message":"Done","commit_id":"6f1b8e5ade58f3f5f773522bf195aa2663450627"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"14a851680a179a33352d6b30f62b60d9643ed258","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    validate_properties \u003d validator_class.VALIDATORS[\"properties\"]"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    def set_defaults(validator, properties, instance, schema):"},{"line_number":141,"context_line":"        for property, subschema in properties.iteritems():"},{"line_number":142,"context_line":"            if \"default\" in subschema:"},{"line_number":143,"context_line":"                instance.setdefault(property, subschema[\"default\"])"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_c7b761d6","line":141,"range":{"start_line":141,"start_character":12,"end_line":141,"end_character":20},"in_reply_to":"3aaa91ec_899ac361","updated":"2016-06-24 07:55:33.000000000","message":"Rename to prop.","commit_id":"6f1b8e5ade58f3f5f773522bf195aa2663450627"}],"watcher/db/sqlalchemy/models.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"56157e3b3e58f0b3ae0e8b60036c2c362e8479ab","unresolved":false,"context_lines":[{"line_number":127,"context_line":"    goal \u003d Column(String(63), nullable\u003dTrue)"},{"line_number":128,"context_line":"    extra \u003d Column(JSONEncodedDict)"},{"line_number":129,"context_line":"    strategy \u003d Column(String(63), nullable\u003dTrue)"},{"line_number":130,"context_line":"    strategy_para_info \u003d Column(JSONEncodedDict, nullable\u003dTrue)"},{"line_number":131,"context_line":"    version \u003d Column(String(15), nullable\u003dTrue)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_a110dd4f","line":130,"range":{"start_line":130,"start_character":4,"end_line":130,"end_character":22},"updated":"2016-03-29 09:07:38.000000000","message":"IMHO, we should create a new Strategy model and put this field into it. (see https://review.openstack.org/#/c/296633/3/watcher/db/sqlalchemy/models.py)","commit_id":"c325c78315525b57e70884e3066d5e633ff147ba"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"42d084e2f47ef559354df39997bcf060010d1f73","unresolved":false,"context_lines":[{"line_number":127,"context_line":"    goal \u003d Column(String(63), nullable\u003dTrue)"},{"line_number":128,"context_line":"    extra \u003d Column(JSONEncodedDict)"},{"line_number":129,"context_line":"    strategy \u003d Column(String(63), nullable\u003dTrue)"},{"line_number":130,"context_line":"    strategy_para_info \u003d Column(JSONEncodedDict, nullable\u003dTrue)"},{"line_number":131,"context_line":"    version \u003d Column(String(15), nullable\u003dTrue)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ba0121b8_cceebd8a","line":130,"range":{"start_line":130,"start_character":4,"end_line":130,"end_character":22},"in_reply_to":"da0c15f0_a110dd4f","updated":"2016-03-30 03:14:40.000000000","message":"If we decide to take goal/strategy model first, I need rebase my patch after your merge. Don\u0027t know if I can catch the rc-final.","commit_id":"c325c78315525b57e70884e3066d5e633ff147ba"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"56157e3b3e58f0b3ae0e8b60036c2c362e8479ab","unresolved":false,"context_lines":[{"line_number":146,"context_line":"    deadline \u003d Column(DateTime, nullable\u003dTrue)"},{"line_number":147,"context_line":"    audit_template_id \u003d Column(Integer, ForeignKey(\u0027audit_templates.id\u0027),"},{"line_number":148,"context_line":"                               nullable\u003dFalse)"},{"line_number":149,"context_line":"    parameter \u003d Column(JSONEncodedDict, nullable\u003dTrue)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"class Action(Base):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_e13135ee","line":149,"range":{"start_line":149,"start_character":4,"end_line":149,"end_character":13},"updated":"2016-03-29 09:07:38.000000000","message":"s/parameter/parameters","commit_id":"c325c78315525b57e70884e3066d5e633ff147ba"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"42d084e2f47ef559354df39997bcf060010d1f73","unresolved":false,"context_lines":[{"line_number":146,"context_line":"    deadline \u003d Column(DateTime, nullable\u003dTrue)"},{"line_number":147,"context_line":"    audit_template_id \u003d Column(Integer, ForeignKey(\u0027audit_templates.id\u0027),"},{"line_number":148,"context_line":"                               nullable\u003dFalse)"},{"line_number":149,"context_line":"    parameter \u003d Column(JSONEncodedDict, nullable\u003dTrue)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"class Action(Base):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba0121b8_0cff1568","line":149,"range":{"start_line":149,"start_character":4,"end_line":149,"end_character":13},"in_reply_to":"da0c15f0_e13135ee","updated":"2016-03-30 03:14:40.000000000","message":"ok","commit_id":"c325c78315525b57e70884e3066d5e633ff147ba"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"7cbe49c1bfc0372301a77527379903a4094b2d9b","unresolved":false,"context_lines":[{"line_number":123,"context_line":"    name \u003d Column(String(63), nullable\u003dFalse)"},{"line_number":124,"context_line":"    display_name \u003d Column(String(63), nullable\u003dFalse)"},{"line_number":125,"context_line":"    goal_id \u003d Column(Integer, ForeignKey(\u0027goals.id\u0027), nullable\u003dFalse)"},{"line_number":126,"context_line":"    param_info \u003d Column(JSONEncodedDict, nullable\u003dTrue)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"class Goal(Base):"}],"source_content_type":"text/x-python","patch_set":7,"id":"9abb7d3a_e03d1590","line":126,"range":{"start_line":126,"start_character":4,"end_line":126,"end_character":14},"updated":"2016-06-02 08:17:18.000000000","message":"ditto: IMHO, I would rather call this parameters_schema or parameters_spec","commit_id":"770b774c16c78676687289c219f942deea566526"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"7cbe49c1bfc0372301a77527379903a4094b2d9b","unresolved":false,"context_lines":[{"line_number":174,"context_line":"    deadline \u003d Column(DateTime, nullable\u003dTrue)"},{"line_number":175,"context_line":"    audit_template_id \u003d Column(Integer, ForeignKey(\u0027audit_templates.id\u0027),"},{"line_number":176,"context_line":"                               nullable\u003dFalse)"},{"line_number":177,"context_line":"    parameter \u003d Column(JSONEncodedDict, nullable\u003dTrue)"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"class Action(Base):"}],"source_content_type":"text/x-python","patch_set":7,"id":"9abb7d3a_4056a1ce","line":177,"range":{"start_line":177,"start_character":4,"end_line":177,"end_character":13},"updated":"2016-06-02 08:17:18.000000000","message":"s/parameter/parameters (plural)","commit_id":"770b774c16c78676687289c219f942deea566526"}],"watcher/decision_engine/strategy/context/default.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"56157e3b3e58f0b3ae0e8b60036c2c362e8479ab","unresolved":false,"context_lines":[{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        # todo(jed) remove call to get_latest_cluster_data_model"},{"line_number":57,"context_line":"        cluster_data_model \u003d collector_manager.get_latest_cluster_data_model()"},{"line_number":58,"context_line":"        # cluster_data_model \u003d {}"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"        selected_strategy \u003d self.strategy_selector.define_from_goal("},{"line_number":61,"context_line":"            audit_template.goal, osc\u003dosc)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_011b891c","line":58,"range":{"start_line":58,"start_character":8,"end_line":58,"end_character":33},"updated":"2016-03-29 09:07:38.000000000","message":"nit: useless comment here","commit_id":"c325c78315525b57e70884e3066d5e633ff147ba"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"42d084e2f47ef559354df39997bcf060010d1f73","unresolved":false,"context_lines":[{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        # todo(jed) remove call to get_latest_cluster_data_model"},{"line_number":57,"context_line":"        cluster_data_model \u003d collector_manager.get_latest_cluster_data_model()"},{"line_number":58,"context_line":"        # cluster_data_model \u003d {}"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"        selected_strategy \u003d self.strategy_selector.define_from_goal("},{"line_number":61,"context_line":"            audit_template.goal, osc\u003dosc)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba0121b8_cc951de5","line":58,"range":{"start_line":58,"start_character":8,"end_line":58,"end_character":33},"in_reply_to":"da0c15f0_011b891c","updated":"2016-03-30 03:14:40.000000000","message":"it\u0027s for debug only. Will remove it.","commit_id":"c325c78315525b57e70884e3066d5e633ff147ba"}],"watcher/decision_engine/strategy/strategies/base.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"7cbe49c1bfc0372301a77527379903a4094b2d9b","unresolved":false,"context_lines":[{"line_number":50,"context_line":"class Parameter(object):"},{"line_number":51,"context_line":"    \"\"\"Base class for all strategy Parameters"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    A Parameter defines the spec of parameters for related Strategy, and holds"},{"line_number":54,"context_line":"    the value of parameters for use when Strategy execution."},{"line_number":55,"context_line":"    \"\"\""},{"line_number":56,"context_line":"    SPEC \u003d {}"},{"line_number":57,"context_line":"    SCHEMA \u003d {}"}],"source_content_type":"text/x-python","patch_set":7,"id":"9abb7d3a_401ea15f","line":54,"range":{"start_line":53,"start_character":3,"end_line":54,"end_character":59},"updated":"2016-06-02 08:17:18.000000000","message":"IMHO, there should be a separation of concerns between defining the parameters specs and actually holding the parameters.\n\nCan you also write down the documentation that explains how a strategy developer will write down the parameters spec for a strategy?","commit_id":"770b774c16c78676687289c219f942deea566526"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"8717b15c273d7b6e5d0e91c5e8866f2ec27f175c","unresolved":false,"context_lines":[{"line_number":50,"context_line":"class Parameter(object):"},{"line_number":51,"context_line":"    \"\"\"Base class for all strategy Parameters"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    A Parameter defines the spec of parameters for related Strategy, and holds"},{"line_number":54,"context_line":"    the value of parameters for use when Strategy execution."},{"line_number":55,"context_line":"    \"\"\""},{"line_number":56,"context_line":"    SPEC \u003d {}"},{"line_number":57,"context_line":"    SCHEMA \u003d {}"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_466816f6","line":54,"range":{"start_line":53,"start_character":3,"end_line":54,"end_character":59},"in_reply_to":"7aa08908_95998a71","updated":"2016-06-06 09:33:09.000000000","message":"It\u0027s just that conceptually, parameter specs belong to the strategy they are related to whereas the parameters\u0027 values are actually belonging to an audit","commit_id":"770b774c16c78676687289c219f942deea566526"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"32d04d9abdf1c9675ed1f9c04e548d58be799dad","unresolved":false,"context_lines":[{"line_number":50,"context_line":"class Parameter(object):"},{"line_number":51,"context_line":"    \"\"\"Base class for all strategy Parameters"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    A Parameter defines the spec of parameters for related Strategy, and holds"},{"line_number":54,"context_line":"    the value of parameters for use when Strategy execution."},{"line_number":55,"context_line":"    \"\"\""},{"line_number":56,"context_line":"    SPEC \u003d {}"},{"line_number":57,"context_line":"    SCHEMA \u003d {}"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_95998a71","line":54,"range":{"start_line":53,"start_character":3,"end_line":54,"end_character":59},"in_reply_to":"9abb7d3a_401ea15f","updated":"2016-06-06 08:23:09.000000000","message":"Vincent,\nI\u0027d rather put specs and values in one single place, where handles everything for parameter. User just derives one new class with new schema format, which is more OOP.","commit_id":"770b774c16c78676687289c219f942deea566526"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"7cbe49c1bfc0372301a77527379903a4094b2d9b","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    A Parameter defines the spec of parameters for related Strategy, and holds"},{"line_number":54,"context_line":"    the value of parameters for use when Strategy execution."},{"line_number":55,"context_line":"    \"\"\""},{"line_number":56,"context_line":"    SPEC \u003d {}"},{"line_number":57,"context_line":"    SCHEMA \u003d {}"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def __init__(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"9abb7d3a_3b6c6ccf","line":56,"range":{"start_line":56,"start_character":4,"end_line":56,"end_character":8},"updated":"2016-06-02 08:17:18.000000000","message":"IMHO, this should be a classmethod that the strategy developer implements like https://github.com/openstack/watcher/blob/master/watcher/applier/actions/base.py#L121-L129 or https://github.com/openstack/watcher/blob/master/watcher/decision_engine/strategy/strategies/base.py#L69-L73","commit_id":"770b774c16c78676687289c219f942deea566526"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"32d04d9abdf1c9675ed1f9c04e548d58be799dad","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    A Parameter defines the spec of parameters for related Strategy, and holds"},{"line_number":54,"context_line":"    the value of parameters for use when Strategy execution."},{"line_number":55,"context_line":"    \"\"\""},{"line_number":56,"context_line":"    SPEC \u003d {}"},{"line_number":57,"context_line":"    SCHEMA \u003d {}"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def __init__(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_35941636","line":56,"range":{"start_line":56,"start_character":4,"end_line":56,"end_character":8},"in_reply_to":"9abb7d3a_3b6c6ccf","updated":"2016-06-06 08:23:09.000000000","message":"Good point.\nI\u0027ll try it.","commit_id":"770b774c16c78676687289c219f942deea566526"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"7cbe49c1bfc0372301a77527379903a4094b2d9b","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    SPEC \u003d {}"},{"line_number":57,"context_line":"    SCHEMA \u003d {}"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def __init__(self):"},{"line_number":60,"context_line":"        # Build Schema according to SPEC"},{"line_number":61,"context_line":"        if type(self).SCHEMA:"},{"line_number":62,"context_line":"            return"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        for para_name in type(self).SPEC.keys():"},{"line_number":65,"context_line":"            spec \u003d type(self).SPEC[para_name]"},{"line_number":66,"context_line":"            min \u003d spec.get(\u0027min\u0027)"},{"line_number":67,"context_line":"            max \u003d spec.get(\u0027max\u0027)"},{"line_number":68,"context_line":"            default \u003d spec.get(\u0027default\u0027) or voluptuous.UNDEFINED"},{"line_number":69,"context_line":"            if spec.get(\u0027type\u0027) \u003d\u003d \u0027int\u0027:"},{"line_number":70,"context_line":"                dtype \u003d int"},{"line_number":71,"context_line":"            elif spec.get(\u0027type\u0027) \u003d\u003d \u0027float\u0027:"},{"line_number":72,"context_line":"                dtype \u003d float"},{"line_number":73,"context_line":"            else:"},{"line_number":74,"context_line":"                dtype \u003d int"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"            key \u003d voluptuous.Required(para_name, default\u003ddefault)"},{"line_number":77,"context_line":"            val \u003d voluptuous.All(dtype, voluptuous.Range(min\u003dmin, max\u003dmax))"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"            type(self).SCHEMA[key] \u003d val"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def info(self):"},{"line_number":82,"context_line":"        return type(self).SPEC"}],"source_content_type":"text/x-python","patch_set":7,"id":"9abb7d3a_7bc6f49a","line":79,"range":{"start_line":59,"start_character":1,"end_line":79,"end_character":40},"updated":"2016-06-02 08:17:18.000000000","message":"IMHO, this is too restrictive in terms validation. I would argue we should use jsonschema here to validate the strategy parameters as it is a serializable format which can hence be both exposed and used by the Watcher API to validate the operator inputs.","commit_id":"770b774c16c78676687289c219f942deea566526"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"8717b15c273d7b6e5d0e91c5e8866f2ec27f175c","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    SPEC \u003d {}"},{"line_number":57,"context_line":"    SCHEMA \u003d {}"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def __init__(self):"},{"line_number":60,"context_line":"        # Build Schema according to SPEC"},{"line_number":61,"context_line":"        if type(self).SCHEMA:"},{"line_number":62,"context_line":"            return"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        for para_name in type(self).SPEC.keys():"},{"line_number":65,"context_line":"            spec \u003d type(self).SPEC[para_name]"},{"line_number":66,"context_line":"            min \u003d spec.get(\u0027min\u0027)"},{"line_number":67,"context_line":"            max \u003d spec.get(\u0027max\u0027)"},{"line_number":68,"context_line":"            default \u003d spec.get(\u0027default\u0027) or voluptuous.UNDEFINED"},{"line_number":69,"context_line":"            if spec.get(\u0027type\u0027) \u003d\u003d \u0027int\u0027:"},{"line_number":70,"context_line":"                dtype \u003d int"},{"line_number":71,"context_line":"            elif spec.get(\u0027type\u0027) \u003d\u003d \u0027float\u0027:"},{"line_number":72,"context_line":"                dtype \u003d float"},{"line_number":73,"context_line":"            else:"},{"line_number":74,"context_line":"                dtype \u003d int"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"            key \u003d voluptuous.Required(para_name, default\u003ddefault)"},{"line_number":77,"context_line":"            val \u003d voluptuous.All(dtype, voluptuous.Range(min\u003dmin, max\u003dmax))"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"            type(self).SCHEMA[key] \u003d val"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def info(self):"},{"line_number":82,"context_line":"        return type(self).SPEC"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_fbb6ff3b","line":79,"range":{"start_line":59,"start_character":1,"end_line":79,"end_character":40},"in_reply_to":"7aa08908_15f3da9f","updated":"2016-06-06 09:33:09.000000000","message":"I agree they are 2 different questions but they are kind of intertwined.\n\nMy point is that we should be validating the strategy parameters as early as possible.\n\nSo here below is my understanding of the workflow:\n\n- The operator creates an audit template (with or without\n  a predefined strategy)\n- The operator starts an audit using this audit template\n -\u003eCase 1: If no strategy was provided, I agree we cannot\n   validate the parameters: should we still be able to\n   provide parameters other than the defaults if don\u0027t even\n   know what shall be run? BTW, that is a case we have yet\n   to discuss as it is not described in the specs.\n -\u003eCase 2: If a strategy has been provided, then we know\n   the parameters we should apply, which means we can\n   potentially validate the strategy parameters at the API\n   level if the parameters spec/schema can be serialized /\n   deserialized within the DB.\n- The audit is started and uses these parameters as inputs\n  to produce a solution as well as an action plan.\n\nIMHO, case 1 is something we should not handle because parameters could be misused as the same parameter name may have a different use within strategies achieving a same goal. Also, how can an operator tell which parameter to provide in this case? How will he/she react in case of an error? If we do so, this also means that all strategy parameters should have a default value and accept the fact that any strategy that has been automatically selected by Watcher will only use these default values.\n\nWith regards to case 2, what I was trying to tell you in my previous comment is that we cannot serialize/deserialize your intermediate format (nor can we do it with standard voluptuous), but this would actually be possible using jsonschema. The advantage of doing so is that the operator will be able to instantly tell that the provided value is incorrect, which would significantly reduce the amount of time spent \"debugging\".\n\nThese are new cases we were not covered by the original specs since they were introduced by the blueprint get-goal-from-strategy so I think we need to make everyone agree on this.","commit_id":"770b774c16c78676687289c219f942deea566526"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"32d04d9abdf1c9675ed1f9c04e548d58be799dad","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    SPEC \u003d {}"},{"line_number":57,"context_line":"    SCHEMA \u003d {}"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def __init__(self):"},{"line_number":60,"context_line":"        # Build Schema according to SPEC"},{"line_number":61,"context_line":"        if type(self).SCHEMA:"},{"line_number":62,"context_line":"            return"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        for para_name in type(self).SPEC.keys():"},{"line_number":65,"context_line":"            spec \u003d type(self).SPEC[para_name]"},{"line_number":66,"context_line":"            min \u003d spec.get(\u0027min\u0027)"},{"line_number":67,"context_line":"            max \u003d spec.get(\u0027max\u0027)"},{"line_number":68,"context_line":"            default \u003d spec.get(\u0027default\u0027) or voluptuous.UNDEFINED"},{"line_number":69,"context_line":"            if spec.get(\u0027type\u0027) \u003d\u003d \u0027int\u0027:"},{"line_number":70,"context_line":"                dtype \u003d int"},{"line_number":71,"context_line":"            elif spec.get(\u0027type\u0027) \u003d\u003d \u0027float\u0027:"},{"line_number":72,"context_line":"                dtype \u003d float"},{"line_number":73,"context_line":"            else:"},{"line_number":74,"context_line":"                dtype \u003d int"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"            key \u003d voluptuous.Required(para_name, default\u003ddefault)"},{"line_number":77,"context_line":"            val \u003d voluptuous.All(dtype, voluptuous.Range(min\u003dmin, max\u003dmax))"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"            type(self).SCHEMA[key] \u003d val"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def info(self):"},{"line_number":82,"context_line":"        return type(self).SPEC"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_15f3da9f","line":79,"range":{"start_line":59,"start_character":1,"end_line":79,"end_character":40},"in_reply_to":"9abb7d3a_7bc6f49a","updated":"2016-06-06 08:23:09.000000000","message":"validation lib is one question, while where to do the validation is another one.\n\nThe issue of API validation is: API can\u0027t locate the right strategy for parameter spec.","commit_id":"770b774c16c78676687289c219f942deea566526"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"7cbe49c1bfc0372301a77527379903a4094b2d9b","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    def schema(self):"},{"line_number":86,"context_line":"        return voluptuous.Schema(type(self).SCHEMA)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def __setattr__(self, name, value):"},{"line_number":89,"context_line":"        if name \u003d\u003d \u0027values\u0027:"},{"line_number":90,"context_line":"            value \u003d self.schema(value)"},{"line_number":91,"context_line":"            # TODO(gzhai):catch exception and adjust the value"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        super(Parameter, self).__setattr__(name, value)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9abb7d3a_bb6a1c7f","line":93,"range":{"start_line":88,"start_character":0,"end_line":93,"end_character":55},"updated":"2016-06-02 08:17:18.000000000","message":"ditto on the separation of concerns.","commit_id":"770b774c16c78676687289c219f942deea566526"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"32d04d9abdf1c9675ed1f9c04e548d58be799dad","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    def schema(self):"},{"line_number":86,"context_line":"        return voluptuous.Schema(type(self).SCHEMA)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def __setattr__(self, name, value):"},{"line_number":89,"context_line":"        if name \u003d\u003d \u0027values\u0027:"},{"line_number":90,"context_line":"            value \u003d self.schema(value)"},{"line_number":91,"context_line":"            # TODO(gzhai):catch exception and adjust the value"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        super(Parameter, self).__setattr__(name, value)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_551282b5","line":93,"range":{"start_line":88,"start_character":0,"end_line":93,"end_character":55},"in_reply_to":"9abb7d3a_bb6a1c7f","updated":"2016-06-06 08:23:09.000000000","message":"Vincent,\nCan we keep it at this point, can see if it can work well?","commit_id":"770b774c16c78676687289c219f942deea566526"}],"watcher/decision_engine/strategy/strategies/dummy_strategy.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"56157e3b3e58f0b3ae0e8b60036c2c362e8479ab","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def __init__(self, name\u003dDEFAULT_NAME, description\u003dDEFAULT_DESCRIPTION,"},{"line_number":73,"context_line":"                 osc\u003dNone):"},{"line_number":74,"context_line":"        para \u003d DummyParameter()"},{"line_number":75,"context_line":"        super(DummyStrategy, self).__init__(name, description, osc, para)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def execute(self, original_model):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_810cb995","line":74,"range":{"start_line":74,"start_character":8,"end_line":74,"end_character":12},"updated":"2016-03-29 09:07:38.000000000","message":"nit: s/para/param","commit_id":"c325c78315525b57e70884e3066d5e633ff147ba"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"42d084e2f47ef559354df39997bcf060010d1f73","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def __init__(self, name\u003dDEFAULT_NAME, description\u003dDEFAULT_DESCRIPTION,"},{"line_number":73,"context_line":"                 osc\u003dNone):"},{"line_number":74,"context_line":"        para \u003d DummyParameter()"},{"line_number":75,"context_line":"        super(DummyStrategy, self).__init__(name, description, osc, para)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def execute(self, original_model):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba0121b8_8c304503","line":74,"range":{"start_line":74,"start_character":8,"end_line":74,"end_character":12},"in_reply_to":"da0c15f0_810cb995","updated":"2016-03-30 03:14:40.000000000","message":"ok","commit_id":"c325c78315525b57e70884e3066d5e633ff147ba"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"56157e3b3e58f0b3ae0e8b60036c2c362e8479ab","unresolved":false,"context_lines":[{"line_number":77,"context_line":"    def execute(self, original_model):"},{"line_number":78,"context_line":"        para1 \u003d self.parameter.values.get(\u0027para1\u0027)"},{"line_number":79,"context_line":"        para2 \u003d self.parameter.values.get(\u0027para2\u0027)"},{"line_number":80,"context_line":"        LOG.debug(\"Executing Dummy strategy with para1\u003d%d, para2\u003d%f\" %"},{"line_number":81,"context_line":"                  (para1, para2))"},{"line_number":82,"context_line":"        parameters \u003d {\u0027message\u0027: \u0027hello World\u0027}"},{"line_number":83,"context_line":"        self.solution.add_action(action_type\u003dself.NOP,"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_c18991cc","line":80,"range":{"start_line":80,"start_character":69,"end_line":80,"end_character":70},"updated":"2016-03-29 09:07:38.000000000","message":"nit: You\u0027re within a log.debug() so IMHO we should do it like in http://docs.openstack.org/developer/hacking/#internationalization-i18n-strings where they use a comma and named parameters.","commit_id":"c325c78315525b57e70884e3066d5e633ff147ba"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"42d084e2f47ef559354df39997bcf060010d1f73","unresolved":false,"context_lines":[{"line_number":77,"context_line":"    def execute(self, original_model):"},{"line_number":78,"context_line":"        para1 \u003d self.parameter.values.get(\u0027para1\u0027)"},{"line_number":79,"context_line":"        para2 \u003d self.parameter.values.get(\u0027para2\u0027)"},{"line_number":80,"context_line":"        LOG.debug(\"Executing Dummy strategy with para1\u003d%d, para2\u003d%f\" %"},{"line_number":81,"context_line":"                  (para1, para2))"},{"line_number":82,"context_line":"        parameters \u003d {\u0027message\u0027: \u0027hello World\u0027}"},{"line_number":83,"context_line":"        self.solution.add_action(action_type\u003dself.NOP,"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba0121b8_2c2139b5","line":80,"range":{"start_line":80,"start_character":69,"end_line":80,"end_character":70},"in_reply_to":"da0c15f0_c18991cc","updated":"2016-03-30 03:14:40.000000000","message":"ok","commit_id":"c325c78315525b57e70884e3066d5e633ff147ba"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"7cbe49c1bfc0372301a77527379903a4094b2d9b","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class DummyParameter(base.Parameter):"},{"line_number":28,"context_line":"    SPEC \u003d {"},{"line_number":29,"context_line":"        \u0027para1\u0027: {"},{"line_number":30,"context_line":"            \u0027description\u0027: \u0027Test parameter for dummy strategy\u0027,"},{"line_number":31,"context_line":"            \u0027type\u0027: \u0027int\u0027,"},{"line_number":32,"context_line":"            \u0027default\u0027: 10,"},{"line_number":33,"context_line":"            \u0027min\u0027: 1,"},{"line_number":34,"context_line":"            \u0027max\u0027: 20"},{"line_number":35,"context_line":"        },"},{"line_number":36,"context_line":"        \u0027para2\u0027: {"},{"line_number":37,"context_line":"            \u0027description\u0027: \u0027Test parameter2 for dummy strategy\u0027,"},{"line_number":38,"context_line":"            \u0027type\u0027: \u0027float\u0027,"},{"line_number":39,"context_line":"            \u0027default\u0027: 1.0,"},{"line_number":40,"context_line":"            \u0027max\u0027: 10.0"},{"line_number":41,"context_line":"        },"},{"line_number":42,"context_line":"    }"},{"line_number":43,"context_line":"    SCHEMA \u003d {}"},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9abb7d3a_3bcf4c2a","line":41,"range":{"start_line":29,"start_character":0,"end_line":41,"end_character":10},"updated":"2016-06-02 08:17:18.000000000","message":"As stated before, I would be in favor of using the jsonschema notation (see https://pypi.python.org/pypi/jsonschema) to express the parameters spec.","commit_id":"770b774c16c78676687289c219f942deea566526"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"7cbe49c1bfc0372301a77527379903a4094b2d9b","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        super(DummyStrategy, self).__init__(config, osc, param)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def execute(self, original_model):"},{"line_number":81,"context_line":"        para1 \u003d self.parameter.values.get(\u0027para1\u0027)"},{"line_number":82,"context_line":"        para2 \u003d self.parameter.values.get(\u0027para2\u0027)"},{"line_number":83,"context_line":"        LOG.debug(\"Executing Dummy strategy with para1\u003d%(p1)d, para2\u003d%(p2)f\","},{"line_number":84,"context_line":"                  {\u0027p1\u0027: para1, \u0027p2\u0027: para2})"}],"source_content_type":"text/x-python","patch_set":7,"id":"9abb7d3a_7ba554a0","line":81,"range":{"start_line":81,"start_character":16,"end_line":81,"end_character":50},"updated":"2016-06-02 08:17:18.000000000","message":"Everything that is meant to be exposed to a plugin developer should be as easy to use as possible. So in the case of self.parameters, I would argue we it should of type Struct (see https://github.com/openstack/watcher/blob/master/watcher/common/utils.py#L44) so it provides them both the dictionary and the dot notation.","commit_id":"770b774c16c78676687289c219f942deea566526"}],"watcher/decision_engine/sync.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"0378a4456c4a4bc0999786148eb6d616d77a6c61","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                StrategyMapping("},{"line_number":93,"context_line":"                    name\u003ds.name, goal_name\u003dgoals_map[s.goal_id],"},{"line_number":94,"context_line":"                    display_name\u003ds.display_name,"},{"line_number":95,"context_line":"                    parameters_spec\u003ds.parameters_spec.__str__()): s"},{"line_number":96,"context_line":"                for s in self.available_strategies"},{"line_number":97,"context_line":"            }"},{"line_number":98,"context_line":"        return self._available_strategies_map"}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_89e92383","line":95,"range":{"start_line":95,"start_character":36,"end_line":95,"end_character":63},"updated":"2016-06-23 12:56:42.000000000","message":"nit: I\u0027d rather write it \u0027str(s.parameters_spec)\u0027 instead of calling the magic method directly.","commit_id":"6f1b8e5ade58f3f5f773522bf195aa2663450627"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"14a851680a179a33352d6b30f62b60d9643ed258","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                StrategyMapping("},{"line_number":93,"context_line":"                    name\u003ds.name, goal_name\u003dgoals_map[s.goal_id],"},{"line_number":94,"context_line":"                    display_name\u003ds.display_name,"},{"line_number":95,"context_line":"                    parameters_spec\u003ds.parameters_spec.__str__()): s"},{"line_number":96,"context_line":"                for s in self.available_strategies"},{"line_number":97,"context_line":"            }"},{"line_number":98,"context_line":"        return self._available_strategies_map"}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_e7ea5d73","line":95,"range":{"start_line":95,"start_character":36,"end_line":95,"end_character":63},"in_reply_to":"3aaa91ec_89e92383","updated":"2016-06-24 07:55:33.000000000","message":"done","commit_id":"6f1b8e5ade58f3f5f773522bf195aa2663450627"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"0378a4456c4a4bc0999786148eb6d616d77a6c61","unresolved":false,"context_lines":[{"line_number":289,"context_line":"                name\u003dstrategy_cls.get_name(),"},{"line_number":290,"context_line":"                goal_name\u003dstrategy_cls.get_goal_name(),"},{"line_number":291,"context_line":"                display_name\u003dstrategy_cls.get_translatable_display_name(),"},{"line_number":292,"context_line":"                parameters_spec\u003dstrategy_cls.get_schema().__str__())"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"        return discovered_map"},{"line_number":295,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_a985ffad","line":292,"range":{"start_line":292,"start_character":32,"end_line":292,"end_character":67},"updated":"2016-06-23 12:56:42.000000000","message":"ditto","commit_id":"6f1b8e5ade58f3f5f773522bf195aa2663450627"}]}
