)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"46ba0c73d16099bf0e8237cce426478808bc9e0d","unresolved":false,"context_lines":[{"line_number":13,"context_line":"definitions.  It appears that the tpc.parsed_branch_config caches"},{"line_number":14,"context_line":"had duplicate data.  This is likely because the cacheConfig call"},{"line_number":15,"context_line":"operates on the TPCs and the TenantParser expects them to be"},{"line_number":16,"context_line":"empty at the start of processing."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"To correct this, add a loadTPCs call in updateTenantLayout so it"},{"line_number":19,"context_line":"more closely matches the existing tenant reconfiguration process."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"d2fbbb72_cc993ffb","line":16,"updated":"2021-11-10 16:10:46.000000000","message":"Maybe, or it may be easier to do something like Clark suggested and incorporate the clearing into the loading.","commit_id":"69c2a652b4df3c8f82b2936450baebdb33e81ba8"},{"author":{"_account_id":9311,"name":"Tristan Cacqueray","email":"tdecacqu@redhat.com","username":"tristanC"},"change_message_id":"b4e1944ca47ee4eb820a372f0f758f8da55c1cd1","unresolved":true,"context_lines":[{"line_number":13,"context_line":"definitions.  It appears that the tpc.parsed_branch_config caches"},{"line_number":14,"context_line":"had duplicate data.  This is likely because the cacheConfig call"},{"line_number":15,"context_line":"operates on the TPCs and the TenantParser expects them to be"},{"line_number":16,"context_line":"empty at the start of processing."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"To correct this, add a loadTPCs call in updateTenantLayout so it"},{"line_number":19,"context_line":"more closely matches the existing tenant reconfiguration process."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"36e7faa2_107879bb","line":16,"updated":"2021-11-10 14:47:39.000000000","message":"Would it makes more sense to make the tenant parser works with a non empty TPCs in that situation?","commit_id":"69c2a652b4df3c8f82b2936450baebdb33e81ba8"}],"zuul/scheduler.py":[{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"d0555f37e4ab2aaa5f9e0232f492cd5b48201494","unresolved":true,"context_lines":[{"line_number":1003,"context_line":"            else:"},{"line_number":1004,"context_line":"                # We don\u0027t need the cache ltimes as the tenant was deleted"},{"line_number":1005,"context_line":"                branch_cache_min_ltimes \u003d None"},{"line_number":1006,"context_line":"            loader.loadTPCs(self.abide, self.unparsed_abide)"},{"line_number":1007,"context_line":"            tenant \u003d loader.loadTenant("},{"line_number":1008,"context_line":"                self.abide, tenant_name, self.ansible_manager,"},{"line_number":1009,"context_line":"                self.unparsed_abide, min_ltimes\u003dmin_ltimes,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3711ebbd_333ad26a","line":1006,"updated":"2021-11-10 03:17:49.000000000","message":"Callpath seems to be: \n\n scheduler.run()\n   scheduler.updateTenantLayout()\n     loader.loadTPCs()\n       tenant_parser.loadTenantProjects()\n         creates new TPC objects on the abide with empty\n         parsed_branch_config dicts.\n     loader.loadTenant()\n       TenantParser.fromYaml()\n         tenant.addConfigProject()/tenant.addUntrustedProject()\n           tenant._addProject()\n             populates tenant.project_configs dict with TPC objects created\n             by loader.loadTPCs()\n         TenantParser.cacheConfig()\n           ParsedConfig from above parsed_branch_config is appended to. \n           Without the loadTPCs the append creates duplicate entries\n           on the existing parsed_branch_config entries as they were not\n           reset.\n\nThen sometime later we call loader._loadDynamicProjectData() which relies\non the cacheConfig() not containing duplicates.\n\nhttps://opendev.org/zuul/zuul/src/branch/master/zuul/configloader.py#L2058 is where we append. For belts and suspenders or an alternate fix should we consider having cacheConfig() clear out the parsed_branch_config dicts on the TPC objects before updating them with appends?","commit_id":"7477297f5f55b083a7f950887098c3b65ad46bf4"},{"author":{"_account_id":27582,"name":"Simon Westphahl","email":"simon.westphahl@bmw.de","username":"simon.westphahl"},"change_message_id":"778b6b422e80a2ea4f765a08965068f8b458e2e4","unresolved":true,"context_lines":[{"line_number":1003,"context_line":"            else:"},{"line_number":1004,"context_line":"                # We don\u0027t need the cache ltimes as the tenant was deleted"},{"line_number":1005,"context_line":"                branch_cache_min_ltimes \u003d None"},{"line_number":1006,"context_line":"            loader.loadTPCs(self.abide, self.unparsed_abide)"},{"line_number":1007,"context_line":"            tenant \u003d loader.loadTenant("},{"line_number":1008,"context_line":"                self.abide, tenant_name, self.ansible_manager,"},{"line_number":1009,"context_line":"                self.unparsed_abide, min_ltimes\u003dmin_ltimes,"}],"source_content_type":"text/x-python","patch_set":1,"id":"05e8d866_37cc600f","line":1006,"range":{"start_line":1006,"start_character":12,"end_line":1006,"end_character":60},"updated":"2021-11-10 06:09:46.000000000","message":"I think this should be\n\n    loader.loadTPCs(self.abide, self.unparsed_abide, [tenant_name])","commit_id":"7477297f5f55b083a7f950887098c3b65ad46bf4"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"1e635b2dbfd8fecb9a68f14ddebbeaff2bcdac09","unresolved":false,"context_lines":[{"line_number":1003,"context_line":"            else:"},{"line_number":1004,"context_line":"                # We don\u0027t need the cache ltimes as the tenant was deleted"},{"line_number":1005,"context_line":"                branch_cache_min_ltimes \u003d None"},{"line_number":1006,"context_line":"            loader.loadTPCs(self.abide, self.unparsed_abide)"},{"line_number":1007,"context_line":"            tenant \u003d loader.loadTenant("},{"line_number":1008,"context_line":"                self.abide, tenant_name, self.ansible_manager,"},{"line_number":1009,"context_line":"                self.unparsed_abide, min_ltimes\u003dmin_ltimes,"}],"source_content_type":"text/x-python","patch_set":1,"id":"67cdc6d4_a4ab2624","line":1006,"updated":"2021-11-10 14:06:19.000000000","message":"Yep, that matches the tenant reconfig and works.","commit_id":"7477297f5f55b083a7f950887098c3b65ad46bf4"}]}
