)]}'
{"mistral/engine/policies.py":[{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"5bd3c1a91db729e0c2cc25ade13ce05792499785","unresolved":false,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    wait_after \u003d policies_spec.get_wait_after()"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    return WaitAfterPolicy(wait_after) if wait_after !\u003d 0 else None"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def build_retry_policy(policies_spec):"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa80f949_c33002eb","line":89,"updated":"2015-11-05 17:15:24.000000000","message":"This implies that a wait_after with negative values is allowed.  Also, I don\u0027t see where the YAQL for wait_after is evaluated.  The YAQL evaluation could end up having a negative value.","commit_id":"9d94e0a8ba97bca3734b8082c46dee726d22bdf8"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"597d79169534b9b68ebb5b5029122e37f8069ee6","unresolved":false,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    wait_after \u003d policies_spec.get_wait_after()"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    return WaitAfterPolicy(wait_after) if wait_after !\u003d 0 else None"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def build_retry_policy(policies_spec):"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa80f949_9b302203","line":89,"in_reply_to":"fa80f949_aedcc512","updated":"2015-11-05 18:44:42.000000000","message":"I guess the problem is that in py3 we can\u0027t compare different data types, say, use operator \u0027\u003e\u0027 on str and int. \nas for YAQL, it is evaluated here: https://github.com/openstack/mistral/blob/master/mistral/engine/base.py#L144\n\nAnyway, I agree that a policy value should be a positive. Please add additional check.","commit_id":"9d94e0a8ba97bca3734b8082c46dee726d22bdf8"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"296b2a6b8d79190f623822d93153ccca02c221ca","unresolved":false,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    wait_after \u003d policies_spec.get_wait_after()"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    return WaitAfterPolicy(wait_after) if wait_after !\u003d 0 else None"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def build_retry_policy(policies_spec):"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa80f949_aedcc512","line":89,"in_reply_to":"fa80f949_c33002eb","updated":"2015-11-05 17:53:44.000000000","message":"I actually agree with Winson. What\u0027s the reason for this change?","commit_id":"9d94e0a8ba97bca3734b8082c46dee726d22bdf8"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"5bd3c1a91db729e0c2cc25ade13ce05792499785","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    timeout_policy \u003d policies_spec.get_timeout()"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    return TimeoutPolicy(timeout_policy) if timeout_policy !\u003d 0 else None"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"def build_pause_before_policy(policies_spec):"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa80f949_634ef670","line":115,"updated":"2015-11-05 17:15:24.000000000","message":"This implies that a wait_after with negative values is allowed.  Also, I don\u0027t see where the YAQL for wait_after is evaluated.  The YAQL evaluation could end up having a negative value.","commit_id":"9d94e0a8ba97bca3734b8082c46dee726d22bdf8"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"636dba06dd7bb005432ab5c2fec4388d64ed6cca","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    if (isinstance(wait_before, six.string_types) or wait_before \u003e 0):"},{"line_number":82,"context_line":"        return WaitBeforePolicy(wait_before)"},{"line_number":83,"context_line":"    else:"},{"line_number":84,"context_line":"        None"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"def build_wait_after_policy(policies_spec):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da85f559_2b42193f","line":84,"updated":"2015-11-16 06:51:51.000000000","message":"Could you explain what\u0027s the purpose of this \"else: None\"?","commit_id":"5df41e505ca6e6e8af31b6645980dc608038cbc3"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"44df886dcea9296ef4fbec6d4b0c2ed0622b7db1","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    if (isinstance(wait_before, six.string_types) or wait_before \u003e 0):"},{"line_number":82,"context_line":"        return WaitBeforePolicy(wait_before)"},{"line_number":83,"context_line":"    else:"},{"line_number":84,"context_line":"        None"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"def build_wait_after_policy(policies_spec):"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_0d522614","line":84,"in_reply_to":"ba8a016a_1a09fa95","updated":"2015-11-16 12:20:18.000000000","message":"Agree on this. Need to explicitly return the value.","commit_id":"5df41e505ca6e6e8af31b6645980dc608038cbc3"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"f35c1bf997b205d7b956a1316b0f2a0b5ed24c48","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    if (isinstance(wait_before, six.string_types) or wait_before \u003e 0):"},{"line_number":82,"context_line":"        return WaitBeforePolicy(wait_before)"},{"line_number":83,"context_line":"    else:"},{"line_number":84,"context_line":"        None"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"def build_wait_after_policy(policies_spec):"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_1a09fa95","line":84,"in_reply_to":"ba8a016a_7365dadf","updated":"2015-11-16 12:14:17.000000000","message":"Actually, this construct is the same as before, it is not explicit though. If there is no return keyword, function will return None.\n\nConstruction like:\n\n  else:\n      None\n\nis meaningless. Should be either removed, or removed with explicitly returning a value (None in this case), like:\n\n  if (isinstance(wait_before, six.string_types) or wait_before \u003e 0):\n      return WaitBeforePolicy(wait_before)\n\n  return None\n\nBeing explicit will increase readability in this case. Also on line 95 and 124.","commit_id":"5df41e505ca6e6e8af31b6645980dc608038cbc3"},{"author":{"_account_id":8592,"name":"Anastasia Kuznetsova","email":"akuznetsova@mirantis.com","username":"nastya-kuz"},"change_message_id":"ec14cbda4ca9acc2332c3f9ce725d8eac3585079","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    if (isinstance(wait_before, six.string_types) or wait_before \u003e 0):"},{"line_number":82,"context_line":"        return WaitBeforePolicy(wait_before)"},{"line_number":83,"context_line":"    else:"},{"line_number":84,"context_line":"        None"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"def build_wait_after_policy(policies_spec):"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_7365dadf","line":84,"in_reply_to":"da85f559_2b42193f","updated":"2015-11-16 09:17:54.000000000","message":"As I understand correct, previously if condition isn\u0027t met, then method returned None, why did you break this logic?","commit_id":"5df41e505ca6e6e8af31b6645980dc608038cbc3"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"c87f517933b42d288f7993bc301aec68f91bc2a7","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    wait_before \u003d policies_spec.get_wait_before()"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    if (isinstance(wait_before, six.string_types) or wait_before \u003e 0):"},{"line_number":82,"context_line":"        return WaitBeforePolicy(wait_before)"},{"line_number":83,"context_line":"    else:"},{"line_number":84,"context_line":"        return None"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_93e6c5b2","line":81,"updated":"2015-11-18 07:55:17.000000000","message":"What if we pass here None value?","commit_id":"0987a2e30a6206a86f6a420d103b53e8d6ec4217"},{"author":{"_account_id":18238,"name":"Hardik Parekh","email":"hardik.parekh047@gmail.com","username":"hparekh"},"change_message_id":"b3c65dc424cc912f192663fd0c2c123382ca0b7c","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    wait_before \u003d policies_spec.get_wait_before()"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    if (isinstance(wait_before, six.string_types) or wait_before \u003e 0):"},{"line_number":82,"context_line":"        return WaitBeforePolicy(wait_before)"},{"line_number":83,"context_line":"    else:"},{"line_number":84,"context_line":"        return None"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_969473e2","line":81,"in_reply_to":"ba8a016a_93e6c5b2","updated":"2015-11-18 08:24:23.000000000","message":"I guess in that case schema validation will be fail.","commit_id":"0987a2e30a6206a86f6a420d103b53e8d6ec4217"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"a62369a97537e92da72edbe9392a08f425a49c5f","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    wait_before \u003d policies_spec.get_wait_before()"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    if (isinstance(wait_before, six.string_types) or wait_before \u003e 0):"},{"line_number":82,"context_line":"        return WaitBeforePolicy(wait_before)"},{"line_number":83,"context_line":"    else:"},{"line_number":84,"context_line":"        return None"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_40239ea7","line":81,"in_reply_to":"ba8a016a_969473e2","updated":"2015-11-18 10:12:10.000000000","message":"Yes, it should fail in this case.","commit_id":"0987a2e30a6206a86f6a420d103b53e8d6ec4217"}],"mistral/tests/unit/engine/test_policies.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"a62369a97537e92da72edbe9392a08f425a49c5f","unresolved":false,"context_lines":[{"line_number":471,"context_line":"        self.assertDictEqual({}, task_ex.runtime_context)"},{"line_number":472,"context_line":""},{"line_number":473,"context_line":"        self._await("},{"line_number":474,"context_line":"            lambda: self.is_task_delayed(task_ex.id),"},{"line_number":475,"context_line":"            delay\u003d0.5"},{"line_number":476,"context_line":"        )"},{"line_number":477,"context_line":"        self._await(lambda: self.is_task_success(task_ex.id))"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_400f1e88","line":474,"updated":"2015-11-18 10:12:10.000000000","message":"This is a little dangerous check, potential race condition because the test may never be able to wait till a task is delayed, in general it may have already been delayed and then completed by the time this check happens so it will end by timeout.\n\nI actually strongly discourage everyone from having a lot of, in fact, sleep-based tests. In some cases though it\u0027s hard to avoid them completely but they need to be minimized. As far as this patch my suggestion is to rewrite tests so that they check that values from variables get evaluated properly but there\u0027s no need to actually wait for completion of these time-consuming workflows. In order to check correctness of policies work we already have other tests that do needed waits etc.","commit_id":"0987a2e30a6206a86f6a420d103b53e8d6ec4217"},{"author":{"_account_id":18238,"name":"Hardik Parekh","email":"hardik.parekh047@gmail.com","username":"hparekh"},"change_message_id":"a18e9b9ce6cd97bba4822841b4dcd2d87ed4b759","unresolved":false,"context_lines":[{"line_number":471,"context_line":"        self.assertDictEqual({}, task_ex.runtime_context)"},{"line_number":472,"context_line":""},{"line_number":473,"context_line":"        self._await("},{"line_number":474,"context_line":"            lambda: self.is_task_delayed(task_ex.id),"},{"line_number":475,"context_line":"            delay\u003d0.5"},{"line_number":476,"context_line":"        )"},{"line_number":477,"context_line":"        self._await(lambda: self.is_task_success(task_ex.id))"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_9850e4d5","line":474,"in_reply_to":"ba8a016a_400f1e88","updated":"2015-11-19 08:53:53.000000000","message":"Done","commit_id":"0987a2e30a6206a86f6a420d103b53e8d6ec4217"}]}
