Page MenuHomeSoftware Heritage

journal client: Filter out status messages without type
ClosedPublic

Authored by olasd on Feb 11 2021, 7:39 PM.

Details

Summary

This allows us to support reading the journal from the beginning,
ignoring messages with the old schema.

Test Plan

added a unit test for the new behavior, and refactored a previous one.

Diff Detail

Repository
rDSCH Scheduling utilities
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 D5067 (id=18080)

Could not rebase; Attempt merge onto cf32e37649...

Updating cf32e37..86ada44
Fast-forward
 swh/scheduler/journal_client.py            | 20 ++++++++----------
 swh/scheduler/tests/test_journal_client.py | 34 ++++++++++++++++++++++++++----
 2 files changed, 39 insertions(+), 15 deletions(-)
Changes applied before test
commit 86ada443d2900e820356727149a1f7b0fa6e6bff
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Tue Feb 9 10:36:23 2021 +0100

    journal client: Filter out status messages without type
    
    This allows us to support reading the journal from the beginning,
    ignoring messages with the old schema.

commit cdb1775f247401ec24f8bb5dac7f9f2b40005bca
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Tue Feb 9 10:33:19 2021 +0100

    Simplify max_date()
    
    The built-in `max` function can take an iterable directly, no need to
    reimplement it.

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

olasd requested review of this revision.Feb 11 2021, 7:41 PM
This revision is now accepted and ready to land.Feb 12 2021, 11:22 AM