)]}'
{"swift/common/ring/composite_builder.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"9c41003256b7440623c663abb84e5c6dfb9b5619","unresolved":false,"context_lines":[{"line_number":371,"context_line":"        metadata \u003d _make_composite_metadata(loaded_builders)"},{"line_number":372,"context_line":"        for i, component in enumerate(metadata[\u0027components\u0027]):"},{"line_number":373,"context_line":"            # stash builder file for each component"},{"line_number":374,"context_line":"            component[\u0027builder_file\u0027] \u003d builder_files[i]"},{"line_number":375,"context_line":"        return loaded_builders, metadata"},{"line_number":376,"context_line":""},{"line_number":377,"context_line":"    def compose(self, builders\u003dNone, force\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_399f63b5","line":374,"updated":"2017-04-26 03:51:59.000000000","message":"I\u0027m imaging this could be decomposed a bit more... like the composite_metadata and the component list are ids\u0027s and there\u0027s another datastructure/key in the builder.composite json that maybe maps id\u0027s to filenames, or is maybe just a set of filenames that once opened will either match the id\u0027s in the composite_metadata or raise an error.","commit_id":"c101694b33598c1a6e3febdd1bb2f34539929b63"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"8039e3ea928b51dac6373838bad4c6b631f3533d","unresolved":false,"context_lines":[{"line_number":371,"context_line":"        metadata \u003d _make_composite_metadata(loaded_builders)"},{"line_number":372,"context_line":"        for i, component in enumerate(metadata[\u0027components\u0027]):"},{"line_number":373,"context_line":"            # stash builder file for each component"},{"line_number":374,"context_line":"            component[\u0027builder_file\u0027] \u003d builder_files[i]"},{"line_number":375,"context_line":"        return loaded_builders, metadata"},{"line_number":376,"context_line":""},{"line_number":377,"context_line":"    def compose(self, builders\u003dNone, force\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_339ac96d","line":374,"in_reply_to":"5ff73747_399f63b5","updated":"2017-04-26 17:03:02.000000000","message":"ok, I tried breaking the builder_files out to a dict. I\u0027m not sure if that is the most helpful structure - i wonder if having a list of files is more helpful if a human ever gets to this, because that list will reflect the order in which those files should get passed in to, say, a new CompositeRingBuiler instance.\n\nIDK - let\u0027s see how it looks","commit_id":"c101694b33598c1a6e3febdd1bb2f34539929b63"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"9c41003256b7440623c663abb84e5c6dfb9b5619","unresolved":false,"context_lines":[{"line_number":392,"context_line":"        \"\"\""},{"line_number":393,"context_line":"        builders, new_metadata \u003d self.load_builders(builders)"},{"line_number":394,"context_line":"        if self.metadata and not force:"},{"line_number":395,"context_line":"            modified \u003d check_against_existing(self.metadata, new_metadata)"},{"line_number":396,"context_line":"            if not modified:"},{"line_number":397,"context_line":"                raise ValueError("},{"line_number":398,"context_line":"                    \"None of the component builders has been modified\""}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_19a6e711","line":395,"updated":"2017-04-26 03:51:59.000000000","message":"yes, that\u0027s it.","commit_id":"c101694b33598c1a6e3febdd1bb2f34539929b63"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"789f978e6c787775ce512eceb5554bf75fdcc469","unresolved":false,"context_lines":[{"line_number":396,"context_line":"            if not modified:"},{"line_number":397,"context_line":"                raise ValueError("},{"line_number":398,"context_line":"                    \"None of the component builders has been modified\""},{"line_number":399,"context_line":"                    \" since the existing composite ring was built.\")"},{"line_number":400,"context_line":""},{"line_number":401,"context_line":"        self.ring_data \u003d compose_rings(builders)"},{"line_number":402,"context_line":"        self.metadata \u003d new_metadata"}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_3ba2bc4c","line":399,"updated":"2017-04-26 01:54:49.000000000","message":"I\u0027m still questioning the value of this sort of check...\n\nIs it so crazy that someone would do something like\n\n composite \u003d CompositeRingBuilder()\n composite.compose(builders)\n composite.save(composite_builder_path)\n\nwithout actually saving the ring data? Then later when they go to save it with something like\n\n composite \u003d CompositeRingBuilder.load(composite_builder_path)\n composite.compose().save(composite_ring_path)\n\nit\u0027ll ValueError. They\u0027ll have to do\n\n composite.compose(force\u003dTrue).save(composite_ring_path)\n\ninstead which means that we\u0027ll lose the check that the builders we just loaded from disk match the builders we previously referenced.\n\nWhat\u0027s so wrong with composing a ring that hasn\u0027t been modified?","commit_id":"c101694b33598c1a6e3febdd1bb2f34539929b63"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"9c41003256b7440623c663abb84e5c6dfb9b5619","unresolved":false,"context_lines":[{"line_number":396,"context_line":"            if not modified:"},{"line_number":397,"context_line":"                raise ValueError("},{"line_number":398,"context_line":"                    \"None of the component builders has been modified\""},{"line_number":399,"context_line":"                    \" since the existing composite ring was built.\")"},{"line_number":400,"context_line":""},{"line_number":401,"context_line":"        self.ring_data \u003d compose_rings(builders)"},{"line_number":402,"context_line":"        self.metadata \u003d new_metadata"}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_9b1af07a","line":399,"in_reply_to":"5ff73747_3ba2bc4c","updated":"2017-04-26 03:51:59.000000000","message":"I always just `swift-ring-builder \u003cany-component.builder\u003e rebalance -f` and the re-exec\n\nit doesn\u0027t really bother me that it\u0027s trying to warn me about an unexpected condition - re-writing an unchanged ring is cheap but not free - distributing it OTOH can trigger ring reloads that interrupt consistency engine cycles; worth trying to avoid.","commit_id":"c101694b33598c1a6e3febdd1bb2f34539929b63"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"169b7b08997997b06ccad8a4d2891c9499e54677","unresolved":false,"context_lines":[{"line_number":212,"context_line":""},{"line_number":213,"context_line":"def check_against_existing(old_composite_meta, new_composite_meta):"},{"line_number":214,"context_line":"    \"\"\""},{"line_number":215,"context_line":"    Check that the given list of builders and the order are the same as that"},{"line_number":216,"context_line":"    used to build an existing composite ring. Return True if any of the given"},{"line_number":217,"context_line":"    builders has been modified with respect to its state when the given"},{"line_number":218,"context_line":"    component_meta was created."},{"line_number":219,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5ff73747_4eb0cd43","line":216,"range":{"start_line":215,"start_character":3,"end_line":216,"end_character":44},"updated":"2017-04-28 07:50:57.000000000","message":"I don\u0027t think the current check_against_existing works as described here. Because CompositeRingBuilder.save/load is now for composite ring metadata (i.e a JSON file)\n\nAnd then, old_composite_meta is from the JSON file and nwe_composite_meta is from loaded builders.\n\nI think the original intention of this function is asserting the component metadata sameness with composite ring (a tar.gz-ed ring file), when overwriting the path.","commit_id":"e856edc4a47b1d06ac60096ccee6a07f801c58c6"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"169b7b08997997b06ccad8a4d2891c9499e54677","unresolved":false,"context_lines":[{"line_number":311,"context_line":"    def load(cls, path_to_file):"},{"line_number":312,"context_line":"        \"\"\""},{"line_number":313,"context_line":"        Load composite ring metadata."},{"line_number":314,"context_line":"        :param path_to_file: Absolute path to a file."},{"line_number":315,"context_line":"        :return: an instance of"},{"line_number":316,"context_line":"                 `swift.common.ring.composite_builder.CompositeRingBuilder`"},{"line_number":317,"context_line":"        :raises IOError: if there is a problem opening the file"}],"source_content_type":"text/x-python","patch_set":4,"id":"5ff73747_85591836","line":314,"range":{"start_line":314,"start_character":28,"end_line":314,"end_character":53},"updated":"2017-04-28 07:50:57.000000000","message":"nits) Absolute path to a composite ring metadata JSON file","commit_id":"e856edc4a47b1d06ac60096ccee6a07f801c58c6"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"169b7b08997997b06ccad8a4d2891c9499e54677","unresolved":false,"context_lines":[{"line_number":322,"context_line":"            with open(path_to_file, \u0027rb\u0027) as fp:"},{"line_number":323,"context_line":"                metadata \u003d json.load(fp)"},{"line_number":324,"context_line":"                # rudimentary check that this is composite metadata ..."},{"line_number":325,"context_line":"                metadata[\u0027components\u0027]"},{"line_number":326,"context_line":"        except (ValueError, TypeError, KeyError):"},{"line_number":327,"context_line":"            raise ValueError(\"File does not contain valid composite ring data\")"},{"line_number":328,"context_line":"        builder \u003d CompositeRingBuilder()"}],"source_content_type":"text/x-python","patch_set":4,"id":"5ff73747_256124d4","line":325,"updated":"2017-04-28 07:50:57.000000000","message":"it seems like we need 3 keys in the dict, \u0027components\u0027, \u0027version\u0027, and \u0027builder_files\u0027.","commit_id":"e856edc4a47b1d06ac60096ccee6a07f801c58c6"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"c248a360e3076b73cf4820115dd82d277760060f","unresolved":false,"context_lines":[{"line_number":330,"context_line":""},{"line_number":331,"context_line":"    `serialization_version` is an integer constant."},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"    `saved_path` is the path to which the metadata was written."},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"    :params builder_files: a list of absolute paths to builder files"},{"line_number":336,"context_line":"        that will be used as components of the composite ring."}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_4cdd4bde","line":333,"updated":"2017-05-01 09:03:23.000000000","message":"Some docs for usage could be nice to have, like...\n\n To compose the component rings, CompositeRingBuilder supports a couple of ways.\n\n Example-1:\n     # create a component ring list and an output file name\n     component_rings \u003d [\"region1.builder\", \"region2.builder\"]\n     output_file \u003d \"composite_ring.gz\"\n\n     # create a CompositeRingBuilder instance\n     crb \u003d CompositeRingBuilder(component_rings)\n     # call compose which will make a new RingData instance and save as output_file\n     crb.compose().save(output_file)\n\n Example-2:\n     # create an empty CompositeRingBuilder instance\n     crb \u003d CompositeRingBuilder()\n     # create a component ring list and an output file name\n     component_rings \u003d [\"region1.builder\", \"region2.builder\"]\n     output_file \u003d \"composite_ring.gz\"\n\n     # give the component_rings list to compose method\n     crb.compose(component_rings).save(output_file)","commit_id":"d079c3d5b3ff3b097fcb1e12cd5e0defa7d69305"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"c248a360e3076b73cf4820115dd82d277760060f","unresolved":false,"context_lines":[{"line_number":332,"context_line":""},{"line_number":333,"context_line":"    `saved_path` is the path to which the metadata was written."},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"    :params builder_files: a list of absolute paths to builder files"},{"line_number":336,"context_line":"        that will be used as components of the composite ring."},{"line_number":337,"context_line":"    \"\"\""},{"line_number":338,"context_line":"    def __init__(self, builder_files\u003dNone):"},{"line_number":339,"context_line":"        self.version \u003d 0"}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_cc4f1b69","line":336,"range":{"start_line":335,"start_character":0,"end_line":336,"end_character":62},"updated":"2017-05-01 09:03:23.000000000","message":"Hmmm.... I concern a little about the mismatch of \"builder_files\" contents with above.\n\nLine 328 describes builder_files as a dict, but here it\u0027s a list.\n\nI found both are correct. In the composite ring metadata dict contains a \"builder_files\" dict but the CompositeRingBuilder class  keeps it as a list. And then, to_dict/load translates them each other, it looks to work well though.\n\n\nSomething like... component_builder_files? Not sure for the expression.","commit_id":"d079c3d5b3ff3b097fcb1e12cd5e0defa7d69305"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"c248a360e3076b73cf4820115dd82d277760060f","unresolved":false,"context_lines":[{"line_number":411,"context_line":"    def compose(self, builder_files\u003dNone, force\u003dFalse):"},{"line_number":412,"context_line":"        \"\"\""},{"line_number":413,"context_line":"        Build a composite ring. If a list of component ring builder files is"},{"line_number":414,"context_line":"        given then that will override any list of builder files that may have"},{"line_number":415,"context_line":"        been set when the instance was constructed."},{"line_number":416,"context_line":""},{"line_number":417,"context_line":"        If metadata for an existing composite ring has been loaded then"}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_2fc3118b","line":414,"updated":"2017-05-01 09:03:23.000000000","message":"Sorry, I don\u0027t have clear word to describe my thought but I\u0027m feeling this would look a little odd to me.\n\nI think builder_files could override all components of the existing attributes in the CompositRingBuilder and the new builder_files seems different from the existing components completely, right?\n\nHowever, this method will compare the composite metadata with the old existing components so it means the new builder_files can be different for the point of the path but the builder (i.e. id, repolica) should be same?","commit_id":"d079c3d5b3ff3b097fcb1e12cd5e0defa7d69305"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"1217912a3cc3cedcdb498943e981dc514273e6ec","unresolved":false,"context_lines":[{"line_number":308,"context_line":"         # save the composite metadata file"},{"line_number":309,"context_line":"         crb.save(\"composite_builder.composite\")"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"        # load the persisted composite metadata file"},{"line_number":312,"context_line":"        crb \u003d CompositeRingBuilder.load(\"composite_builder.composite\")"},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"        # compose (optionally update the paths to the component builder files)"},{"line_number":315,"context_line":"        crb.compose([\"/path/to/region1.builder\", \"/path/to/region2.builder\"])"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"    Composite ring metadata is persisted to file in JSON format. The metadata"},{"line_number":318,"context_line":"    has the structure shown below (using example values)::"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_2ce8a9b0","line":315,"range":{"start_line":311,"start_character":0,"end_line":315,"end_character":77},"updated":"2017-05-02 07:33:35.000000000","message":"indent misaligned.","commit_id":"60be5aac8f6c7abfc25c2a8653aa6c2e8c613ff2"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"1217912a3cc3cedcdb498943e981dc514273e6ec","unresolved":false,"context_lines":[{"line_number":339,"context_line":"        \"saved_path\": \"/etc/swift/multi-ring-1.composite\","},{"line_number":340,"context_line":"      }"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    `version` is a integer representing the current version of the composite"},{"line_number":343,"context_line":"    ring, which increments each time the ring is successfully (re)composed."},{"line_number":344,"context_line":""},{"line_number":345,"context_line":"    `components` is a list of dicts, each of which describes relevant"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_8c645d4b","line":342,"range":{"start_line":342,"start_character":17,"end_line":342,"end_character":18},"updated":"2017-05-02 07:33:35.000000000","message":"an","commit_id":"60be5aac8f6c7abfc25c2a8653aa6c2e8c613ff2"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"1217912a3cc3cedcdb498943e981dc514273e6ec","unresolved":false,"context_lines":[{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    `saved_path` is the path to which the metadata was written."},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"    :params builder_files: a list of absolute paths to builder files"},{"line_number":356,"context_line":"        that will be used as components of the composite ring."},{"line_number":357,"context_line":"    \"\"\""},{"line_number":358,"context_line":"    def __init__(self, builder_files\u003dNone):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_ec008136","line":355,"range":{"start_line":355,"start_character":37,"end_line":355,"end_character":51},"updated":"2017-05-02 07:33:35.000000000","message":"nits) not absolute path. relative path can be ok. test_abs_paths_persisted calls the init method with relative paths.","commit_id":"60be5aac8f6c7abfc25c2a8653aa6c2e8c613ff2"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"023f912b94fbff10bab9a1e4e490e81ec0e75ad0","unresolved":false,"context_lines":[{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    `saved_path` is the path to which the metadata was written."},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"    :params builder_files: a list of absolute paths to builder files"},{"line_number":356,"context_line":"        that will be used as components of the composite ring."},{"line_number":357,"context_line":"    \"\"\""},{"line_number":358,"context_line":"    def __init__(self, builder_files\u003dNone):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_74a317b3","line":355,"range":{"start_line":355,"start_character":37,"end_line":355,"end_character":51},"in_reply_to":"5ff73747_ec008136","updated":"2017-05-02 08:44:58.000000000","message":"agree. thanks","commit_id":"60be5aac8f6c7abfc25c2a8653aa6c2e8c613ff2"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"1217912a3cc3cedcdb498943e981dc514273e6ec","unresolved":false,"context_lines":[{"line_number":445,"context_line":"        ``force`` flag if set True."},{"line_number":446,"context_line":""},{"line_number":447,"context_line":""},{"line_number":448,"context_line":"        :param builder_files: Optional list of absolute paths to ring builder"},{"line_number":449,"context_line":"            files that will be used to load the component ring builders."},{"line_number":450,"context_line":"            Typically the list of component builder files will have been set"},{"line_number":451,"context_line":"            when the instance was constructed, for example when using the"},{"line_number":452,"context_line":"            load() class method. However, this parameter may be used if the"},{"line_number":453,"context_line":"            component builder file paths have moved, or, in conjunction with"},{"line_number":454,"context_line":"            the ``force`` parameter, if a new list of component builders is to"},{"line_number":455,"context_line":"            be used."},{"line_number":456,"context_line":"        :param force: if True then do not verify given builders are consistent"},{"line_number":457,"context_line":"                      with any existing composite ring."},{"line_number":458,"context_line":"        :return: An instance of :class:`swift.common.ring.ring.RingData`"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_ccf14597","line":455,"range":{"start_line":448,"start_character":0,"end_line":455,"end_character":20},"updated":"2017-05-02 07:33:35.000000000","message":"nice docs.","commit_id":"60be5aac8f6c7abfc25c2a8653aa6c2e8c613ff2"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"1217912a3cc3cedcdb498943e981dc514273e6ec","unresolved":false,"context_lines":[{"line_number":461,"context_line":"            composite ring, or if there has been no change with respect to the"},{"line_number":462,"context_line":"            existing ring."},{"line_number":463,"context_line":"        \"\"\""},{"line_number":464,"context_line":"        builder_files \u003d builder_files or self._builder_files"},{"line_number":465,"context_line":"        builders \u003d [RingBuilder.load(f) for f in builder_files]"},{"line_number":466,"context_line":"        check_builder_ids(builders)"},{"line_number":467,"context_line":"        new_metadata \u003d _make_composite_metadata(builders)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_600a35d2","line":464,"updated":"2017-05-02 07:33:35.000000000","message":"Er - self._builder_files should be absolute paths always but builder_files may not be.","commit_id":"60be5aac8f6c7abfc25c2a8653aa6c2e8c613ff2"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"1217912a3cc3cedcdb498943e981dc514273e6ec","unresolved":false,"context_lines":[{"line_number":475,"context_line":"        self.ring_data \u003d compose_rings(builders)"},{"line_number":476,"context_line":"        self.version +\u003d 1"},{"line_number":477,"context_line":"        self.components \u003d new_metadata[\u0027components\u0027]"},{"line_number":478,"context_line":"        self._set_builder_files(builder_files)"},{"line_number":479,"context_line":"        return self.ring_data"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_0024915c","line":478,"updated":"2017-05-02 07:33:35.000000000","message":"(from L464) but here, the new builder_files will be cast to abs path so it looks ok.","commit_id":"60be5aac8f6c7abfc25c2a8653aa6c2e8c613ff2"}],"test/unit/common/ring/test_composite_builder.py":[{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"c248a360e3076b73cf4820115dd82d277760060f","unresolved":false,"context_lines":[{"line_number":20,"context_line":"import shutil"},{"line_number":21,"context_line":"import copy"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from mock import mock"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from swift.common.ring import RingBuilder, Ring"},{"line_number":26,"context_line":"from swift.common.ring.composite_builder import ("}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_afbde1b7","line":23,"range":{"start_line":23,"start_character":0,"end_line":23,"end_character":21},"updated":"2017-05-01 09:03:23.000000000","message":"just `import mock`?","commit_id":"d079c3d5b3ff3b097fcb1e12cd5e0defa7d69305"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"1217912a3cc3cedcdb498943e981dc514273e6ec","unresolved":false,"context_lines":[{"line_number":419,"context_line":"            cb.compose()"},{"line_number":420,"context_line":"        self.assertIn(\u0027None of the component builders has been modified\u0027,"},{"line_number":421,"context_line":"                      cm.exception.message)"},{"line_number":422,"context_line":"        # ...unless we force it"},{"line_number":423,"context_line":"        cb.compose(force\u003dTrue).save(self.output_ring)"},{"line_number":424,"context_line":"        self.check_composite_ring(self.output_ring, builders)"},{"line_number":425,"context_line":"        # check composite builder persists ok again"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_430d03e6","line":422,"updated":"2017-05-02 07:33:35.000000000","message":"ok, this increments the version 2","commit_id":"60be5aac8f6c7abfc25c2a8653aa6c2e8c613ff2"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"1217912a3cc3cedcdb498943e981dc514273e6ec","unresolved":false,"context_lines":[{"line_number":542,"context_line":"        builder_files \u003d self.save_builders(builders)"},{"line_number":543,"context_line":"        cb \u003d CompositeRingBuilder(builder_files)"},{"line_number":544,"context_line":"        check_missing_id(cb, builders)"},{"line_number":545,"context_line":"        # with existing composite ring metadata"},{"line_number":546,"context_line":"        builder_files \u003d self.save_builders(builders)"},{"line_number":547,"context_line":"        cb \u003d CompositeRingBuilder(builder_files)"},{"line_number":548,"context_line":"        cb.compose()"},{"line_number":549,"context_line":"        check_missing_id(cb, builders)"},{"line_number":550,"context_line":""},{"line_number":551,"context_line":"    def test_compose_duplicate_builder_ids(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_038b7bc2","line":548,"range":{"start_line":545,"start_character":0,"end_line":548,"end_character":20},"updated":"2017-05-02 07:33:35.000000000","message":"I may be missing the meaning for *existing composite ring metadata*. Is it persisted one? if so, we need to add cb.save() somewhere and what is different with the no existing one above.\n\nit seems the builder files are always saved (overwritten) in check_missing_id so the condition here not affects to the result, am i missing something?","commit_id":"60be5aac8f6c7abfc25c2a8653aa6c2e8c613ff2"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"023f912b94fbff10bab9a1e4e490e81ec0e75ad0","unresolved":false,"context_lines":[{"line_number":542,"context_line":"        builder_files \u003d self.save_builders(builders)"},{"line_number":543,"context_line":"        cb \u003d CompositeRingBuilder(builder_files)"},{"line_number":544,"context_line":"        check_missing_id(cb, builders)"},{"line_number":545,"context_line":"        # with existing composite ring metadata"},{"line_number":546,"context_line":"        builder_files \u003d self.save_builders(builders)"},{"line_number":547,"context_line":"        cb \u003d CompositeRingBuilder(builder_files)"},{"line_number":548,"context_line":"        cb.compose()"},{"line_number":549,"context_line":"        check_missing_id(cb, builders)"},{"line_number":550,"context_line":""},{"line_number":551,"context_line":"    def test_compose_duplicate_builder_ids(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_d92104b6","line":548,"range":{"start_line":545,"start_character":0,"end_line":548,"end_character":20},"in_reply_to":"5ff73747_038b7bc2","updated":"2017-05-02 08:44:58.000000000","message":"I will add more comments\n\nthe difference between two cases is the call to compose() - in first case the cb has no self.components, in second case the cb has set self.components.\n\nThe builder files are saved again here so that they all have good ids for the compose() here, before check_missing_id writes builder files with a missing id.","commit_id":"60be5aac8f6c7abfc25c2a8653aa6c2e8c613ff2"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"1217912a3cc3cedcdb498943e981dc514273e6ec","unresolved":false,"context_lines":[{"line_number":577,"context_line":"        # even if we rewrite the files"},{"line_number":578,"context_line":"        builder_files \u003d self.save_builders(builders)"},{"line_number":579,"context_line":"        do_test(cb, builder_files)"},{"line_number":580,"context_line":"        # even if we rename the files"},{"line_number":581,"context_line":"        builder_files \u003d self.save_builders(builders, prefix\u003d\u0027other\u0027)"},{"line_number":582,"context_line":"        do_test(cb, builder_files)"},{"line_number":583,"context_line":""},{"line_number":584,"context_line":"    def test_compose_older_builder(self):"},{"line_number":585,"context_line":"        # make first version of composite ring"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_c3059315","line":582,"range":{"start_line":580,"start_character":8,"end_line":582,"end_character":34},"updated":"2017-05-02 07:33:35.000000000","message":"nice","commit_id":"60be5aac8f6c7abfc25c2a8653aa6c2e8c613ff2"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"1217912a3cc3cedcdb498943e981dc514273e6ec","unresolved":false,"context_lines":[{"line_number":692,"context_line":"            check_bad_content(content)"},{"line_number":693,"context_line":""},{"line_number":694,"context_line":"        good_content \u003d {"},{"line_number":695,"context_line":"            \u0027components\u0027: ["},{"line_number":696,"context_line":"                {\u0027version\u0027: 1, \u0027id\u0027: \u0027a_uuid\u0027, \u0027replicas\u0027: 12}"},{"line_number":697,"context_line":"            ],"},{"line_number":698,"context_line":"            \u0027builder_files\u0027: {\u0027a_uuid\u0027: \u0027/path/to/file\u0027},"},{"line_number":699,"context_line":"            \u0027version\u0027: 99}"},{"line_number":700,"context_line":"        for missing in good_content:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_56a023f4","line":697,"range":{"start_line":695,"start_character":9,"end_line":697,"end_character":14},"updated":"2017-05-02 07:33:35.000000000","message":"actually, this is not good content because the components should more than 1 item but it will be asserted when compose called so no failure will happen with just loading.","commit_id":"60be5aac8f6c7abfc25c2a8653aa6c2e8c613ff2"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"023f912b94fbff10bab9a1e4e490e81ec0e75ad0","unresolved":false,"context_lines":[{"line_number":692,"context_line":"            check_bad_content(content)"},{"line_number":693,"context_line":""},{"line_number":694,"context_line":"        good_content \u003d {"},{"line_number":695,"context_line":"            \u0027components\u0027: ["},{"line_number":696,"context_line":"                {\u0027version\u0027: 1, \u0027id\u0027: \u0027a_uuid\u0027, \u0027replicas\u0027: 12}"},{"line_number":697,"context_line":"            ],"},{"line_number":698,"context_line":"            \u0027builder_files\u0027: {\u0027a_uuid\u0027: \u0027/path/to/file\u0027},"},{"line_number":699,"context_line":"            \u0027version\u0027: 99}"},{"line_number":700,"context_line":"        for missing in good_content:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_34db4f4f","line":697,"range":{"start_line":695,"start_character":9,"end_line":697,"end_character":14},"in_reply_to":"5ff73747_56a023f4","updated":"2017-05-02 08:44:58.000000000","message":"I will add another builder - it will avoid any confusion","commit_id":"60be5aac8f6c7abfc25c2a8653aa6c2e8c613ff2"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"1217912a3cc3cedcdb498943e981dc514273e6ec","unresolved":false,"context_lines":[{"line_number":705,"context_line":"    def test_save_errors(self):"},{"line_number":706,"context_line":"        cb_file \u003d os.path.join(self.tmpdir, \u0027test-composite-ring.json\u0027)"},{"line_number":707,"context_line":""},{"line_number":708,"context_line":"        def do_test(cb):"},{"line_number":709,"context_line":"            with self.assertRaises(ValueError) as cm:"},{"line_number":710,"context_line":"                CompositeRingBuilder([]).save(cb_file)"},{"line_number":711,"context_line":"            self.assertIn(\"No composed ring to save\", cm.exception.message)"},{"line_number":712,"context_line":""},{"line_number":713,"context_line":"        do_test(CompositeRingBuilder())"},{"line_number":714,"context_line":"        do_test(CompositeRingBuilder([]))"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_3626b769","line":711,"range":{"start_line":708,"start_character":0,"end_line":711,"end_character":75},"updated":"2017-05-02 07:33:35.000000000","message":"cb is never used.","commit_id":"60be5aac8f6c7abfc25c2a8653aa6c2e8c613ff2"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"023f912b94fbff10bab9a1e4e490e81ec0e75ad0","unresolved":false,"context_lines":[{"line_number":705,"context_line":"    def test_save_errors(self):"},{"line_number":706,"context_line":"        cb_file \u003d os.path.join(self.tmpdir, \u0027test-composite-ring.json\u0027)"},{"line_number":707,"context_line":""},{"line_number":708,"context_line":"        def do_test(cb):"},{"line_number":709,"context_line":"            with self.assertRaises(ValueError) as cm:"},{"line_number":710,"context_line":"                CompositeRingBuilder([]).save(cb_file)"},{"line_number":711,"context_line":"            self.assertIn(\"No composed ring to save\", cm.exception.message)"},{"line_number":712,"context_line":""},{"line_number":713,"context_line":"        do_test(CompositeRingBuilder())"},{"line_number":714,"context_line":"        do_test(CompositeRingBuilder([]))"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_b4ee3fea","line":711,"range":{"start_line":708,"start_character":0,"end_line":711,"end_character":75},"in_reply_to":"5ff73747_3626b769","updated":"2017-05-02 08:44:58.000000000","message":"eek -thanks!","commit_id":"60be5aac8f6c7abfc25c2a8653aa6c2e8c613ff2"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"1217912a3cc3cedcdb498943e981dc514273e6ec","unresolved":false,"context_lines":[{"line_number":713,"context_line":"        do_test(CompositeRingBuilder())"},{"line_number":714,"context_line":"        do_test(CompositeRingBuilder([]))"},{"line_number":715,"context_line":"        do_test(CompositeRingBuilder([\u0027file1\u0027, \u0027file2\u0027]))"},{"line_number":716,"context_line":"        cb \u003d CompositeRingBuilder([])"},{"line_number":717,"context_line":"        with self.assertRaises(ValueError):"},{"line_number":718,"context_line":"            cb.compose()  # not enough components, compose should fail"},{"line_number":719,"context_line":"        do_test(cb)"},{"line_number":720,"context_line":""},{"line_number":721,"context_line":""},{"line_number":722,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_16de1b3d","line":719,"range":{"start_line":716,"start_character":0,"end_line":719,"end_character":19},"updated":"2017-05-02 07:33:35.000000000","message":"duplicate test with L713?","commit_id":"60be5aac8f6c7abfc25c2a8653aa6c2e8c613ff2"}]}
