Page MenuHomeSoftware Heritage

search.journal_client: Actually filter on full origin_visit_status
ClosedPublic

Authored by ardumont on Dec 15 2020, 9:15 PM.

Details

Summary

I think something went badly in some old rebase I did because I thought that
was already the case.

Or I may conflate with the other indexer journal client... [1]

[1] https://forge.softwareheritage.org/source/swh-indexer/browse/master/swh/indexer/journal_client.py$25

Test Plan

tox

Diff Detail

Repository
rDSEA Archive search
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 D4749 (id=16817)

Rebasing onto b47bea2547...

Current branch diff-target is up to date.
Changes applied before test
commit 94c38bf61d878d618caf298f89886845baa52ff2
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Dec 15 21:12:38 2020 +0100

    search.journal_client: Actually filter on full origin_visit_status

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

Here is a test:

def test_journal_client_origin_visit_status_from_journal():
    search_mock = MagicMock()

    worker_fn = functools.partial(process_journal_objects, search=search_mock,)

    worker_fn({"origin_visit_status": [{"origin": {"url": "http://foobar.baz"}, "status": "full"}]})
    search_mock.origin_update.assert_called_once_with(
        [{"url": "http://foobar.baz", "has_visits": True},]
    )

    search_mock.reset_mock()

    worker_fn({"origin_visit_status": [{"origin": {"url": "http://foobar.baz"}, "status": "partial"}]})
    search_mock.origin_update.assert_not_called()
This revision is now accepted and ready to land.Dec 17 2020, 11:33 AM

Build has FAILED

Patch application report for D4749 (id=16839)

Rebasing onto b47bea2547...

Current branch diff-target is up to date.
Changes applied before test
commit 20a9d2e349b99bfb8a3d1c80f6ad1a9729b49cc9
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Dec 15 21:12:38 2020 +0100

    search.journal_client: Actually filter on full origin_visit_status

Link to build: https://jenkins.softwareheritage.org/job/DSEA/job/tests-on-diff/63/
See console output for more information: https://jenkins.softwareheritage.org/job/DSEA/job/tests-on-diff/63/console

Build is green

Patch application report for D4749 (id=16845)

Rebasing onto b47bea2547...

Current branch diff-target is up to date.
Changes applied before test
commit c3758cf6120fa832455e3d9955720c6be2c89537
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Dec 15 21:12:38 2020 +0100

    search.journal_client: Actually filter on full origin_visit_status

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