Page MenuHomeSoftware Heritage

Allow journal to deal with origin_visit_status
ClosedPublic

Authored by ardumont on Jun 8 2020, 2:28 PM.

Details

Summary

Is this enough?

Once landed and tagged, this will allow D3238 tests to pass.

Related to T2310

Test Plan

tox

Diff Detail

Repository
rDJNL Journal infrastructure
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 D3241 (id=11488)

Rebasing onto 64cd01fc7c...

Current branch diff-target is up to date.
Changes applied before test
commit 81c4071ed628746f73620462471154709b7d3ef6
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jun 8 14:28:04 2020 +0200

    Allow journal to deal with origin_visit_status
    
    Related to T2310

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

lgtm, but could you use datetime directly instead of adding a dependency on iso8601?

lgtm, but could you use datetime directly instead of adding a dependency on iso8601?

sure, i'll check to simplify this, thanks.

Use datetime.datetime.strptime (this avoids iso8601 dependency ;)

Remove iso8601 mypy.ini related configuration

Build is green

Patch application report for D3241 (id=11491)

Rebasing onto 64cd01fc7c...

Current branch diff-target is up to date.
Changes applied before test
commit 16f2ebdd6f3afbffafe49d496315c91d01488343
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jun 8 14:28:04 2020 +0200

    Allow journal to deal with origin_visit_status
    
    Related to T2310

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

Build is green

Patch application report for D3241 (id=11492)

Rebasing onto 64cd01fc7c...

Current branch diff-target is up to date.
Changes applied before test
commit 3cbdf8c8aa2fc105dfeadc28438c607874ec441d
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jun 8 14:28:04 2020 +0200

    Allow journal to deal with origin_visit_status
    
    Related to T2310

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

swh/journal/tests/journal_data.py
207

well, trying to change directly the origin visit date as datetime directly [1]
I have error in tests regarding origin-visit.

And I fail to understand the assert_all_objects_consumed for now so ¯\_(ツ)_/¯
...

need some rest most probably [2]

tl; dr: ^ I use this code instead of dateutil.parser_date (or whatever the
real name is) because we agreed on stopping using that and converge on iso8601.
I did use first iso8601 and removed it because you ask (reasonably it's not a
dependency yet so we can avoid it)....

[1] And then, ideally we want directly datetime.datetime because we should also
converge on using datetime on origin-visit directly (as we do
origin-visit-status now)... Which would avoid the parsing date shenanigans
altogether...

But now i'm in a world of pain of trying to understand why that make the
current tests on origin-visit fail [2] (which is kinda irrelevant to my diff
really)...

[2] https://forge.softwareheritage.org/P690

swh/journal/tests/journal_data.py
207

Relatedly to that particular issue [2], I've opened D3246 which demonstrates the current problem.
That might help for today ;)

swh/journal/tests/journal_data.py
207

s/today/tomorrow/

^ see what i mean about rest and everything ;)

Build is green

Patch application report for D3241 (id=11509)

Could not rebase; Attempt merge onto 64cd01fc7c...

Updating 64cd01f..d18c5ef
Fast-forward
 swh/journal/pytest_plugin.py            |  3 +++
 swh/journal/serializers.py              |  6 ++++++
 swh/journal/tests/journal_data.py       | 21 ++++++++++++++++-----
 swh/journal/tests/test_pytest_plugin.py |  1 +
 4 files changed, 26 insertions(+), 5 deletions(-)
Changes applied before test
commit d18c5ef32fa9ddfbf58df0139fb8e00d9d3bf86d
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jun 8 14:28:04 2020 +0200

    Allow journal to deal with origin_visit_status
    
    Related to T2310

commit ee934c7de8d6a71b930c3376d7d7a4c958eb9a6a
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jun 8 18:10:52 2020 +0200

    test: Use origin-visit date field as datetime to phase out iso8601 str
    
    This is also preparatory work for D3241

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

This revision is now accepted and ready to land.Jun 9 2020, 10:18 AM