)]}'
{"monasca_api/tests/test_validation.py":[{"author":{"_account_id":13771,"name":"Davide Agnello","email":"dagnello@hp.com","username":"dagnello"},"change_message_id":"6354a54f68b8c1fd23b4af5e91267d901529ee3d","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        self.assertRaises("},{"line_number":218,"context_line":"            schemas_exceptions.ValidationException,"},{"line_number":219,"context_line":"            schemas_notifications.validate, notification)"},{"line_number":220,"context_line":"        pass"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"    def test_validation_for_webhook(self):"},{"line_number":223,"context_line":"        notification \u003d {\"name\": \"MyWebhook\", \"type\": \"WEBHOOK\", \"address\": \"http://somedomain.com\"}"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_95914755","line":220,"range":{"start_line":220,"start_character":8,"end_line":220,"end_character":12},"updated":"2016-01-15 23:38:07.000000000","message":"this can be removed","commit_id":"adef91548c577619bd483cbac1c2a2f61e9a8506"},{"author":{"_account_id":18286,"name":"Shinya Kawabata","email":"s-kawabata@wx.jp.nec.com","username":"kawabata"},"change_message_id":"e389203f27cba2a201803f8a983196ce23f5ffe8","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        self.assertRaises("},{"line_number":218,"context_line":"            schemas_exceptions.ValidationException,"},{"line_number":219,"context_line":"            schemas_notifications.validate, notification)"},{"line_number":220,"context_line":"        pass"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"    def test_validation_for_webhook(self):"},{"line_number":223,"context_line":"        notification \u003d {\"name\": \"MyWebhook\", \"type\": \"WEBHOOK\", \"address\": \"http://somedomain.com\"}"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_637debe6","line":220,"range":{"start_line":220,"start_character":8,"end_line":220,"end_character":12},"in_reply_to":"da6ed579_95914755","updated":"2016-01-16 16:30:52.000000000","message":"Done","commit_id":"adef91548c577619bd483cbac1c2a2f61e9a8506"},{"author":{"_account_id":13771,"name":"Davide Agnello","email":"dagnello@hp.com","username":"dagnello"},"change_message_id":"6354a54f68b8c1fd23b4af5e91267d901529ee3d","unresolved":false,"context_lines":[{"line_number":231,"context_line":"        self.assertRaises("},{"line_number":232,"context_line":"            schemas_exceptions.ValidationException,"},{"line_number":233,"context_line":"            schemas_notifications.validate, notification)"},{"line_number":234,"context_line":"        pass"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def test_validation_for_pagerduty(self):"},{"line_number":237,"context_line":"        notification \u003d {\"name\": \"MyPagerduty\", \"type\": \"PAGERDUTY\","}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_359e5b64","line":234,"range":{"start_line":234,"start_character":8,"end_line":234,"end_character":12},"updated":"2016-01-15 23:38:07.000000000","message":"also here","commit_id":"adef91548c577619bd483cbac1c2a2f61e9a8506"},{"author":{"_account_id":18286,"name":"Shinya Kawabata","email":"s-kawabata@wx.jp.nec.com","username":"kawabata"},"change_message_id":"e389203f27cba2a201803f8a983196ce23f5ffe8","unresolved":false,"context_lines":[{"line_number":231,"context_line":"        self.assertRaises("},{"line_number":232,"context_line":"            schemas_exceptions.ValidationException,"},{"line_number":233,"context_line":"            schemas_notifications.validate, notification)"},{"line_number":234,"context_line":"        pass"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def test_validation_for_pagerduty(self):"},{"line_number":237,"context_line":"        notification \u003d {\"name\": \"MyPagerduty\", \"type\": \"PAGERDUTY\","}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_2387f3d8","line":234,"range":{"start_line":234,"start_character":8,"end_line":234,"end_character":12},"in_reply_to":"da6ed579_359e5b64","updated":"2016-01-16 16:30:52.000000000","message":"Done","commit_id":"adef91548c577619bd483cbac1c2a2f61e9a8506"}],"monasca_api/v2/common/schemas/notifications_request_body_schema.py":[{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"f05292cf3c45eafef18318541b461fdc56bbc6b3","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        _validate_url(msg[\u0027address\u0027])"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"def _validate_email(address):"},{"line_number":69,"context_line":"    if not address or \u0027@\u0027 not in address:"},{"line_number":70,"context_line":"        raise exceptions.ValidationException(ADDRESS_ERR_MESSAGE.format(address))"},{"line_number":71,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da6ed579_b8e3a0a3","line":68,"range":{"start_line":68,"start_character":4,"end_line":68,"end_character":19},"updated":"2016-01-14 01:39:23.000000000","message":"Why are we attempting to validate email addresses with a regular expression?  Doesn\u0027t python have libraries for this?  Where did you get the expression?  It\u0027s going to need some explanation about what it is matching and more tests to show what it allows and what it rejects.","commit_id":"b89a63cc1ea62097671f47da72ef940e1b8770a0"},{"author":{"_account_id":18286,"name":"Shinya Kawabata","email":"s-kawabata@wx.jp.nec.com","username":"kawabata"},"change_message_id":"520bffd04388f163e3071bc7d1283c6a73349097","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        _validate_url(msg[\u0027address\u0027])"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"def _validate_email(address):"},{"line_number":69,"context_line":"    if not address or \u0027@\u0027 not in address:"},{"line_number":70,"context_line":"        raise exceptions.ValidationException(ADDRESS_ERR_MESSAGE.format(address))"},{"line_number":71,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da6ed579_e753b137","line":68,"range":{"start_line":68,"start_character":4,"end_line":68,"end_character":19},"in_reply_to":"da6ed579_b8e3a0a3","updated":"2016-01-14 04:43:45.000000000","message":"\u003e Why are we attempting to validate email addresses with a regular expression? Doesn\u0027t python have libraries for this?\n\nI\u0027m not familiar with python library. So I was given advice that regular expression is also OK in this case at January 6 irc meeting.\n\n\u003e Where did you get the expression?\n\nI refered expression from O\u0027Reilly Regular Expressions Cookbook.\n\n\u003e It\u0027s going to need some explanation about what it is matching and more tests to show what it allows and what it rejects.\n\nOK. I will try to explain in detail and I will add more tests. Thanks.","commit_id":"b89a63cc1ea62097671f47da72ef940e1b8770a0"},{"author":{"_account_id":18286,"name":"Shinya Kawabata","email":"s-kawabata@wx.jp.nec.com","username":"kawabata"},"change_message_id":"f126371fa2ee170bba4ef09f7ce741ace1434d90","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        _validate_url(msg[\u0027address\u0027])"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"def _validate_email(address):"},{"line_number":69,"context_line":"    if not address or \u0027@\u0027 not in address:"},{"line_number":70,"context_line":"        raise exceptions.ValidationException(ADDRESS_ERR_MESSAGE.format(address))"},{"line_number":71,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da6ed579_edb70f38","line":68,"range":{"start_line":68,"start_character":4,"end_line":68,"end_character":19},"in_reply_to":"da6ed579_c73eac8b","updated":"2016-01-14 06:08:40.000000000","message":"Thanks, I understand risk of email validation. I have searched email validator in PyPi.\nBut I had no idea which validator is suitable about license.\nDoes below validator which has CC0 license and popularity than others accept for Monasca?\n---\nhttps://pypi.python.org/pypi/email_validator","commit_id":"b89a63cc1ea62097671f47da72ef940e1b8770a0"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"70439ae7907f5be28d2a8a5c74ae1bcd53b5b432","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        _validate_url(msg[\u0027address\u0027])"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"def _validate_email(address):"},{"line_number":69,"context_line":"    if not address or \u0027@\u0027 not in address:"},{"line_number":70,"context_line":"        raise exceptions.ValidationException(ADDRESS_ERR_MESSAGE.format(address))"},{"line_number":71,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da6ed579_c73eac8b","line":68,"range":{"start_line":68,"start_character":4,"end_line":68,"end_character":19},"in_reply_to":"da6ed579_e753b137","updated":"2016-01-14 04:55:15.000000000","message":"I did some quick tests with it and at the moment it allows some email addresses that it shouldn\u0027t and rejects some that it should allow.  To do email validation with regular expressions can be quite hard, and fragile, if you want it to match the spec which is why I suggested a library instead.  Python has several libraries which will verify that the email address is valid and also give the ability to see that the email is actually usable though that\u0027s more risky.","commit_id":"b89a63cc1ea62097671f47da72ef940e1b8770a0"},{"author":{"_account_id":15799,"name":"Ben Motz","email":"ben.launchpad@ouat.co.uk","username":"bmotz"},"change_message_id":"fa139731894705e6a24f4c4f88e9979fbbf00548","unresolved":false,"context_lines":[{"line_number":22,"context_line":"if sys.version_info \u003e\u003d (3,):"},{"line_number":23,"context_line":"    import urllib.parse as urlparse"},{"line_number":24,"context_line":"else:"},{"line_number":25,"context_line":"    import urlparse"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":28,"context_line":"ADDRESS_ERR_MESSAGE \u003d \"Address {} is not of correct format\""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_8915de9c","line":25,"updated":"2016-01-25 15:09:24.000000000","message":"Should use import six.moves.urllib, see: http://pythonhosted.org/six/#module-six.moves.urllib.parse","commit_id":"68e8b7d835573a965f4b4dce36606a2ec69f7c89"},{"author":{"_account_id":18286,"name":"Shinya Kawabata","email":"s-kawabata@wx.jp.nec.com","username":"kawabata"},"change_message_id":"887147f089eba3ad285c16b283c9588ec4489d1a","unresolved":false,"context_lines":[{"line_number":22,"context_line":"if sys.version_info \u003e\u003d (3,):"},{"line_number":23,"context_line":"    import urllib.parse as urlparse"},{"line_number":24,"context_line":"else:"},{"line_number":25,"context_line":"    import urlparse"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":28,"context_line":"ADDRESS_ERR_MESSAGE \u003d \"Address {} is not of correct format\""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_f0bf765e","line":25,"in_reply_to":"9a68dd71_8915de9c","updated":"2016-01-26 08:21:16.000000000","message":"Done","commit_id":"68e8b7d835573a965f4b4dce36606a2ec69f7c89"},{"author":{"_account_id":15799,"name":"Ben Motz","email":"ben.launchpad@ouat.co.uk","username":"bmotz"},"change_message_id":"fa139731894705e6a24f4c4f88e9979fbbf00548","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    import urlparse"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":28,"context_line":"ADDRESS_ERR_MESSAGE \u003d \"Address {} is not of correct format\""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"schemes \u003d [\u0027http\u0027, \u0027https\u0027]"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_09580e87","line":28,"updated":"2016-01-25 15:09:24.000000000","message":"Using a global variable like this to define an exception message is not consistent with the rest of the Monasca-API codebase.","commit_id":"68e8b7d835573a965f4b4dce36606a2ec69f7c89"},{"author":{"_account_id":18286,"name":"Shinya Kawabata","email":"s-kawabata@wx.jp.nec.com","username":"kawabata"},"change_message_id":"887147f089eba3ad285c16b283c9588ec4489d1a","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    import urlparse"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":28,"context_line":"ADDRESS_ERR_MESSAGE \u003d \"Address {} is not of correct format\""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"schemes \u003d [\u0027http\u0027, \u0027https\u0027]"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_90b4fa82","line":28,"in_reply_to":"9a68dd71_09580e87","updated":"2016-01-26 08:21:16.000000000","message":"Done","commit_id":"68e8b7d835573a965f4b4dce36606a2ec69f7c89"},{"author":{"_account_id":15799,"name":"Ben Motz","email":"ben.launchpad@ouat.co.uk","username":"bmotz"},"change_message_id":"fa139731894705e6a24f4c4f88e9979fbbf00548","unresolved":false,"context_lines":[{"line_number":65,"context_line":"def _validate_url(address):"},{"line_number":66,"context_line":"    try:"},{"line_number":67,"context_line":"        parsed \u003d urlparse.urlparse(address)"},{"line_number":68,"context_line":"    except:"},{"line_number":69,"context_line":"        raise exceptions.ValidationException(ADDRESS_ERR_MESSAGE.format(address))"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    if not parsed.scheme or not parsed.netloc:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_bfda5015","line":68,"updated":"2016-01-25 15:09:24.000000000","message":"You shouldn\u0027t use \u0027Catch-all\u0027 exception handling like this, as it can hide system and programming errors (see https://docs.python.org/2/howto/doanddont.html#except). If you must do a general handler like this, you should use \n\n    except Exception:","commit_id":"68e8b7d835573a965f4b4dce36606a2ec69f7c89"},{"author":{"_account_id":18286,"name":"Shinya Kawabata","email":"s-kawabata@wx.jp.nec.com","username":"kawabata"},"change_message_id":"887147f089eba3ad285c16b283c9588ec4489d1a","unresolved":false,"context_lines":[{"line_number":65,"context_line":"def _validate_url(address):"},{"line_number":66,"context_line":"    try:"},{"line_number":67,"context_line":"        parsed \u003d urlparse.urlparse(address)"},{"line_number":68,"context_line":"    except:"},{"line_number":69,"context_line":"        raise exceptions.ValidationException(ADDRESS_ERR_MESSAGE.format(address))"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    if not parsed.scheme or not parsed.netloc:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_b0b9fe7b","line":68,"in_reply_to":"9a68dd71_bfda5015","updated":"2016-01-26 08:21:16.000000000","message":"Done","commit_id":"68e8b7d835573a965f4b4dce36606a2ec69f7c89"},{"author":{"_account_id":15799,"name":"Ben Motz","email":"ben.launchpad@ouat.co.uk","username":"bmotz"},"change_message_id":"fa139731894705e6a24f4c4f88e9979fbbf00548","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    if not parsed.scheme or not parsed.netloc:"},{"line_number":72,"context_line":"        raise exceptions.ValidationException(ADDRESS_ERR_MESSAGE.format(address))"},{"line_number":73,"context_line":"    if parsed.scheme not in schemes:"},{"line_number":74,"context_line":"        raise exceptions.ValidationException(ADDRESS_ERR_MESSAGE.format(address))"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_df4864b5","line":74,"updated":"2016-01-25 15:09:24.000000000","message":"If you\u0027re going to raise exceptions in three different places you could give more informative error messages (e.g. \"No URL scheme specified / could not parse network location\" and \"Unknown scheme in URL\", or something else)","commit_id":"68e8b7d835573a965f4b4dce36606a2ec69f7c89"},{"author":{"_account_id":18286,"name":"Shinya Kawabata","email":"s-kawabata@wx.jp.nec.com","username":"kawabata"},"change_message_id":"887147f089eba3ad285c16b283c9588ec4489d1a","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    if not parsed.scheme or not parsed.netloc:"},{"line_number":72,"context_line":"        raise exceptions.ValidationException(ADDRESS_ERR_MESSAGE.format(address))"},{"line_number":73,"context_line":"    if parsed.scheme not in schemes:"},{"line_number":74,"context_line":"        raise exceptions.ValidationException(ADDRESS_ERR_MESSAGE.format(address))"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_50af622b","line":74,"in_reply_to":"9a68dd71_df4864b5","updated":"2016-01-26 08:21:16.000000000","message":"Done","commit_id":"68e8b7d835573a965f4b4dce36606a2ec69f7c89"}]}
