)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"01cc4c5cc55903f5fbee2ee7ecacc0dc1635b79c","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Koji Nakazono \u003cnakazono_0507@jp.fujitsu.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-06-16 14:41:04 +0900"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"FIX slack notification"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch fixes 2 issues in slack notification."},{"line_number":10,"context_line":"First, incoming webhook supports the JSON request, however Slack"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"7f231b9d_313162a4","line":7,"updated":"2017-06-16 08:16:31.000000000","message":"Fix","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"01cc4c5cc55903f5fbee2ee7ecacc0dc1635b79c","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2017-06-16 14:41:04 +0900"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"FIX slack notification"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch fixes 2 issues in slack notification."},{"line_number":10,"context_line":"First, incoming webhook supports the JSON request, however Slack"},{"line_number":11,"context_line":"API to post a message to chat doesn\u0027t support JSON request."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"7f231b9d_71c47a40","line":8,"updated":"2017-06-16 08:16:31.000000000","message":"It seems to be... is that correct?\n\n* Fix data format for sending JSON request to Slack\n* Add validation for response body\n\nI think it\u0027s more readable :)\n\n1st:yyyyy\n  * zzzzzz\n\n2nd:xxxxx\n  * zzzzzz","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"}],"monasca_notification/plugins/slack_notifier.py":[{"author":{"_account_id":20033,"name":"Artur Basiak","email":"artur.basiak@ts.fujitsu.com","username":"abasiak"},"change_message_id":"6050c172510775f5514123ae58e149e63bb7fb93","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"class SlackNotifier(abstract_notifier.AbstractNotifier):"},{"line_number":51,"context_line":"    POST_MESSAGE_URL_PREFIX \u003d \u0027https://slack.com/api/chat.postMessage\u0027"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def __init__(self, log):"},{"line_number":54,"context_line":"        self._log \u003d log"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff0f0b1f_191092ff","line":51,"range":{"start_line":51,"start_character":4,"end_line":51,"end_character":27},"updated":"2017-05-25 11:56:54.000000000","message":"I think this should be configurable.","commit_id":"88c4905dfd252bdd94738cbdbace16917b578d08"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"086fc4c6ef0ccb09c4cada13bdf727c2a6d1a158","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"class SlackNotifier(abstract_notifier.AbstractNotifier):"},{"line_number":51,"context_line":"    POST_MESSAGE_URL_PREFIX \u003d \u0027https://slack.com/api/chat.postMessage\u0027"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def __init__(self, log):"},{"line_number":54,"context_line":"        self._log \u003d log"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff0f0b1f_af97f83a","line":51,"range":{"start_line":51,"start_character":4,"end_line":51,"end_character":27},"in_reply_to":"ff0f0b1f_191092ff","updated":"2017-05-26 07:13:04.000000000","message":"Done","commit_id":"88c4905dfd252bdd94738cbdbace16917b578d08"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"5ff7d76b9ca4a85acb3ec9c2c592d0dfda736c0c","unresolved":false,"context_lines":[{"line_number":133,"context_line":"            # Posting on the given URL"},{"line_number":134,"context_line":"            self._log.debug(\"Sending to the url {0} , with query_params {1}\".format(url, query_params))"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"            if post_message_url in url:"},{"line_number":137,"context_line":"                # Post message API doesn\u0027t support json"},{"line_number":138,"context_line":"                result \u003d requests.post(url\u003durl,"},{"line_number":139,"context_line":"                                       data\u003dslack_message,"}],"source_content_type":"text/x-python","patch_set":5,"id":"df140735_03444db6","line":136,"updated":"2017-05-31 09:26:25.000000000","message":"I don\u0027t like that part...what about next and next URL that will handle data in other way. We cannot add more branching here just because some API works in different way ? Can\u0027t we just make data vs json configurable for this particular plugin ?\n\nOr is sth more to it that I cannot see here ?","commit_id":"9225e45ad0c4b69d661da508f589243a39943e57"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"fb36a42c5599a074661183ba9af9af50944c3484","unresolved":false,"context_lines":[{"line_number":133,"context_line":"            # Posting on the given URL"},{"line_number":134,"context_line":"            self._log.debug(\"Sending to the url {0} , with query_params {1}\".format(url, query_params))"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"            if post_message_url in url:"},{"line_number":137,"context_line":"                # Post message API doesn\u0027t support json"},{"line_number":138,"context_line":"                result \u003d requests.post(url\u003durl,"},{"line_number":139,"context_line":"                                       data\u003dslack_message,"}],"source_content_type":"text/x-python","patch_set":5,"id":"df140735_8747ae77","line":136,"in_reply_to":"df140735_03444db6","updated":"2017-06-06 02:49:26.000000000","message":"Sorry for late reply. I also didn\u0027t like this part. There are only 2 API, so I implemented like here.\n\nI fixed here to support more APIs. Please review it again.","commit_id":"9225e45ad0c4b69d661da508f589243a39943e57"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"8d5d17bcd8c48f5dbfbe93f23e8a9df33d8de5da","unresolved":false,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def _check_response(self, result):"},{"line_number":88,"context_line":"        if \u0027application/json\u0027 in result.headers.get(\u0027Content-Type\u0027):"},{"line_number":89,"context_line":"            response \u003d json.loads(result.text)"},{"line_number":90,"context_line":"            if response.get(\u0027ok\u0027):"},{"line_number":91,"context_line":"                return True"},{"line_number":92,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"df140735_59f4daf0","line":89,"updated":"2017-06-06 04:59:38.000000000","message":"resp.json should be used instead","commit_id":"bce251d4dce42d94f4415c132832ec5128be6c14"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"5a1b497becc061dfd099885e74f07e25ad7c68a7","unresolved":false,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def _check_response(self, result):"},{"line_number":88,"context_line":"        if \u0027application/json\u0027 in result.headers.get(\u0027Content-Type\u0027):"},{"line_number":89,"context_line":"            response \u003d json.loads(result.text)"},{"line_number":90,"context_line":"            if response.get(\u0027ok\u0027):"},{"line_number":91,"context_line":"                return True"},{"line_number":92,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"bf091321_c9e23630","line":89,"in_reply_to":"df140735_59f4daf0","updated":"2017-06-08 04:35:10.000000000","message":"Done","commit_id":"bce251d4dce42d94f4415c132832ec5128be6c14"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"8d5d17bcd8c48f5dbfbe93f23e8a9df33d8de5da","unresolved":false,"context_lines":[{"line_number":101,"context_line":"            return False"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def _check_url_json_support(self, url):"},{"line_number":104,"context_line":"        not_support_json_urls \u003d self._config.get(\"not_support_json_urls\","},{"line_number":105,"context_line":"                                                 [self.POST_MESSAGE_URL_PREFIX])"},{"line_number":106,"context_line":"        if not isinstance(not_support_json_urls, list):"},{"line_number":107,"context_line":"            self._log.warn(\"\u0027not_support_json_urls\u0027 should be a list.\")"}],"source_content_type":"text/x-python","patch_set":7,"id":"df140735_1971c276","line":104,"updated":"2017-06-06 04:59:38.000000000","message":"I am still not sure if that\u0027s correct approach. It basically enforces to list those APIs. Might be we reached a point where we ought to put this on the table for the monasca weeekly meeting.","commit_id":"bce251d4dce42d94f4415c132832ec5128be6c14"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"5a1b497becc061dfd099885e74f07e25ad7c68a7","unresolved":false,"context_lines":[{"line_number":101,"context_line":"            return False"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def _check_url_json_support(self, url):"},{"line_number":104,"context_line":"        not_support_json_urls \u003d self._config.get(\"not_support_json_urls\","},{"line_number":105,"context_line":"                                                 [self.POST_MESSAGE_URL_PREFIX])"},{"line_number":106,"context_line":"        if not isinstance(not_support_json_urls, list):"},{"line_number":107,"context_line":"            self._log.warn(\"\u0027not_support_json_urls\u0027 should be a list.\")"}],"source_content_type":"text/x-python","patch_set":7,"id":"bf091321_8932fea6","line":104,"in_reply_to":"df140735_1971c276","updated":"2017-06-08 04:35:10.000000000","message":"Thanks for your comments.\n\nI fixed here to try to send message with json first, and next raw data. Additionally, make a cache for the URLs which accept only the raw data, and skip json for them.\n\nAt this moment, the API which requires raw data is only the post message. And the Incoming Webhook URL has some variables like the auth token, I didn\u0027t make the cache for json URLs.","commit_id":"bce251d4dce42d94f4415c132832ec5128be6c14"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"8d5d17bcd8c48f5dbfbe93f23e8a9df33d8de5da","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            # Posting on the given URL"},{"line_number":145,"context_line":"            self._log.debug(\"Sending to the url {0} , with query_params {1}\".format(url, query_params))"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"            if self._check_url_json_support(url):"},{"line_number":148,"context_line":"                result \u003d requests.post(url\u003durl,"},{"line_number":149,"context_line":"                                       json\u003dslack_message,"},{"line_number":150,"context_line":"                                       verify\u003dverify,"}],"source_content_type":"text/x-python","patch_set":7,"id":"df140735_790d5ee6","line":147,"updated":"2017-06-06 04:59:38.000000000","message":"I wonder if it make sense here to simply have two attempts of sending the message. One that would assume that API accepts JSON and the other one that accepts raw data. According to your code at least one should work and if both fails, that means that we couldn\u0027t send this notification.","commit_id":"bce251d4dce42d94f4415c132832ec5128be6c14"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"5a1b497becc061dfd099885e74f07e25ad7c68a7","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            # Posting on the given URL"},{"line_number":145,"context_line":"            self._log.debug(\"Sending to the url {0} , with query_params {1}\".format(url, query_params))"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"            if self._check_url_json_support(url):"},{"line_number":148,"context_line":"                result \u003d requests.post(url\u003durl,"},{"line_number":149,"context_line":"                                       json\u003dslack_message,"},{"line_number":150,"context_line":"                                       verify\u003dverify,"}],"source_content_type":"text/x-python","patch_set":7,"id":"bf091321_492ce646","line":147,"in_reply_to":"df140735_790d5ee6","updated":"2017-06-08 04:35:10.000000000","message":"Done","commit_id":"bce251d4dce42d94f4415c132832ec5128be6c14"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"5f9f58dbab73adaa4dff38392e65cac74216c11e","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        data_format_list \u003d [\u0027json\u0027, \u0027data\u0027]"},{"line_number":160,"context_line":"        for data_format in data_format_list:"},{"line_number":161,"context_line":"            if (url in SlackNotifier._raw_data_url_caches and "},{"line_number":162,"context_line":"                data_format \u003d\u003d \u0027json\u0027):"},{"line_number":163,"context_line":"                continue"},{"line_number":164,"context_line":"            self._log.info(\"Try to send message to {} as {}\""},{"line_number":165,"context_line":"                           .format(url, data_format))"}],"source_content_type":"text/x-python","patch_set":8,"id":"bf091321_89c0be52","line":162,"updated":"2017-06-08 04:42:10.000000000","message":"why comparing here to json ?","commit_id":"3b5d025a502b9ab7e8cfd3249da76f9fc7a7dab3"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"5f9f58dbab73adaa4dff38392e65cac74216c11e","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        for data_format in data_format_list:"},{"line_number":161,"context_line":"            if (url in SlackNotifier._raw_data_url_caches and "},{"line_number":162,"context_line":"                data_format \u003d\u003d \u0027json\u0027):"},{"line_number":163,"context_line":"                continue"},{"line_number":164,"context_line":"            self._log.info(\"Try to send message to {} as {}\""},{"line_number":165,"context_line":"                           .format(url, data_format))"},{"line_number":166,"context_line":"            request_options \u003d {data_format: slack_message}"}],"source_content_type":"text/x-python","patch_set":8,"id":"bf091321_49af4694","line":163,"updated":"2017-06-08 04:42:10.000000000","message":"if matched, that will exit the loop and notification won\u0027t be send IMHO. I guess the intention was to pick up the data_format from the cache. More or less such action should happen before the loop, i.e.\n\n  data_format \u003d cache.get(url, None)\n  if not data_format:\n    # enter the loop\n  else\n    # just send with data_format","commit_id":"3b5d025a502b9ab7e8cfd3249da76f9fc7a7dab3"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"d263b20a8de8693edfbea7aa7b304af999006efe","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        for data_format in data_format_list:"},{"line_number":161,"context_line":"            if (url in SlackNotifier._raw_data_url_caches and "},{"line_number":162,"context_line":"                data_format \u003d\u003d \u0027json\u0027):"},{"line_number":163,"context_line":"                continue"},{"line_number":164,"context_line":"            self._log.info(\"Try to send message to {} as {}\""},{"line_number":165,"context_line":"                           .format(url, data_format))"},{"line_number":166,"context_line":"            request_options \u003d {data_format: slack_message}"}],"source_content_type":"text/x-python","patch_set":8,"id":"bf091321_9e88eb71","line":163,"in_reply_to":"bf091321_33f598cc","updated":"2017-06-08 08:26:30.000000000","message":"sorry, but let me change here(L@151-167) as following.\n\n data_format_list \u003d [\u0027json\u0027, \u0027data\u0027]\n if url in SlackNotifier._raw_data_url_caches:\n     data_format_list \u003d [\u0027data\u0027]\n\n for data_format in data_format_list:\n     self._log.info(\"Try to send message to {} as {}\"\n                    .format(url, data_format))\n     request_options \u003d {\n         \u0027url\u0027: url,\n         \u0027verify\u0027: verify,\n         \u0027params\u0027: query_params,\n         \u0027proxies\u0027: proxyDict,\n         \u0027timeout\u0027: self._config[\u0027timeout\u0027],\n         data_format: slack_message\n     }","commit_id":"3b5d025a502b9ab7e8cfd3249da76f9fc7a7dab3"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"92dae05099741da53c9c99234222daf3d55b53ce","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        for data_format in data_format_list:"},{"line_number":161,"context_line":"            if (url in SlackNotifier._raw_data_url_caches and "},{"line_number":162,"context_line":"                data_format \u003d\u003d \u0027json\u0027):"},{"line_number":163,"context_line":"                continue"},{"line_number":164,"context_line":"            self._log.info(\"Try to send message to {} as {}\""},{"line_number":165,"context_line":"                           .format(url, data_format))"},{"line_number":166,"context_line":"            request_options \u003d {data_format: slack_message}"}],"source_content_type":"text/x-python","patch_set":8,"id":"bf091321_33f598cc","line":163,"in_reply_to":"bf091321_49af4694","updated":"2017-06-08 08:05:32.000000000","message":"the url for incoming webhook has user token, room id and so on, so there are URLs for each notification definition. \n\ne.g.\n https://hooks.slack.com/services/tokena/rooma/12345\n https://hooks.slack.com/services/tokenb/roomb/67890\n\nI have no idea how many notifications can exist, but I don\u0027t want to cache all of the URL. if user issues the token repeatedly and create the notification, the cache can be very big size.\n\non the other hand, the url for post message doesn\u0027t have the data, they are set as query parameters. so basically, the cache has only one url.","commit_id":"3b5d025a502b9ab7e8cfd3249da76f9fc7a7dab3"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"5f9f58dbab73adaa4dff38392e65cac74216c11e","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            if self._send_message(request_options):"},{"line_number":169,"context_line":"                if (data_format \u003d\u003d \u0027data\u0027 and "},{"line_number":170,"context_line":"                    url not in SlackNotifier._raw_data_url_caches):"},{"line_number":171,"context_line":"                    # Add the url which can handle only raw data to cache"},{"line_number":172,"context_line":"                    SlackNotifier._raw_data_url_caches.append(url)"},{"line_number":173,"context_line":"                return True"},{"line_number":174,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"bf091321_a9894227","line":171,"updated":"2017-06-08 04:42:10.000000000","message":"I think that we shouldn\u0027t distinguish between data formats and keep details of all data formats and their matching urls.","commit_id":"3b5d025a502b9ab7e8cfd3249da76f9fc7a7dab3"},{"author":{"_account_id":20033,"name":"Artur Basiak","email":"artur.basiak@ts.fujitsu.com","username":"abasiak"},"change_message_id":"2b30defab8b055511f156d23fc9f9b016c1be7e8","unresolved":false,"context_lines":[{"line_number":109,"context_line":"                                .format(result.status_code, url))"},{"line_number":110,"context_line":"                return False"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"            # Slack returns 200 ok even if the token is invalid. Response has valid error message"},{"line_number":113,"context_line":"            if self._check_response(result):"},{"line_number":114,"context_line":"                self._log.info(\"Notification successfully posted.\")"},{"line_number":115,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":10,"id":"7f231b9d_7ba2904d","line":112,"range":{"start_line":112,"start_character":10,"end_line":112,"end_character":73},"updated":"2017-06-13 06:35:04.000000000","message":"I am a little bit confused because here you are writing that you will check code 200 but this code will be caught be condition above because it is in range (200,300).  So the response with code 200 will never reach self._check_response().\nAlso isn\u0027t it better to check response.ok ??\nhttp://docs.python-requests.org/en/master/api/?highlight\u003dResponse#requests.Response.ok","commit_id":"c82bb35b8b28d212cf286eb3e7938ba0b856ad91"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"0313ccc37b8ea2926166b64890aa8d1cb158dc28","unresolved":false,"context_lines":[{"line_number":109,"context_line":"                                .format(result.status_code, url))"},{"line_number":110,"context_line":"                return False"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"            # Slack returns 200 ok even if the token is invalid. Response has valid error message"},{"line_number":113,"context_line":"            if self._check_response(result):"},{"line_number":114,"context_line":"                self._log.info(\"Notification successfully posted.\")"},{"line_number":115,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":10,"id":"7f231b9d_9a23dfbd","line":112,"range":{"start_line":112,"start_character":10,"end_line":112,"end_character":73},"in_reply_to":"7f231b9d_7ba2904d","updated":"2017-06-14 23:56:58.000000000","message":"The \"if\" statement in L@107 checks \"NOT\" in range from 200 to 300, so the response with the status code from 200 to 299 reaches here.\n\n\"response.ok\" returns true for the response with the status code over 300, so I don\u0027t think it\u0027s good to use it here.","commit_id":"c82bb35b8b28d212cf286eb3e7938ba0b856ad91"},{"author":{"_account_id":20033,"name":"Artur Basiak","email":"artur.basiak@ts.fujitsu.com","username":"abasiak"},"change_message_id":"27a77e86b25bb2f4ff8b9fc93ea9ac9b25e57e6f","unresolved":false,"context_lines":[{"line_number":109,"context_line":"                                .format(result.status_code, url))"},{"line_number":110,"context_line":"                return False"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"            # Slack returns 200 ok even if the token is invalid. Response has valid error message"},{"line_number":113,"context_line":"            if self._check_response(result):"},{"line_number":114,"context_line":"                self._log.info(\"Notification successfully posted.\")"},{"line_number":115,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":10,"id":"7f231b9d_6e57facb","line":112,"range":{"start_line":112,"start_character":10,"end_line":112,"end_character":73},"in_reply_to":"7f231b9d_9a23dfbd","updated":"2017-06-16 05:00:36.000000000","message":"Sorry my mistake. Didn\u0027t see \"NOT\" in the condition.","commit_id":"c82bb35b8b28d212cf286eb3e7938ba0b856ad91"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"65e538d30c56e3cc7102a33640721d06f9198a32","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            data_format_list \u003d [\u0027data\u0027]"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        for data_format in data_format_list:"},{"line_number":156,"context_line":"            self._log.info(\"Try to send message to {} as {}\""},{"line_number":157,"context_line":"                           .format(url, data_format))"},{"line_number":158,"context_line":"            request_options \u003d {"},{"line_number":159,"context_line":"                \u0027url\u0027: url,"}],"source_content_type":"text/x-python","patch_set":10,"id":"7f231b9d_bb68c11c","line":156,"updated":"2017-06-15 19:37:46.000000000","message":"nit: Trying","commit_id":"c82bb35b8b28d212cf286eb3e7938ba0b856ad91"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"02117dc60a4966aa0a3a554825dd33a41761625d","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            data_format_list \u003d [\u0027data\u0027]"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        for data_format in data_format_list:"},{"line_number":156,"context_line":"            self._log.info(\"Try to send message to {} as {}\""},{"line_number":157,"context_line":"                           .format(url, data_format))"},{"line_number":158,"context_line":"            request_options \u003d {"},{"line_number":159,"context_line":"                \u0027url\u0027: url,"}],"source_content_type":"text/x-python","patch_set":10,"id":"7f231b9d_0949a02f","line":156,"in_reply_to":"7f231b9d_bb68c11c","updated":"2017-06-16 05:44:24.000000000","message":"Done","commit_id":"c82bb35b8b28d212cf286eb3e7938ba0b856ad91"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"01cc4c5cc55903f5fbee2ee7ecacc0dc1635b79c","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"\"\"\""},{"line_number":25,"context_line":"   1) Post messages to chat"},{"line_number":26,"context_line":"   notification.address \u003d https://slack.com/api/chat.postMessage?token\u003dtoken\u0026channel\u003d#channel"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"   Slack documentation about tokens:"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_9195d689","line":25,"updated":"2017-06-16 08:16:31.000000000","message":"It\u0027s better to describe what docstring is at the top of one.","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"01cc4c5cc55903f5fbee2ee7ecacc0dc1635b79c","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"   2) Incoming webhook"},{"line_number":39,"context_line":"   notification.address \u003d https://hooks.slack.com/services/XXXXXXXXXX/XXXXXXXXX/xxxxxxxxxxxxxxxxxxxxxxxx"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"   Slack document about incoming webhook:"},{"line_number":42,"context_line":"        https://api.slack.com/incoming-webhooks"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_d1f46ef3","line":39,"updated":"2017-06-16 08:16:31.000000000","message":"Is there some reason to increase \"xxxxxxx\" over 80 col? I think it\u0027s enough more shorter :)","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"18fbbd3ea5ebdc45d4792b64bbdd2aa162b24d1e","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"   2) Incoming webhook"},{"line_number":39,"context_line":"   notification.address \u003d https://hooks.slack.com/services/XXXXXXXXXX/XXXXXXXXX/xxxxxxxxxxxxxxxxxxxxxxxx"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"   Slack document about incoming webhook:"},{"line_number":42,"context_line":"        https://api.slack.com/incoming-webhooks"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_960341bf","line":39,"in_reply_to":"7f231b9d_d1f46ef3","updated":"2017-06-20 03:19:57.000000000","message":"Done","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"01cc4c5cc55903f5fbee2ee7ecacc0dc1635b79c","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    def _check_response(self, result):"},{"line_number":88,"context_line":"        if \u0027application/json\u0027 in result.headers.get(\u0027Content-Type\u0027):"},{"line_number":89,"context_line":"            response \u003d result.json()"},{"line_number":90,"context_line":"            if response.get(\u0027ok\u0027):"},{"line_number":91,"context_line":"                return True"},{"line_number":92,"context_line":"            else:"},{"line_number":93,"context_line":"                self._log.error(\"Received an error message when trying to send to slack. error\u003d{}\""}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_ee330761","line":90,"range":{"start_line":90,"start_character":28,"end_line":90,"end_character":32},"updated":"2017-06-16 08:16:31.000000000","message":"You should use const value instead of string(\u0027ok\u0027).","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"18fbbd3ea5ebdc45d4792b64bbdd2aa162b24d1e","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    def _check_response(self, result):"},{"line_number":88,"context_line":"        if \u0027application/json\u0027 in result.headers.get(\u0027Content-Type\u0027):"},{"line_number":89,"context_line":"            response \u003d result.json()"},{"line_number":90,"context_line":"            if response.get(\u0027ok\u0027):"},{"line_number":91,"context_line":"                return True"},{"line_number":92,"context_line":"            else:"},{"line_number":93,"context_line":"                self._log.error(\"Received an error message when trying to send to slack. error\u003d{}\""}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_b6687d87","line":90,"range":{"start_line":90,"start_character":28,"end_line":90,"end_character":32},"in_reply_to":"7f231b9d_ee330761","updated":"2017-06-20 03:19:57.000000000","message":"Done","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"01cc4c5cc55903f5fbee2ee7ecacc0dc1635b79c","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            if response.get(\u0027ok\u0027):"},{"line_number":91,"context_line":"                return True"},{"line_number":92,"context_line":"            else:"},{"line_number":93,"context_line":"                self._log.error(\"Received an error message when trying to send to slack. error\u003d{}\""},{"line_number":94,"context_line":"                                .format(response.get(\"error\")))"},{"line_number":95,"context_line":"                return False"},{"line_number":96,"context_line":"        elif \"ok\" \u003d\u003d result.text:"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_ce016b6c","line":93,"range":{"start_line":93,"start_character":31,"end_line":93,"end_character":33},"updated":"2017-06-16 08:16:31.000000000","message":"Shouldn\u0027t we use i18n  like _LE() ?  Please consider if you use oslo_log.","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":22406,"name":"Kien Nguyen","email":"kiennt2609@gmail.com","username":"kiennt"},"change_message_id":"ee704de39e4eba299136cf26ba6c6c7397cf4a9e","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            if response.get(\u0027ok\u0027):"},{"line_number":91,"context_line":"                return True"},{"line_number":92,"context_line":"            else:"},{"line_number":93,"context_line":"                self._log.error(\"Received an error message when trying to send to slack. error\u003d{}\""},{"line_number":94,"context_line":"                                .format(response.get(\"error\")))"},{"line_number":95,"context_line":"                return False"},{"line_number":96,"context_line":"        elif \"ok\" \u003d\u003d result.text:"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_b4432042","line":93,"range":{"start_line":93,"start_character":31,"end_line":93,"end_character":33},"in_reply_to":"7f231b9d_ce016b6c","updated":"2017-06-16 08:32:05.000000000","message":"Starting with the Pike series, OpenStack no longer supports log translation, so I think it doesn\u0027t needed.\n\nhttps://docs.openstack.org/developer/oslo.i18n/usage.html\nhttp://lists.openstack.org/pipermail/openstack-dev/2017-March/thread.html#113365","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"d392ee6f0c84265358da61ab07a0ae56c2561aa3","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            if response.get(\u0027ok\u0027):"},{"line_number":91,"context_line":"                return True"},{"line_number":92,"context_line":"            else:"},{"line_number":93,"context_line":"                self._log.error(\"Received an error message when trying to send to slack. error\u003d{}\""},{"line_number":94,"context_line":"                                .format(response.get(\"error\")))"},{"line_number":95,"context_line":"                return False"},{"line_number":96,"context_line":"        elif \"ok\" \u003d\u003d result.text:"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_9d3cc72f","line":93,"range":{"start_line":93,"start_character":31,"end_line":93,"end_character":33},"in_reply_to":"7f231b9d_ce016b6c","updated":"2017-06-16 10:33:03.000000000","message":"monasca-notification cannot work with oslo.log. There\u0027s change of mine where I am trying to fix that, but that\u0027s very low prio.","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"01cc4c5cc55903f5fbee2ee7ecacc0dc1635b79c","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                self._log.error(\"Received an error message when trying to send to slack. error\u003d{}\""},{"line_number":94,"context_line":"                                .format(response.get(\"error\")))"},{"line_number":95,"context_line":"                return False"},{"line_number":96,"context_line":"        elif \"ok\" \u003d\u003d result.text:"},{"line_number":97,"context_line":"            return True"},{"line_number":98,"context_line":"        else:"},{"line_number":99,"context_line":"            self._log.error(\"Received an error message when trying to send to slack. error\u003d{}\""}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_ce360b52","line":96,"range":{"start_line":96,"start_character":13,"end_line":96,"end_character":17},"updated":"2017-06-16 08:16:31.000000000","message":"ditto #90","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"18fbbd3ea5ebdc45d4792b64bbdd2aa162b24d1e","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                self._log.error(\"Received an error message when trying to send to slack. error\u003d{}\""},{"line_number":94,"context_line":"                                .format(response.get(\"error\")))"},{"line_number":95,"context_line":"                return False"},{"line_number":96,"context_line":"        elif \"ok\" \u003d\u003d result.text:"},{"line_number":97,"context_line":"            return True"},{"line_number":98,"context_line":"        else:"},{"line_number":99,"context_line":"            self._log.error(\"Received an error message when trying to send to slack. error\u003d{}\""}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_d66bf982","line":96,"range":{"start_line":96,"start_character":13,"end_line":96,"end_character":17},"in_reply_to":"7f231b9d_ce360b52","updated":"2017-06-20 03:19:57.000000000","message":"Done","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":21922,"name":"Dobroslaw Zybort","email":"dobroslaw.zybort@ts.fujitsu.com","username":"dobrolaw.zybort"},"change_message_id":"b6a5954d69868f714c1aae256ef27f4066cfc663","unresolved":false,"context_lines":[{"line_number":113,"context_line":"            if self._check_response(result):"},{"line_number":114,"context_line":"                self._log.info(\"Notification successfully posted.\")"},{"line_number":115,"context_line":"                return True"},{"line_number":116,"context_line":"            else:"},{"line_number":117,"context_line":"                self._log.error(\"Failed to send to slack on URL {}.\".format(url))"},{"line_number":118,"context_line":"                return False"},{"line_number":119,"context_line":"        except Exception as err:"},{"line_number":120,"context_line":"            self._log.exception(\"Error trying to send to slack on URL {}. Detail: {}\""},{"line_number":121,"context_line":"                                .format(url, err))"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_cf001e05","line":118,"range":{"start_line":116,"start_character":0,"end_line":118,"end_character":28},"updated":"2017-06-19 08:18:20.000000000","message":"Remove `else`. Just return error and False on anything else than success (unindent 117-118) because success will exit function.","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"18fbbd3ea5ebdc45d4792b64bbdd2aa162b24d1e","unresolved":false,"context_lines":[{"line_number":113,"context_line":"            if self._check_response(result):"},{"line_number":114,"context_line":"                self._log.info(\"Notification successfully posted.\")"},{"line_number":115,"context_line":"                return True"},{"line_number":116,"context_line":"            else:"},{"line_number":117,"context_line":"                self._log.error(\"Failed to send to slack on URL {}.\".format(url))"},{"line_number":118,"context_line":"                return False"},{"line_number":119,"context_line":"        except Exception as err:"},{"line_number":120,"context_line":"            self._log.exception(\"Error trying to send to slack on URL {}. Detail: {}\""},{"line_number":121,"context_line":"                                .format(url, err))"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_1672917d","line":118,"range":{"start_line":116,"start_character":0,"end_line":118,"end_character":28},"in_reply_to":"7f231b9d_cf001e05","updated":"2017-06-20 03:19:57.000000000","message":"Done","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"01cc4c5cc55903f5fbee2ee7ecacc0dc1635b79c","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                self._log.error(\"Failed to send to slack on URL {}.\".format(url))"},{"line_number":118,"context_line":"                return False"},{"line_number":119,"context_line":"        except Exception as err:"},{"line_number":120,"context_line":"            self._log.exception(\"Error trying to send to slack on URL {}. Detail: {}\""},{"line_number":121,"context_line":"                                .format(url, err))"},{"line_number":122,"context_line":"            return False"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def send_notification(self, notification):"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_4e49dbb4","line":121,"range":{"start_line":120,"start_character":0,"end_line":121,"end_character":50},"updated":"2017-06-16 08:16:31.000000000","message":"It is better to understand where to insert a value.","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"01cc4c5cc55903f5fbee2ee7ecacc0dc1635b79c","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        # Default option is to do cert verification"},{"line_number":142,"context_line":"        verify \u003d not self._config.get(\u0027insecure\u0027, True)"},{"line_number":143,"context_line":"        # If ca_certs is specified, do cert validation and ignore insecure flag"},{"line_number":144,"context_line":"        if (self._config.get(\"ca_certs\")):"},{"line_number":145,"context_line":"            verify \u003d self._config.get(\"ca_certs\")"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        proxyDict \u003d None"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_aedd0fe1","line":144,"range":{"start_line":144,"start_character":29,"end_line":144,"end_character":39},"updated":"2017-06-16 08:16:31.000000000","message":"ditto #90","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"18fbbd3ea5ebdc45d4792b64bbdd2aa162b24d1e","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        # Default option is to do cert verification"},{"line_number":142,"context_line":"        verify \u003d not self._config.get(\u0027insecure\u0027, True)"},{"line_number":143,"context_line":"        # If ca_certs is specified, do cert validation and ignore insecure flag"},{"line_number":144,"context_line":"        if (self._config.get(\"ca_certs\")):"},{"line_number":145,"context_line":"            verify \u003d self._config.get(\"ca_certs\")"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        proxyDict \u003d None"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_f66ef594","line":144,"range":{"start_line":144,"start_character":29,"end_line":144,"end_character":39},"in_reply_to":"7f231b9d_aedd0fe1","updated":"2017-06-20 03:19:57.000000000","message":"Done","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"01cc4c5cc55903f5fbee2ee7ecacc0dc1635b79c","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            data_format_list \u003d [\u0027data\u0027]"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        for data_format in data_format_list:"},{"line_number":156,"context_line":"            self._log.info(\"Trying to send message to {} as {}\""},{"line_number":157,"context_line":"                           .format(url, data_format))"},{"line_number":158,"context_line":"            request_options \u003d {"},{"line_number":159,"context_line":"                \u0027url\u0027: url,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_113d468e","line":156,"updated":"2017-06-16 08:16:31.000000000","message":"How about displaying \u0027success\u0027 message?  Currently, following cases exist:\n\n* Trying to send message to ...\n* Failed to send message to ...","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"18fbbd3ea5ebdc45d4792b64bbdd2aa162b24d1e","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            data_format_list \u003d [\u0027data\u0027]"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        for data_format in data_format_list:"},{"line_number":156,"context_line":"            self._log.info(\"Trying to send message to {} as {}\""},{"line_number":157,"context_line":"                           .format(url, data_format))"},{"line_number":158,"context_line":"            request_options \u003d {"},{"line_number":159,"context_line":"                \u0027url\u0027: url,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_f6c0357f","line":156,"in_reply_to":"7f231b9d_113d468e","updated":"2017-06-20 03:19:57.000000000","message":"For success case, the message should be output here.\n\nhttps://review.openstack.org/#/c/467877/11/monasca_notification/plugins/slack_notifier.py@114\n\nSo I think it\u0027s redundant to output success message here.","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":21922,"name":"Dobroslaw Zybort","email":"dobroslaw.zybort@ts.fujitsu.com","username":"dobrolaw.zybort"},"change_message_id":"b6a5954d69868f714c1aae256ef27f4066cfc663","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                    # Add the url which can handle only raw data to cache"},{"line_number":170,"context_line":"                    SlackNotifier._raw_data_url_caches.append(url)"},{"line_number":171,"context_line":"                return True"},{"line_number":172,"context_line":"            else:"},{"line_number":173,"context_line":"                self._log.info(\"Failed to send message to {} as {}\""},{"line_number":174,"context_line":"                               .format(url, data_format))"},{"line_number":175,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_4dfbf6bf","line":174,"range":{"start_line":172,"start_character":0,"end_line":174,"end_character":57},"updated":"2017-06-19 08:18:20.000000000","message":"Same like in 116, remove else and unindent 173-174","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"18fbbd3ea5ebdc45d4792b64bbdd2aa162b24d1e","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                    # Add the url which can handle only raw data to cache"},{"line_number":170,"context_line":"                    SlackNotifier._raw_data_url_caches.append(url)"},{"line_number":171,"context_line":"                return True"},{"line_number":172,"context_line":"            else:"},{"line_number":173,"context_line":"                self._log.info(\"Failed to send message to {} as {}\""},{"line_number":174,"context_line":"                               .format(url, data_format))"},{"line_number":175,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_4ccf58b0","line":174,"range":{"start_line":172,"start_character":0,"end_line":174,"end_character":57},"in_reply_to":"7f231b9d_4dfbf6bf","updated":"2017-06-20 03:19:57.000000000","message":"Done","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"792d7f1f835fd7faf8c041031a9824f504bd9807","unresolved":false,"context_lines":[{"line_number":102,"context_line":"                self._log.error(\u0027Received an error message when trying to send to slack. error\u003d{}\u0027"},{"line_number":103,"context_line":"                                .format(response.get(\u0027error\u0027)))"},{"line_number":104,"context_line":"                return False"},{"line_number":105,"context_line":"        elif self.RESPONSE_OK \u003d\u003d result.text:"},{"line_number":106,"context_line":"            return True"},{"line_number":107,"context_line":"        else:"},{"line_number":108,"context_line":"            self._log.error(\u0027Received an error message when trying to send to slack. error\u003d{}\u0027"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f1d235d_9f1ae27a","line":105,"range":{"start_line":105,"start_character":8,"end_line":105,"end_character":28},"updated":"2017-07-03 09:51:26.000000000","message":"Question:  Is there a reason that you check result.text instead of HTTP status code?","commit_id":"da1f972f74a783fa5cde5ceaf06c2ac6b9d5fcb8"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"8ae53c232654752abbd0ad2b1ec5230dc15b0ca8","unresolved":false,"context_lines":[{"line_number":102,"context_line":"                self._log.error(\u0027Received an error message when trying to send to slack. error\u003d{}\u0027"},{"line_number":103,"context_line":"                                .format(response.get(\u0027error\u0027)))"},{"line_number":104,"context_line":"                return False"},{"line_number":105,"context_line":"        elif self.RESPONSE_OK \u003d\u003d result.text:"},{"line_number":106,"context_line":"            return True"},{"line_number":107,"context_line":"        else:"},{"line_number":108,"context_line":"            self._log.error(\u0027Received an error message when trying to send to slack. error\u003d{}\u0027"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f1d235d_6c550dc6","line":105,"range":{"start_line":105,"start_character":8,"end_line":105,"end_character":28},"in_reply_to":"3f1d235d_813712e4","updated":"2017-07-04 01:31:44.000000000","message":"OK, thanks for your answer.  So, we should validate using response message.","commit_id":"da1f972f74a783fa5cde5ceaf06c2ac6b9d5fcb8"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"fdce03cf47ca23c85a6eae85816b49a8fff2abc7","unresolved":false,"context_lines":[{"line_number":102,"context_line":"                self._log.error(\u0027Received an error message when trying to send to slack. error\u003d{}\u0027"},{"line_number":103,"context_line":"                                .format(response.get(\u0027error\u0027)))"},{"line_number":104,"context_line":"                return False"},{"line_number":105,"context_line":"        elif self.RESPONSE_OK \u003d\u003d result.text:"},{"line_number":106,"context_line":"            return True"},{"line_number":107,"context_line":"        else:"},{"line_number":108,"context_line":"            self._log.error(\u0027Received an error message when trying to send to slack. error\u003d{}\u0027"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f1d235d_813712e4","line":105,"range":{"start_line":105,"start_character":8,"end_line":105,"end_character":28},"in_reply_to":"3f1d235d_9f1ae27a","updated":"2017-07-04 00:09:53.000000000","message":"As describing @L121, Slack returns 200 if the request fails.\nIt\u0027s necessary to check the response message to know whether the request succeeds or not.","commit_id":"da1f972f74a783fa5cde5ceaf06c2ac6b9d5fcb8"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"9c1c9c7de0bc2de6d2211abc71ea93e46a66480d","unresolved":false,"context_lines":[{"line_number":176,"context_line":"                if (data_format \u003d\u003d \u0027data\u0027 and"},{"line_number":177,"context_line":"                        url not in SlackNotifier._raw_data_url_caches):"},{"line_number":178,"context_line":"                    # Add the url which can handle only raw data to cache"},{"line_number":179,"context_line":"                    SlackNotifier._raw_data_url_caches.append(url)"},{"line_number":180,"context_line":"                return True"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"            self._log.info(\u0027Failed to send message to {} as {}\u0027"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f1d235d_6ccaad6d","line":179,"updated":"2017-07-04 01:45:17.000000000","message":"As we discussed, current implementation, project user can exceed a limitation\nof memory for each process.  So, I think we should have an upper-constraint like\nquotas.  How about having limitation the number of caching URL for each project?","commit_id":"da1f972f74a783fa5cde5ceaf06c2ac6b9d5fcb8"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"ef9053f5380079c36c2166740ddb750d47135543","unresolved":false,"context_lines":[{"line_number":176,"context_line":"                if (data_format \u003d\u003d \u0027data\u0027 and"},{"line_number":177,"context_line":"                        url not in SlackNotifier._raw_data_url_caches):"},{"line_number":178,"context_line":"                    # Add the url which can handle only raw data to cache"},{"line_number":179,"context_line":"                    SlackNotifier._raw_data_url_caches.append(url)"},{"line_number":180,"context_line":"                return True"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"            self._log.info(\u0027Failed to send message to {} as {}\u0027"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f1d235d_b97002de","line":179,"in_reply_to":"3f1d235d_6ccaad6d","updated":"2017-07-04 04:38:26.000000000","message":"Thanks for your review.\nI add just a size limitation here at this moment, and I\u0027d like to consider to have quota feature for the number of notification and alarm definition in the future.","commit_id":"da1f972f74a783fa5cde5ceaf06c2ac6b9d5fcb8"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"133a47ffc81a52de664a79877fe982be2b029883","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        url \u003d urllib.parse.urljoin(address, urllib.parse.urlparse(address).path)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        # Default option is to do cert verification"},{"line_number":152,"context_line":"        verify \u003d not self._config.get(self.CONFIG_INSECURE, True)"},{"line_number":153,"context_line":"        # If ca_certs is specified, do cert validation and ignore insecure flag"},{"line_number":154,"context_line":"        if (self._config.get(self.CONFIG_CA_CERTS)):"},{"line_number":155,"context_line":"            verify \u003d self._config.get(self.CONFIG_CA_CERTS)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f1a1f67_986c7a09","line":152,"updated":"2017-07-12 22:51:30.000000000","message":"Guess L152 to L155 can be written as\n\n  verify \u003d self._config.get(CONFIG_CA_CERTS, self._config.get(CONFIG_INSECURE, True))","commit_id":"abf5d4bb27f85c6be1df999bd76585126f4a2f37"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"86f0df6fc3cd671b130464a69d5b8f728f6cfdea","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        url \u003d urllib.parse.urljoin(address, urllib.parse.urlparse(address).path)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        # Default option is to do cert verification"},{"line_number":152,"context_line":"        verify \u003d not self._config.get(self.CONFIG_INSECURE, True)"},{"line_number":153,"context_line":"        # If ca_certs is specified, do cert validation and ignore insecure flag"},{"line_number":154,"context_line":"        if (self._config.get(self.CONFIG_CA_CERTS)):"},{"line_number":155,"context_line":"            verify \u003d self._config.get(self.CONFIG_CA_CERTS)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f1a1f67_da101851","line":152,"in_reply_to":"1f1a1f67_986c7a09","updated":"2017-07-18 05:14:14.000000000","message":"Thanks! I added the test cases for here and change here to the following.\n\n verify \u003d self._config.get(self.CONFIG_CA_CERTS,\n                           (not self._config.get(self.CONFIG_INSECURE, True)))","commit_id":"abf5d4bb27f85c6be1df999bd76585126f4a2f37"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"133a47ffc81a52de664a79877fe982be2b029883","unresolved":false,"context_lines":[{"line_number":155,"context_line":"            verify \u003d self._config.get(self.CONFIG_CA_CERTS)"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        proxyDict \u003d None"},{"line_number":158,"context_line":"        if (self._config.get(self.CONFIG_PROXY)):"},{"line_number":159,"context_line":"            proxyDict \u003d {\u0027https\u0027: self._config.get(self.CONFIG_PROXY)}"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"        data_format_list \u003d [\u0027json\u0027, \u0027data\u0027]"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f1a1f67_5876e2da","line":158,"updated":"2017-07-12 22:51:30.000000000","message":"should be self._config.has","commit_id":"abf5d4bb27f85c6be1df999bd76585126f4a2f37"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"86f0df6fc3cd671b130464a69d5b8f728f6cfdea","unresolved":false,"context_lines":[{"line_number":155,"context_line":"            verify \u003d self._config.get(self.CONFIG_CA_CERTS)"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        proxyDict \u003d None"},{"line_number":158,"context_line":"        if (self._config.get(self.CONFIG_PROXY)):"},{"line_number":159,"context_line":"            proxyDict \u003d {\u0027https\u0027: self._config.get(self.CONFIG_PROXY)}"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"        data_format_list \u003d [\u0027json\u0027, \u0027data\u0027]"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f1a1f67_5a2e4892","line":158,"in_reply_to":"1f1a1f67_5876e2da","updated":"2017-07-18 05:14:14.000000000","message":"Done","commit_id":"abf5d4bb27f85c6be1df999bd76585126f4a2f37"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"bfed58e071ceb75fca610f59c0b89001b219ac08","unresolved":false,"context_lines":[{"line_number":176,"context_line":"            if self._send_message(request_options):"},{"line_number":177,"context_line":"                if (data_format \u003d\u003d \u0027data\u0027 and"},{"line_number":178,"context_line":"                        url not in SlackNotifier._raw_data_url_caches and"},{"line_number":179,"context_line":"                        len(SlackNotifier._raw_data_url_caches) \u003c self.MAX_CACHE_SIZE):"},{"line_number":180,"context_line":"                    # Add the url which can handle only raw data to cache"},{"line_number":181,"context_line":"                    SlackNotifier._raw_data_url_caches.append(url)"},{"line_number":182,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f1d235d_b27017de","line":179,"updated":"2017-07-04 07:22:58.000000000","message":"Shouldn\u0027t we drop oldest entries ?","commit_id":"abf5d4bb27f85c6be1df999bd76585126f4a2f37"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"86f0df6fc3cd671b130464a69d5b8f728f6cfdea","unresolved":false,"context_lines":[{"line_number":176,"context_line":"            if self._send_message(request_options):"},{"line_number":177,"context_line":"                if (data_format \u003d\u003d \u0027data\u0027 and"},{"line_number":178,"context_line":"                        url not in SlackNotifier._raw_data_url_caches and"},{"line_number":179,"context_line":"                        len(SlackNotifier._raw_data_url_caches) \u003c self.MAX_CACHE_SIZE):"},{"line_number":180,"context_line":"                    # Add the url which can handle only raw data to cache"},{"line_number":181,"context_line":"                    SlackNotifier._raw_data_url_caches.append(url)"},{"line_number":182,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f1a1f67_ba8e7c76","line":179,"in_reply_to":"3f1d235d_47eeaab4","updated":"2017-07-18 05:14:14.000000000","message":"Done","commit_id":"abf5d4bb27f85c6be1df999bd76585126f4a2f37"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"133a47ffc81a52de664a79877fe982be2b029883","unresolved":false,"context_lines":[{"line_number":176,"context_line":"            if self._send_message(request_options):"},{"line_number":177,"context_line":"                if (data_format \u003d\u003d \u0027data\u0027 and"},{"line_number":178,"context_line":"                        url not in SlackNotifier._raw_data_url_caches and"},{"line_number":179,"context_line":"                        len(SlackNotifier._raw_data_url_caches) \u003c self.MAX_CACHE_SIZE):"},{"line_number":180,"context_line":"                    # Add the url which can handle only raw data to cache"},{"line_number":181,"context_line":"                    SlackNotifier._raw_data_url_caches.append(url)"},{"line_number":182,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f1a1f67_d819d288","line":179,"in_reply_to":"3f1d235d_47eeaab4","updated":"2017-07-12 22:51:30.000000000","message":"Ok, but are adding to the list only if cache is not filled (MAX_CACHE_SIZE) but I don\u0027t see anywhere a place that does what you wrote (newest, latest [whatever] entries in cache will be sth). You just have the one place that you modify this cache and at the moment when cache will be filed you won\u0027t be able to add anything new.","commit_id":"abf5d4bb27f85c6be1df999bd76585126f4a2f37"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"0c93a84011ec6e6101368926c0a9c2060235ea60","unresolved":false,"context_lines":[{"line_number":176,"context_line":"            if self._send_message(request_options):"},{"line_number":177,"context_line":"                if (data_format \u003d\u003d \u0027data\u0027 and"},{"line_number":178,"context_line":"                        url not in SlackNotifier._raw_data_url_caches and"},{"line_number":179,"context_line":"                        len(SlackNotifier._raw_data_url_caches) \u003c self.MAX_CACHE_SIZE):"},{"line_number":180,"context_line":"                    # Add the url which can handle only raw data to cache"},{"line_number":181,"context_line":"                    SlackNotifier._raw_data_url_caches.append(url)"},{"line_number":182,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f1d235d_d1e811e3","line":179,"in_reply_to":"3f1d235d_b27017de","updated":"2017-07-05 07:51:00.000000000","message":"In my opinion, it\u0027s better to keep the old one.\n\nIf a malicious user deploys his web application which can handle the request same with slack with raw data and creates huge number of Slack notification with the address to his application, the addresses will be added to this cache.\nIn this case, newer addresses should be malicious ones.","commit_id":"abf5d4bb27f85c6be1df999bd76585126f4a2f37"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"aae404e61cf54da6b046b97ca4ff460beff563f8","unresolved":false,"context_lines":[{"line_number":176,"context_line":"            if self._send_message(request_options):"},{"line_number":177,"context_line":"                if (data_format \u003d\u003d \u0027data\u0027 and"},{"line_number":178,"context_line":"                        url not in SlackNotifier._raw_data_url_caches and"},{"line_number":179,"context_line":"                        len(SlackNotifier._raw_data_url_caches) \u003c self.MAX_CACHE_SIZE):"},{"line_number":180,"context_line":"                    # Add the url which can handle only raw data to cache"},{"line_number":181,"context_line":"                    SlackNotifier._raw_data_url_caches.append(url)"},{"line_number":182,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f1d235d_47eeaab4","line":179,"in_reply_to":"3f1d235d_d1e811e3","updated":"2017-07-12 07:33:04.000000000","message":"It\u0027s better to add \u0027# TODO:\u0027 or \u0027# NOTE\u0027 as a reminder to fix this logic in the future.","commit_id":"abf5d4bb27f85c6be1df999bd76585126f4a2f37"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"4df18d6d84fad8042cc874afe9550a616441eda1","unresolved":false,"context_lines":[{"line_number":34,"context_line":"             b. https://api.slack.com/tokens"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"   example:"},{"line_number":37,"context_line":"   monasca notification-create slack-notification slack \\"},{"line_number":38,"context_line":"   \"https://slack.com/api/chat.postMessage?token\u003dtoken\u0026channel\u003d#channel\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"ff346bd7_149b98c9","line":37,"updated":"2017-07-24 08:12:54.000000000","message":"[Nit] Is this a CLI?  If so, better to add \"$\" or \"#\" explicitly for readability.","commit_id":"68bb801fbfd18d20c10a4273899617009e23cec6"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"6c8194a02f34e19aaa8e6dedec383d9b69d2953a","unresolved":false,"context_lines":[{"line_number":34,"context_line":"             b. https://api.slack.com/tokens"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"   example:"},{"line_number":37,"context_line":"   monasca notification-create slack-notification slack \\"},{"line_number":38,"context_line":"   \"https://slack.com/api/chat.postMessage?token\u003dtoken\u0026channel\u003d#channel\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"ff346bd7_d4b190e3","line":37,"in_reply_to":"ff346bd7_149b98c9","updated":"2017-07-24 08:24:26.000000000","message":"Done","commit_id":"68bb801fbfd18d20c10a4273899617009e23cec6"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"d1e3aae88edf30921f3177f718c13c29501a85be","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from six.moves import urllib"},{"line_number":18,"context_line":"import ujson as json"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from monasca_notification.plugins import abstract_notifier"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"\"\"\""},{"line_number":23,"context_line":"   This module is a notification plugin to integrate with Slack."}],"source_content_type":"text/x-python","patch_set":20,"id":"ff346bd7_8ad50346","line":20,"updated":"2017-07-25 00:38:28.000000000","message":"nit: 2 blanks is necessary between import definition and start coding. Please refer [1]\n\n[1]https://docs.openstack.org/hacking/latest/user/hacking.html#imports","commit_id":"4fe8e3e7c725982e3bfa02ec80c6047b3e775cf3"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"ee13c0973977199e7966fdd4737e04ad2d62b72c","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from six.moves import urllib"},{"line_number":18,"context_line":"import ujson as json"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from monasca_notification.plugins import abstract_notifier"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"\"\"\""},{"line_number":23,"context_line":"   This module is a notification plugin to integrate with Slack."}],"source_content_type":"text/x-python","patch_set":20,"id":"ff346bd7_ad76a1a3","line":20,"in_reply_to":"ff346bd7_8ad50346","updated":"2017-07-25 01:13:11.000000000","message":"Done","commit_id":"4fe8e3e7c725982e3bfa02ec80c6047b3e775cf3"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"a30be810348421e9fcc54d90a2491ccc5842d154","unresolved":false,"context_lines":[{"line_number":23,"context_line":"class SlackNotifier(abstract_notifier.AbstractNotifier):"},{"line_number":24,"context_line":"    \"\"\"This module is a notification plugin to integrate with Slack."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    This plugin can send notifications via 2 Slack API below."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    1st: Slack API"},{"line_number":29,"context_line":"    notification.address \u003d https://slack.com/api/chat.postMessage?token\u003dtoken\u0026channel\u003d#channel"}],"source_content_type":"text/x-python","patch_set":22,"id":"ff346bd7_9009b496","line":26,"range":{"start_line":26,"start_character":51,"end_line":26,"end_character":55},"updated":"2017-07-25 02:47:23.000000000","message":"APIs","commit_id":"2108693264b286215382289353abe03f6ab0dc2b"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"f74a3ed13e24a7b2723b8a72ca5f50b33bf6e12b","unresolved":false,"context_lines":[{"line_number":23,"context_line":"class SlackNotifier(abstract_notifier.AbstractNotifier):"},{"line_number":24,"context_line":"    \"\"\"This module is a notification plugin to integrate with Slack."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    This plugin can send notifications via 2 Slack API below."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    1st: Slack API"},{"line_number":29,"context_line":"    notification.address \u003d https://slack.com/api/chat.postMessage?token\u003dtoken\u0026channel\u003d#channel"}],"source_content_type":"text/x-python","patch_set":22,"id":"ff346bd7_3f3f7326","line":26,"range":{"start_line":26,"start_character":51,"end_line":26,"end_character":55},"in_reply_to":"ff346bd7_9009b496","updated":"2017-07-25 06:34:05.000000000","message":"Done","commit_id":"2108693264b286215382289353abe03f6ab0dc2b"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"a30be810348421e9fcc54d90a2491ccc5842d154","unresolved":false,"context_lines":[{"line_number":33,"context_line":"              a. https://api.slack.com/docs/oauth-test-tokens"},{"line_number":34,"context_line":"              b. https://api.slack.com/tokens"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    example:"},{"line_number":37,"context_line":"    $ monasca notification-create slack-notification slack \\"},{"line_number":38,"context_line":"    \"https://slack.com/api/chat.postMessage?token\u003dtoken\u0026channel\u003d#channel\""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"ff346bd7_d0ba9c08","line":36,"range":{"start_line":36,"start_character":4,"end_line":36,"end_character":12},"updated":"2017-07-25 02:47:23.000000000","message":"Are these description example, aren\u0027t you?  No need to specify \u0027example\u0027 for each line and it\u0027s enough to specify at the top of doc.","commit_id":"2108693264b286215382289353abe03f6ab0dc2b"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"f74a3ed13e24a7b2723b8a72ca5f50b33bf6e12b","unresolved":false,"context_lines":[{"line_number":33,"context_line":"              a. https://api.slack.com/docs/oauth-test-tokens"},{"line_number":34,"context_line":"              b. https://api.slack.com/tokens"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    example:"},{"line_number":37,"context_line":"    $ monasca notification-create slack-notification slack \\"},{"line_number":38,"context_line":"    \"https://slack.com/api/chat.postMessage?token\u003dtoken\u0026channel\u003d#channel\""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"ff346bd7_7f83bbcd","line":36,"range":{"start_line":36,"start_character":4,"end_line":36,"end_character":12},"in_reply_to":"ff346bd7_d0ba9c08","updated":"2017-07-25 06:34:05.000000000","message":"I intended to explain the CLI example here, but basically users can create the notification by GUI.\nThis CLI example is not so useful for the users, so I removed here.","commit_id":"2108693264b286215382289353abe03f6ab0dc2b"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"a30be810348421e9fcc54d90a2491ccc5842d154","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    2nd: Incoming webhook"},{"line_number":42,"context_line":"    notification.address \u003d https://hooks.slack.com/services/XXXXX/XXXXX/xxxxxxxxx"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    Slack document about incoming webhook:"},{"line_number":45,"context_line":"         https://api.slack.com/incoming-webhooks"}],"source_content_type":"text/x-python","patch_set":22,"id":"ff346bd7_50446c1b","line":42,"range":{"start_line":42,"start_character":27,"end_line":42,"end_character":81},"updated":"2017-07-25 02:47:23.000000000","message":"Is there some reason that you chose such long URL example?  How about as follows?\n\n https://hooks.slack.com/services/foo","commit_id":"2108693264b286215382289353abe03f6ab0dc2b"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"f74a3ed13e24a7b2723b8a72ca5f50b33bf6e12b","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    2nd: Incoming webhook"},{"line_number":42,"context_line":"    notification.address \u003d https://hooks.slack.com/services/XXXXX/XXXXX/xxxxxxxxx"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    Slack document about incoming webhook:"},{"line_number":45,"context_line":"         https://api.slack.com/incoming-webhooks"}],"source_content_type":"text/x-python","patch_set":22,"id":"ff346bd7_ff07ab1b","line":42,"range":{"start_line":42,"start_character":27,"end_line":42,"end_character":81},"in_reply_to":"ff346bd7_50446c1b","updated":"2017-07-25 06:34:05.000000000","message":"The URL of the incoming webhook is like below.\nhttps://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX\n\nI changed here as following to make it easy to understand what users need to specify for the address.\n\nhttps://hooks.slack.com/services/foo/bar/baz\n\nFor more detail, please see the following link.\nhttps://api.slack.com/incoming-webhooks","commit_id":"2108693264b286215382289353abe03f6ab0dc2b"}],"tests/test_slack_notification.py":[{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"8d5d17bcd8c48f5dbfbe93f23e8a9df33d8de5da","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"import json"},{"line_number":15,"context_line":"import mock"},{"line_number":16,"context_line":"import unittest"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import six"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"df140735_59105a00","line":16,"updated":"2017-06-06 04:59:38.000000000","message":"oslotest","commit_id":"bce251d4dce42d94f4415c132832ec5128be6c14"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"5a1b497becc061dfd099885e74f07e25ad7c68a7","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"import json"},{"line_number":15,"context_line":"import mock"},{"line_number":16,"context_line":"import unittest"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import six"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bf091321_29e65218","line":16,"in_reply_to":"df140735_59105a00","updated":"2017-06-08 04:35:10.000000000","message":"I\u0027m addressing to change with oslotest now.","commit_id":"bce251d4dce42d94f4415c132832ec5128be6c14"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"01cc4c5cc55903f5fbee2ee7ecacc0dc1635b79c","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from monasca_notification import notification as m_notification"},{"line_number":22,"context_line":"from monasca_notification.plugins import slack_notifier"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"if six.PY2:"},{"line_number":25,"context_line":"    import Queue as queue"},{"line_number":26,"context_line":"else:"},{"line_number":27,"context_line":"    import queue"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_4e531b3a","line":24,"range":{"start_line":24,"start_character":0,"end_line":24,"end_character":10},"updated":"2017-06-16 08:16:31.000000000","message":"In my understanding, OpenStack components will support python3.x only.  Is monasca keep on supporting python2.x ?If so, no need to change.","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"01cc4c5cc55903f5fbee2ee7ecacc0dc1635b79c","unresolved":false,"context_lines":[{"line_number":42,"context_line":"            \"metrics\": metrics}"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"def slack_text():"},{"line_number":45,"context_line":"    body \u003d {\"old_state\": \"OK\","},{"line_number":46,"context_line":"            \"alarm_description\": \"test Alarm description\","},{"line_number":47,"context_line":"            \"message\": \"I am alarming!\","},{"line_number":48,"context_line":"            \"alarm_definition_id\": 0,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_8eaff328","line":45,"updated":"2017-06-16 08:16:31.000000000","message":"return { ...\n}","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":21922,"name":"Dobroslaw Zybort","email":"dobroslaw.zybort@ts.fujitsu.com","username":"dobrolaw.zybort"},"change_message_id":"b6a5954d69868f714c1aae256ef27f4066cfc663","unresolved":false,"context_lines":[{"line_number":42,"context_line":"            \"metrics\": metrics}"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"def slack_text():"},{"line_number":45,"context_line":"    body \u003d {\"old_state\": \"OK\","},{"line_number":46,"context_line":"            \"alarm_description\": \"test Alarm description\","},{"line_number":47,"context_line":"            \"message\": \"I am alarming!\","},{"line_number":48,"context_line":"            \"alarm_definition_id\": 0,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_ed1402eb","line":45,"in_reply_to":"7f231b9d_8eaff328","updated":"2017-06-19 08:18:20.000000000","message":"+1","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"01cc4c5cc55903f5fbee2ee7ecacc0dc1635b79c","unresolved":false,"context_lines":[{"line_number":110,"context_line":"    def _validate_post_args(self, post_args, data_format):"},{"line_number":111,"context_line":"        self.assertEqual(json.loads(post_args.get(data_format).get(\u0027text\u0027)), slack_text())"},{"line_number":112,"context_line":"        self.assertEqual(post_args.get(\u0027proxies\u0027), {\u0027https\u0027: \u0027http://yourid:password@proxyserver:8080\u0027})"},{"line_number":113,"context_line":"        self.assertEqual(post_args.get(\u0027timeout\u0027), 50)"},{"line_number":114,"context_line":"        self.assertEqual(post_args.get(\u0027url\u0027), \u0027http://test.slack:3333\u0027)"},{"line_number":115,"context_line":"        self.assertEqual(post_args.get(\u0027verify\u0027), \u0027/etc/ssl/certs/ca-bundle.crt\u0027)"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_ce15eb4a","line":113,"updated":"2017-06-16 08:16:31.000000000","message":"Assertion should be described (\u0027expect\u0027, \u0027actual).  Please check all of assertion checker.","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":21922,"name":"Dobroslaw Zybort","email":"dobroslaw.zybort@ts.fujitsu.com","username":"dobrolaw.zybort"},"change_message_id":"b6a5954d69868f714c1aae256ef27f4066cfc663","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        self.assertEqual(slack_notifier.SlackNotifier._raw_data_url_caches, [])"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def test_slack_webhook_fail(self):"},{"line_number":128,"context_line":"        \"\"\"data is sent twice as json and raw data, and slack returns failure both"},{"line_number":129,"context_line":"        \"\"\""},{"line_number":130,"context_line":"        response_list \u003d [RequestsResponse(200, \u0027failure\u0027, {\u0027Content-Type\u0027: \u0027application/text\u0027}),"},{"line_number":131,"context_line":"                         RequestsResponse(200, \u0027{\"ok\":false,\"error\":\"failure\"}\u0027, {\u0027Content-Type\u0027: \u0027application/json\u0027})]"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_cd914649","line":128,"range":{"start_line":128,"start_character":77,"end_line":128,"end_character":82},"updated":"2017-06-19 08:18:20.000000000","message":"for both requests","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"01cc4c5cc55903f5fbee2ee7ecacc0dc1635b79c","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        \"\"\"data is sent twice as json and raw data, and slack returns failure both"},{"line_number":129,"context_line":"        \"\"\""},{"line_number":130,"context_line":"        response_list \u003d [RequestsResponse(200, \u0027failure\u0027, {\u0027Content-Type\u0027: \u0027application/text\u0027}),"},{"line_number":131,"context_line":"                         RequestsResponse(200, \u0027{\"ok\":false,\"error\":\"failure\"}\u0027, {\u0027Content-Type\u0027: \u0027application/json\u0027})]"},{"line_number":132,"context_line":"        mock_method, result \u003d self._notify(response_list, self._slack_config)"},{"line_number":133,"context_line":"        self.assertFalse(result)"},{"line_number":134,"context_line":"        self._validate_post_args(mock_method.call_args_list[0][1], \u0027json\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f231b9d_f16e4ac7","line":131,"updated":"2017-06-16 08:16:31.000000000","message":"\u003e 80 col!?","commit_id":"82ab9d39aee07d4e6dd1637627ef03106dec4e05"}]}
