)]}'
{"zuul/connection/__init__.py":[{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"d9a6411035671122f2eef6fb9278d26ae2f5df3c","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    def registerScheduler(self, sched):"},{"line_number":77,"context_line":"        self.sched \u003d sched"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def clearCache(self):"},{"line_number":80,"context_line":"        \"\"\"Clear the cache for this connection."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        This is called immediately prior to performing a full"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f6b1bfe_1f69b6bd","line":79,"range":{"start_line":79,"start_character":8,"end_line":79,"end_character":18},"updated":"2020-10-14 19:30:09.000000000","message":"What is the purpose to rename this method? It looks to me like it\u0027s still clearing the branch cache.","commit_id":"13f47dac263a2bf94e2938f3498a4d58381d8a2b"},{"author":{"_account_id":25403,"name":"Pierre-Louis Bonicoli","email":"pierre-louis.bonicoli@libregerbil.fr","username":"pilou"},"change_message_id":"335bc9b3301dd5cbb72ae9b860870b1fda42420f","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    def registerScheduler(self, sched):"},{"line_number":77,"context_line":"        self.sched \u003d sched"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def clearCache(self):"},{"line_number":80,"context_line":"        \"\"\"Clear the cache for this connection."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        This is called immediately prior to performing a full"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f6b1bfe_69d0edf8","line":79,"range":{"start_line":79,"start_character":8,"end_line":79,"end_character":18},"in_reply_to":"7f6b1bfe_1f69b6bd","updated":"2020-10-15 10:37:06.000000000","message":"This method is called for any connection (for example: SMTP, SQL). Even if Git based drivers implement it, a more generic name seems more adequate.","commit_id":"13f47dac263a2bf94e2938f3498a4d58381d8a2b"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"d9a6411035671122f2eef6fb9278d26ae2f5df3c","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        }"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"class CachedBranchConnection(BaseConnection):"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":132,"context_line":"        super(CachedBranchConnection, self).__init__(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f6b1bfe_dfaa9e83","line":129,"range":{"start_line":129,"start_character":6,"end_line":129,"end_character":28},"updated":"2020-10-14 19:30:09.000000000","message":"The name of this class is a bit misleading since the GerritConnection caches branches as well but doesn\u0027t use this class. In fact this class handles the concept of protected branches so it should be named accordingly. I\u0027m just not sure about a good name. Maybe something like BaseConnectionBranchProtection or something shorter/better that is similar.\n\nNot sure, but it might also be worth exploring the idea if it makes sense to make this class a mix in instead of a base class of those connections.","commit_id":"13f47dac263a2bf94e2938f3498a4d58381d8a2b"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"01b2343cffdf0e2a56502ead6ed03d6eb3b1f5b5","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        }"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"class CachedBranchConnection(BaseConnection):"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":132,"context_line":"        super(CachedBranchConnection, self).__init__(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f65232a_8ae3b105","line":129,"range":{"start_line":129,"start_character":6,"end_line":129,"end_character":28},"in_reply_to":"7f6b1bfe_29355547","updated":"2020-10-23 17:27:43.000000000","message":"Thanks, then this makes sense.","commit_id":"13f47dac263a2bf94e2938f3498a4d58381d8a2b"},{"author":{"_account_id":25403,"name":"Pierre-Louis Bonicoli","email":"pierre-louis.bonicoli@libregerbil.fr","username":"pilou"},"change_message_id":"335bc9b3301dd5cbb72ae9b860870b1fda42420f","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        }"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"class CachedBranchConnection(BaseConnection):"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":132,"context_line":"        super(CachedBranchConnection, self).__init__(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f6b1bfe_29355547","line":129,"range":{"start_line":129,"start_character":6,"end_line":129,"end_character":28},"in_reply_to":"7f6b1bfe_dfaa9e83","updated":"2020-10-15 10:37:06.000000000","message":"I plan to reuse this class with Gerrit and Pagure too (they don\u0027t support protected branches).\n\nI used a mixin first, in the end I prefer to use a base class.","commit_id":"13f47dac263a2bf94e2938f3498a4d58381d8a2b"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"d9a6411035671122f2eef6fb9278d26ae2f5df3c","unresolved":false,"context_lines":[{"line_number":129,"context_line":"class CachedBranchConnection(BaseConnection):"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":132,"context_line":"        super(CachedBranchConnection, self).__init__(*args, **kwargs)"},{"line_number":133,"context_line":"        self._project_branch_cache_exclude_unprotected \u003d {}"},{"line_number":134,"context_line":"        self._project_branch_cache_include_unprotected \u003d {}"},{"line_number":135,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f6b1bfe_ff903a51","line":132,"updated":"2020-10-14 19:30:09.000000000","message":"We\u0027re python3 only so this can be simpler:\n\n  super().__init__(*args, **kwargs)","commit_id":"13f47dac263a2bf94e2938f3498a4d58381d8a2b"},{"author":{"_account_id":25403,"name":"Pierre-Louis Bonicoli","email":"pierre-louis.bonicoli@libregerbil.fr","username":"pilou"},"change_message_id":"335bc9b3301dd5cbb72ae9b860870b1fda42420f","unresolved":false,"context_lines":[{"line_number":129,"context_line":"class CachedBranchConnection(BaseConnection):"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":132,"context_line":"        super(CachedBranchConnection, self).__init__(*args, **kwargs)"},{"line_number":133,"context_line":"        self._project_branch_cache_exclude_unprotected \u003d {}"},{"line_number":134,"context_line":"        self._project_branch_cache_include_unprotected \u003d {}"},{"line_number":135,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f6b1bfe_093a1935","line":132,"in_reply_to":"7f6b1bfe_ff903a51","updated":"2020-10-15 10:37:06.000000000","message":"Done","commit_id":"13f47dac263a2bf94e2938f3498a4d58381d8a2b"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"d9a6411035671122f2eef6fb9278d26ae2f5df3c","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        self._project_branch_cache_include_unprotected \u003d {}"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    @abc.abstractmethod"},{"line_number":137,"context_line":"    def is_branch_protected(self, project_name: str, branch_name: str,"},{"line_number":138,"context_line":"                            zuul_event_id) -\u003e Optional[bool]:"},{"line_number":139,"context_line":"        \"\"\"Return if the branch is protected or None if the branch is unknown."},{"line_number":140,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f6b1bfe_ff6f9a8f","line":137,"range":{"start_line":137,"start_character":8,"end_line":137,"end_character":27},"updated":"2020-10-14 19:30:09.000000000","message":"This should be camel case to be consistent with the context.","commit_id":"13f47dac263a2bf94e2938f3498a4d58381d8a2b"},{"author":{"_account_id":25403,"name":"Pierre-Louis Bonicoli","email":"pierre-louis.bonicoli@libregerbil.fr","username":"pilou"},"change_message_id":"335bc9b3301dd5cbb72ae9b860870b1fda42420f","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        self._project_branch_cache_include_unprotected \u003d {}"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    @abc.abstractmethod"},{"line_number":137,"context_line":"    def is_branch_protected(self, project_name: str, branch_name: str,"},{"line_number":138,"context_line":"                            zuul_event_id) -\u003e Optional[bool]:"},{"line_number":139,"context_line":"        \"\"\"Return if the branch is protected or None if the branch is unknown."},{"line_number":140,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f6b1bfe_693e2d2a","line":137,"range":{"start_line":137,"start_character":8,"end_line":137,"end_character":27},"in_reply_to":"7f6b1bfe_ff6f9a8f","updated":"2020-10-15 10:37:06.000000000","message":"Done","commit_id":"13f47dac263a2bf94e2938f3498a4d58381d8a2b"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"d9a6411035671122f2eef6fb9278d26ae2f5df3c","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        pass"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    @abc.abstractmethod"},{"line_number":151,"context_line":"    def projectBranches(self, project: Project,"},{"line_number":152,"context_line":"                        exclude_unprotected: bool) -\u003e List[str]:"},{"line_number":153,"context_line":"        pass"},{"line_number":154,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f6b1bfe_9f04a6c8","line":151,"range":{"start_line":151,"start_character":8,"end_line":151,"end_character":23},"updated":"2020-10-14 19:30:09.000000000","message":"I find it confusing having a getProjectBranches and a projectBranches method within the same class. It looks like getProjectBranches is meant as an external interface that leverages caching and projectBranches is used internally for fetching them.\n\nWhat do you think about renaming this method to _fetchProjectBranches then? This makes the purpose and also the scope clear.","commit_id":"13f47dac263a2bf94e2938f3498a4d58381d8a2b"},{"author":{"_account_id":25403,"name":"Pierre-Louis Bonicoli","email":"pierre-louis.bonicoli@libregerbil.fr","username":"pilou"},"change_message_id":"335bc9b3301dd5cbb72ae9b860870b1fda42420f","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        pass"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    @abc.abstractmethod"},{"line_number":151,"context_line":"    def projectBranches(self, project: Project,"},{"line_number":152,"context_line":"                        exclude_unprotected: bool) -\u003e List[str]:"},{"line_number":153,"context_line":"        pass"},{"line_number":154,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f6b1bfe_894589b6","line":151,"range":{"start_line":151,"start_character":8,"end_line":151,"end_character":23},"in_reply_to":"7f6b1bfe_9f04a6c8","updated":"2020-10-15 10:37:06.000000000","message":"_fetchProjectBranches is much better.","commit_id":"13f47dac263a2bf94e2938f3498a4d58381d8a2b"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"1487c252c3c07f981cc0b76bdd15996227e2a4a7","unresolved":false,"context_lines":[{"line_number":152,"context_line":"                              exclude_unprotected: bool) -\u003e List[str]:"},{"line_number":153,"context_line":"        pass"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def handle_branch_event(self, event):"},{"line_number":156,"context_line":"        # This checks whether the event created or deleted a branch so"},{"line_number":157,"context_line":"        # that Zuul may know to perform a reconfiguration on the"},{"line_number":158,"context_line":"        # project."}],"source_content_type":"text/x-python","patch_set":5,"id":"1f621f24_570c3593","line":155,"updated":"2020-11-09 22:45:17.000000000","message":"Should be camel case to match.","commit_id":"b02bb5f9f46162def96c76ba010d2feb7662a401"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"1487c252c3c07f981cc0b76bdd15996227e2a4a7","unresolved":false,"context_lines":[{"line_number":155,"context_line":"    def handle_branch_event(self, event):"},{"line_number":156,"context_line":"        # This checks whether the event created or deleted a branch so"},{"line_number":157,"context_line":"        # that Zuul may know to perform a reconfiguration on the"},{"line_number":158,"context_line":"        # project."},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        if event.oldrev \u003d\u003d \u00270\u0027 * 40:"},{"line_number":161,"context_line":"            event.branch_created \u003d True"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f621f24_3711b9ad","line":158,"updated":"2020-11-09 22:45:17.000000000","message":"This comment should be in the docstring for this method, with a note indicating when implementing drivers should call it.  The base driver classes are the one place in Zuul where we try to keep a pretty high standard for docstrings for the benefit of driver authors.\n\nI\u0027d also prefer a more descriptive name for this method, perhaps \"clearConnectionCacheOnBranchEvent\" or something like that at least something to connect this to the connection cache so it\u0027s clear this isn\u0027t doing something like forwarding an event to the scheduler.","commit_id":"b02bb5f9f46162def96c76ba010d2feb7662a401"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"1487c252c3c07f981cc0b76bdd15996227e2a4a7","unresolved":false,"context_lines":[{"line_number":208,"context_line":"        self.log.debug(\"Clearing branch cache for all branches: %s\","},{"line_number":209,"context_line":"                       self.connection_name)"},{"line_number":210,"context_line":"        self._project_branch_cache_exclude_unprotected \u003d {}"},{"line_number":211,"context_line":"        self._project_branch_cache_include_unprotected \u003d {}"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def clearProjectCache(self, project: Project) -\u003e None:"},{"line_number":214,"context_line":"        \"\"\"Clear the connection cache for this project."}],"source_content_type":"text/x-python","patch_set":5,"id":"1f621f24_9729ade7","line":211,"updated":"2020-11-09 22:45:17.000000000","message":"Each of the 3 previous methods should have docstrings.","commit_id":"b02bb5f9f46162def96c76ba010d2feb7662a401"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"1487c252c3c07f981cc0b76bdd15996227e2a4a7","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        self._project_branch_cache_exclude_unprotected.pop(project.name, None)"},{"line_number":220,"context_line":"        self._project_branch_cache_include_unprotected.pop(project.name, None)"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"    def checkBranchCache(self, project_name: str, event) -\u003e None:"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"        protected \u003d self.isBranchProtected(project_name, event.branch,"},{"line_number":225,"context_line":"                                           zuul_event_id\u003devent)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f621f24_77269117","line":222,"updated":"2020-11-09 22:45:17.000000000","message":"Docstring.","commit_id":"b02bb5f9f46162def96c76ba010d2feb7662a401"},{"author":{"_account_id":6889,"name":"Fabien Boucher","email":"fboucher@redhat.com","username":"fabien-boucher"},"change_message_id":"612b8b5eadbd7805e7587af2bab97670665ed548","unresolved":false,"context_lines":[{"line_number":152,"context_line":"                              exclude_unprotected: bool) -\u003e List[str]:"},{"line_number":153,"context_line":"        pass"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def clearConnectionCacheOnBranchEvent(self, event):"},{"line_number":156,"context_line":"        \"\"\"Update event and clear connection cache if needed."},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        This checks whether the event created or deleted a branch so"}],"source_content_type":"text/x-python","patch_set":6,"id":"1f621f24_20ce5e59","line":155,"updated":"2020-11-13 09:03:37.000000000","message":"To be consistent this method should have the type annotation too.","commit_id":"e6f13561475095715c02e412b8122fa0595036ca"}]}
