Page MenuHomeSoftware Heritage

common/origin_save: Improve test for finding a visit date
ClosedPublic

Authored by anlambert on Tue, Sep 15, 1:16 PM.

Details

Summary

When trying to associate a visit date to an origin save request, only consider
visits with partial or full statuses as no snapshots will be present for other
ones (e.g. created, ongoing).

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

anlambert created this revision.Tue, Sep 15, 1:16 PM

Build is green

Patch application report for D3952 (id=13903)

Rebasing onto 16ab03ab45...

Current branch diff-target is up to date.
Changes applied before test
commit 8660390ac95daf876594bd8bacf1d4abcb167391
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Tue Sep 15 11:44:07 2020 +0200

    common/origin_save: Improve test for finding a visit date
    
    When trying to associate a visit date to an origin save request, only consider
    visits with partial or full statuses as no snapshots will be present for other
    ones (e.g. created, ongoing).

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

Build is green

Patch application report for D3952 (id=13905)

Rebasing onto 37cd0a8bce...

Current branch diff-target is up to date.
Changes applied before test
commit 24950a876c4482da59b9477317341f41a4a49dfc
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Tue Sep 15 11:44:07 2020 +0200

    common/origin_save: Improve test for finding a visit date
    
    When trying to associate a visit date to an origin save request, only consider
    visits with partial or full statuses as no snapshots will be present for other
    ones (e.g. created, ongoing).

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

ardumont accepted this revision.Tue, Sep 15, 5:43 PM
ardumont added a subscriber: ardumont.
ardumont added inline comments.
swh/web/common/origin_save.py
167

Can't you do this directly when calling the storage?

This revision is now accepted and ready to land.Tue, Sep 15, 5:43 PM
anlambert added inline comments.Tue, Sep 15, 6:03 PM
swh/web/common/origin_save.py
167

Right it should be possible to filter visit statuses through the storage API. I will see what I can do before landing this.

anlambert added inline comments.Wed, Sep 16, 11:24 AM
swh/web/common/origin_save.py
167

I am landing this in order to fix the bad reported save status in production and I will try to improve the code using storage API later.

ardumont added inline comments.Wed, Sep 16, 12:31 PM
swh/web/common/origin_save.py
167

sure ;)