Staging instance, all changes can be removed at any time

Skip to content

storage: check uniqueness based on all relevant columns, not just id and indexer_configuration_id.

ctags and fossology can legitimately add multiple objects with the same id and indexer_configuration_id at the same time, but different values for other columns.

Before this commit, it would immediately crash the 'check_id_duplicates' checks.

As a side-effect, this commit also remove the 'add_merge' logic in the in-memory storage, and stores it like proper rows like the pg does instead of working around this broken deduplication.

As an other side-effect, removing this broken logic removes an inconsistency between the in-mem and pg storage (see the added tests named test_add_empty for Ctags and Fossology), which Fossology indexer tests relied on, so this commit updates these tests as well.

Sorry, this is quite a large diff; I intended it as a small refactoring but it uncovered a bunch of bugs that I needed to fix too


Migrated from D4118 (view on Phabricator)

Merge request reports

Loading