)]}'
{"doc/source/plugins.rst":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"b3a3b00c4563442ea599be1822d06d0b4b6a657f","unresolved":false,"context_lines":[{"line_number":222,"context_line":"|                     |               | suffixed with a timestamp. Group    |                           |"},{"line_number":223,"context_line":"|                     |               | name cannot begin with an           |                           |"},{"line_number":224,"context_line":"|                     |               | underscore, must be lowercase       |                           |"},{"line_number":225,"context_line":"|                     |               | alphanumeric characters.            |                           |"},{"line_number":226,"context_line":"+---------------------+---------------+-------------------------------------+---------------------------+"},{"line_number":227,"context_line":"| include_region_name |               | Defined for all plugins. Controls   | | Restart services        |"},{"line_number":228,"context_line":"|                     |               | whether or not to include           | | Reindex all             |"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a89bdaa_6e785190","line":225,"updated":"2016-09-06 16:22:08.000000000","message":"We need to be explicit that underscores are valid, only not at the beginning. Maybe something like this:\n\n    Group names must consist of only lowercase alphanumeric\n    characters and underscores. The first character cannot\n    be an underscore.","commit_id":"f8d9a4d563dc1011caf6958de74177f7cf2766ac"},{"author":{"_account_id":16150,"name":"Lei Zhang","email":"lei.a.zhang@intel.com","username":"leizhang"},"change_message_id":"654954d52cb3d4e8c2d2fa1e1639d0d14a330976","unresolved":false,"context_lines":[{"line_number":222,"context_line":"|                     |               | suffixed with a timestamp. Group    |                           |"},{"line_number":223,"context_line":"|                     |               | name cannot begin with an           |                           |"},{"line_number":224,"context_line":"|                     |               | underscore, must be lowercase       |                           |"},{"line_number":225,"context_line":"|                     |               | alphanumeric characters.            |                           |"},{"line_number":226,"context_line":"+---------------------+---------------+-------------------------------------+---------------------------+"},{"line_number":227,"context_line":"| include_region_name |               | Defined for all plugins. Controls   | | Restart services        |"},{"line_number":228,"context_line":"|                     |               | whether or not to include           | | Reindex all             |"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a89bdaa_f88ed077","line":225,"in_reply_to":"9a89bdaa_6e785190","updated":"2016-09-07 02:15:35.000000000","message":"Done","commit_id":"f8d9a4d563dc1011caf6958de74177f7cf2766ac"}],"searchlight/elasticsearch/plugins/base.py":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"b3a3b00c4563442ea599be1822d06d0b4b6a657f","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"resource_group_reg \u003d re.compile(r\u0027^[a-z0-9][a-z0-9_]+$\u0027)"},{"line_number":39,"context_line":"indexer_opts \u003d ["},{"line_number":40,"context_line":"    cfg.Opt(\u0027resource_group_name\u0027, default\u003d\"searchlight\","},{"line_number":41,"context_line":"            help\u003d\"The default base name for accessing Elasticsearch\","}],"source_content_type":"text/x-python","patch_set":4,"id":"9a89bdaa_8b458771","line":38,"range":{"start_line":38,"start_character":52,"end_line":38,"end_character":53},"updated":"2016-09-06 16:22:08.000000000","message":"This is incorrect. The \u0027+\u0027 (at least one) should be a \u0027*\u0027 (zero or more). As is, this expression will reject the valid resource group name \"s\", since it is expecting at least two characters. Switching over to \u0027*\u0027 will allow a single character name.","commit_id":"f8d9a4d563dc1011caf6958de74177f7cf2766ac"},{"author":{"_account_id":16150,"name":"Lei Zhang","email":"lei.a.zhang@intel.com","username":"leizhang"},"change_message_id":"654954d52cb3d4e8c2d2fa1e1639d0d14a330976","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"resource_group_reg \u003d re.compile(r\u0027^[a-z0-9][a-z0-9_]+$\u0027)"},{"line_number":39,"context_line":"indexer_opts \u003d ["},{"line_number":40,"context_line":"    cfg.Opt(\u0027resource_group_name\u0027, default\u003d\"searchlight\","},{"line_number":41,"context_line":"            help\u003d\"The default base name for accessing Elasticsearch\","}],"source_content_type":"text/x-python","patch_set":4,"id":"9a89bdaa_58f09cfe","line":38,"range":{"start_line":38,"start_character":52,"end_line":38,"end_character":53},"in_reply_to":"9a89bdaa_8b458771","updated":"2016-09-07 02:15:35.000000000","message":"Good catch, thanks","commit_id":"f8d9a4d563dc1011caf6958de74177f7cf2766ac"}],"searchlight/elasticsearch/plugins/utils.py":[{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"bdee645e207b440229bff58977f013941982f31f","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    \"\"\"Rules for index name:"},{"line_number":176,"context_line":"       1. Must be lowercase"},{"line_number":177,"context_line":"       2. Cannot begin with an underscore"},{"line_number":178,"context_line":"       3. Cannot contain commas"},{"line_number":179,"context_line":"       This function verifies invalid index name."},{"line_number":180,"context_line":"    \"\"\""},{"line_number":181,"context_line":"    new_index_name \u003d index_name.replace(\u0027,\u0027, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_a714ba4c","line":178,"updated":"2016-07-07 00:45:08.000000000","message":"There are other rules, see the link below for detail: \nhttps://github.com/elastic/elasticsearch/blob/8c40b2b54eac3e3ab3c41ece5c758be75173191b/core/src/main/java/org/elasticsearch/cluster/metadata/MetaDataCreateIndexService.java#L147-L158\n\nhttps://github.com/elastic/elasticsearch/blob/d3d57da89ff3ae4071f93af97c1f71e7b8d3364a/core/src/main/java/org/elasticsearch/common/Strings.java#L406","commit_id":"14de94b06ccc8ca24a2d0873bcd46e4342268242"},{"author":{"_account_id":16150,"name":"Lei Zhang","email":"lei.a.zhang@intel.com","username":"leizhang"},"change_message_id":"3f90c7e096eb0fcf560453f4eded6dce8bfabbbe","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    \"\"\"Rules for index name:"},{"line_number":176,"context_line":"       1. Must be lowercase"},{"line_number":177,"context_line":"       2. Cannot begin with an underscore"},{"line_number":178,"context_line":"       3. Cannot contain commas"},{"line_number":179,"context_line":"       This function verifies invalid index name."},{"line_number":180,"context_line":"    \"\"\""},{"line_number":181,"context_line":"    new_index_name \u003d index_name.replace(\u0027,\u0027, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_3aa44bb8","line":178,"in_reply_to":"1aa78d24_72ef291e","updated":"2016-07-07 09:49:09.000000000","message":"Done","commit_id":"14de94b06ccc8ca24a2d0873bcd46e4342268242"},{"author":{"_account_id":16150,"name":"Lei Zhang","email":"lei.a.zhang@intel.com","username":"leizhang"},"change_message_id":"aa3718ab03097390840d0518ac748e8f9ef90d1f","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    \"\"\"Rules for index name:"},{"line_number":176,"context_line":"       1. Must be lowercase"},{"line_number":177,"context_line":"       2. Cannot begin with an underscore"},{"line_number":178,"context_line":"       3. Cannot contain commas"},{"line_number":179,"context_line":"       This function verifies invalid index name."},{"line_number":180,"context_line":"    \"\"\""},{"line_number":181,"context_line":"    new_index_name \u003d index_name.replace(\u0027,\u0027, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_c882b3c7","line":178,"in_reply_to":"1aa78d24_a714ba4c","updated":"2016-07-07 02:12:25.000000000","message":"Good catch, thanks! There are some name excptions cannot find in docs. I\u0027m wondering if we should copy rules from the code, I feel like these are ES internal details and may change in the future. Including this verification will certainly increase user friendliness, on the cost of maintaining the logic. What do you think?","commit_id":"14de94b06ccc8ca24a2d0873bcd46e4342268242"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"1ea5b1599d1c9b270294d9d9dff8e5e3338f18f4","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    \"\"\"Rules for index name:"},{"line_number":176,"context_line":"       1. Must be lowercase"},{"line_number":177,"context_line":"       2. Cannot begin with an underscore"},{"line_number":178,"context_line":"       3. Cannot contain commas"},{"line_number":179,"context_line":"       This function verifies invalid index name."},{"line_number":180,"context_line":"    \"\"\""},{"line_number":181,"context_line":"    new_index_name \u003d index_name.replace(\u0027,\u0027, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_72ef291e","line":178,"in_reply_to":"1aa78d24_c882b3c7","updated":"2016-07-07 03:37:02.000000000","message":"Yeah, agree with the concern, but i think we can cover the rules in ES for now, if anything changes in the future, the exception could be catched anyway. And i don\u0027t think ES will change the rules \u0027frequently\u0027:)","commit_id":"14de94b06ccc8ca24a2d0873bcd46e4342268242"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"e2ac3ae6efd39093c37241784052f798c374654b","unresolved":false,"context_lines":[{"line_number":210,"context_line":"       This function verifies invalid index name."},{"line_number":211,"context_line":"    \"\"\""},{"line_number":212,"context_line":"    new_index_name \u003d re.sub(INVALID_INDEX_REG, \u0027\u0027, index_name)"},{"line_number":213,"context_line":"    new_index_name \u003d re.sub(\u0027^_+\u0027, \u0027\u0027, new_index_name).lower()"},{"line_number":214,"context_line":"    if new_index_name in (\u0027.\u0027, \u0027..\u0027, \u0027\u0027):"},{"line_number":215,"context_line":"        new_index_name \u003d \u0027searchlight\u0027"},{"line_number":216,"context_line":"        LOG.warning(_LW("}],"source_content_type":"text/x-python","patch_set":3,"id":"1aa78d24_d08d477d","line":213,"range":{"start_line":213,"start_character":27,"end_line":213,"end_character":30},"updated":"2016-07-12 15:44:35.000000000","message":"For simplicity I don\u0027t think it\u0027s necessary to exactly match the Elasticsearch rules; I\u0027m fine with just disallowing underscore entirely.","commit_id":"a5f1c4f00f216068dc98417a981b693ca5b4fcbb"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"e2ac3ae6efd39093c37241784052f798c374654b","unresolved":false,"context_lines":[{"line_number":212,"context_line":"    new_index_name \u003d re.sub(INVALID_INDEX_REG, \u0027\u0027, index_name)"},{"line_number":213,"context_line":"    new_index_name \u003d re.sub(\u0027^_+\u0027, \u0027\u0027, new_index_name).lower()"},{"line_number":214,"context_line":"    if new_index_name in (\u0027.\u0027, \u0027..\u0027, \u0027\u0027):"},{"line_number":215,"context_line":"        new_index_name \u003d \u0027searchlight\u0027"},{"line_number":216,"context_line":"        LOG.warning(_LW("},{"line_number":217,"context_line":"            \"Invalid index name %(index_name)s, use default index name \""},{"line_number":218,"context_line":"            \"%(new_index_name)s\") % {\"index_name\": index_name,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1aa78d24_d0b6e73c","line":215,"range":{"start_line":215,"start_character":8,"end_line":215,"end_character":22},"updated":"2016-07-12 15:44:35.000000000","message":"Not sure about this - there\u0027s the possibility for collisions and if you\u0027re not watching the logs there\u0027ll be no indication.\n\nThinking about this more I\u0027m leaning heavily towards treating this as an error and refusing to start whichever process is running. \n\nThere\u0027s already an option \u0027regex\u0027 in oslo.config\u0027s string type (http://docs.openstack.org/developer/oslo.config/types.html#oslo_config.types.String). It might be as simple as adding ^[.^#\\/\\\\,*?\"\u0027\u003c\u003e| \\[\\]]+$ as the regex option to resource_group_name with a brief addition to the description. \n\nI could be persuaded otherwise but it feels like refusing to start is safer than silently changing things.","commit_id":"a5f1c4f00f216068dc98417a981b693ca5b4fcbb"},{"author":{"_account_id":16150,"name":"Lei Zhang","email":"lei.a.zhang@intel.com","username":"leizhang"},"change_message_id":"2620c7ce92eff7568797d4c1e297ca3738552e92","unresolved":false,"context_lines":[{"line_number":212,"context_line":"    new_index_name \u003d re.sub(INVALID_INDEX_REG, \u0027\u0027, index_name)"},{"line_number":213,"context_line":"    new_index_name \u003d re.sub(\u0027^_+\u0027, \u0027\u0027, new_index_name).lower()"},{"line_number":214,"context_line":"    if new_index_name in (\u0027.\u0027, \u0027..\u0027, \u0027\u0027):"},{"line_number":215,"context_line":"        new_index_name \u003d \u0027searchlight\u0027"},{"line_number":216,"context_line":"        LOG.warning(_LW("},{"line_number":217,"context_line":"            \"Invalid index name %(index_name)s, use default index name \""},{"line_number":218,"context_line":"            \"%(new_index_name)s\") % {\"index_name\": index_name,"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_4122cdba","line":215,"range":{"start_line":215,"start_character":8,"end_line":215,"end_character":22},"in_reply_to":"1aa78d24_d0b6e73c","updated":"2016-07-18 07:22:24.000000000","message":"Yeah, I agree that treating as an error is better than silently renaming with a log. So much output appears in the screen which is hard to notice the error. My concern is that adding a simple regex rule can\u0027t cover all the invalid name cases. So maybe we\u0027ll end up with two kind of name errors, one is from oslo config check, the other is from elasticsearch. Seems confusing for users. I feel like it\u0027s better to leave it to elasticsearch and we can add some notes about resource group name format in docs. What do you think?","commit_id":"a5f1c4f00f216068dc98417a981b693ca5b4fcbb"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"9fbb00f45cde63ef2b3fa1a310600111962a8d47","unresolved":false,"context_lines":[{"line_number":212,"context_line":"    new_index_name \u003d re.sub(INVALID_INDEX_REG, \u0027\u0027, index_name)"},{"line_number":213,"context_line":"    new_index_name \u003d re.sub(\u0027^_+\u0027, \u0027\u0027, new_index_name).lower()"},{"line_number":214,"context_line":"    if new_index_name in (\u0027.\u0027, \u0027..\u0027, \u0027\u0027):"},{"line_number":215,"context_line":"        new_index_name \u003d \u0027searchlight\u0027"},{"line_number":216,"context_line":"        LOG.warning(_LW("},{"line_number":217,"context_line":"            \"Invalid index name %(index_name)s, use default index name \""},{"line_number":218,"context_line":"            \"%(new_index_name)s\") % {\"index_name\": index_name,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad45d7e_4cd02f54","line":215,"range":{"start_line":215,"start_character":8,"end_line":215,"end_character":22},"in_reply_to":"dada55a8_4122cdba","updated":"2016-08-08 20:23:42.000000000","message":"This is a slippery slope. We are already opening ourselves up to collisions by silently removing invalid characters. See my main comment for details.","commit_id":"a5f1c4f00f216068dc98417a981b693ca5b4fcbb"}],"searchlight/tests/unit/test_plugin_utils.py":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"9fbb00f45cde63ef2b3fa1a310600111962a8d47","unresolved":false,"context_lines":[{"line_number":177,"context_line":"        mock_engine.indices.create.assert_called_with(index\u003d\u0027test-\u0027 + now_str)"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    def test_verify_index_name(self):"},{"line_number":180,"context_line":"        # Test removing invalid characters and leanding underscore"},{"line_number":181,"context_line":"        invalid_names \u003d [\u0027%s__.ABC\u0027 % ch"},{"line_number":182,"context_line":"                         for ch in plugin_utils.INVALID_INDEX_CHARS]"},{"line_number":183,"context_line":"        expected_names \u003d [\u0027.abc\u0027] * len(invalid_names)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad45d7e_b7a01492","line":180,"range":{"start_line":180,"start_character":47,"end_line":180,"end_character":55},"updated":"2016-08-08 20:23:42.000000000","message":"Nit: Should be \"leading\".","commit_id":"a5f1c4f00f216068dc98417a981b693ca5b4fcbb"}]}
