Page MenuHomeSoftware Heritage

BaseRow.unique_key: Don't crash when indexer_configuration_id is None.
ClosedPublic

Authored by vlorentz on Nov 27 2020, 1:35 PM.

Details

Summary

This always happens when writing to Kafka, as the Kafka writer sets it
to None at the same it it injects the 'tool' data.

This was not caught by tests because they use the in-mem writer;
which did not call unique_key() at all in swh-journal<=v0.5.1
(but future versions will).

Resolves P884.

Diff Detail

Repository
rDCIDX Metadata indexer
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D4622 (id=16386)

Rebasing onto d87fd53114...

Current branch diff-target is up to date.
Changes applied before test
commit 2cca6cbcf0b4fafaefbb2aa1d90b662a3a8a997d
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Nov 27 13:34:05 2020 +0100

    BaseRow.unique_key: Don't crash when indexer_configuration_id is None.
    
    This always happens when writing to Kafka, as the Kafka writer sets it
    to None at the same it it injects the 'tool' data.
    
    This was not caught by tests because they use the in-mem writer;
    which did not call unique_key() at all in swh-journal<=v0.5.1
    (but future versions will).

See https://jenkins.softwareheritage.org/job/DCIDX/job/tests-on-diff/128/ for more details.

This revision is now accepted and ready to land.Nov 27 2020, 1:41 PM