Don't create repairs asking user to remove duplicate ignored config entries (#130056)

This commit is contained in:
Erik Montnemery
2024-11-07 17:07:23 +01:00
committed by GitHub
parent 0e324c074a
commit c5e3ba536c
2 changed files with 18 additions and 1 deletions

View File

@@ -2437,6 +2437,17 @@ class ConfigEntries:
for domain, unique_ids in self._entries._domain_unique_id_index.items(): # noqa: SLF001
for unique_id, entries in unique_ids.items():
# We might mutate the list of entries, so we need a copy to not mess up
# the index
entries = list(entries)
# There's no need to raise an issue for ignored entries, we can
# safely remove them once we no longer allow unique id collisions.
# Iterate over a copy of the copy to allow mutating while iterating
for entry in list(entries):
if entry.source == SOURCE_IGNORE:
entries.remove(entry)
if len(entries) < 2:
continue
issue_id = f"{ISSUE_UNIQUE_ID_COLLISION}_{domain}_{unique_id}"