Page MenuHomeSoftware Heritage

Apply 'max_matching_nodes' restriction after 'return_types' filter
ClosedPublic

Authored by vlorentz on Sep 29 2022, 3:43 PM.

Details

Summary

Otherwise, less results may be returned, if the non-matching nodes are
before the matching ones.

Depends on D8579.

Diff Detail

Repository
rDGRPH Compressed graph representation
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Sep 29 2022, 3:44 PM
Harbormaster failed remote builds in B31925: Diff 30953!

Build is green

Patch application report for D8580 (id=30953)

Could not rebase; Attempt merge onto 8549673d02...

Merge made by the 'recursive' strategy.
 docs/api.rst                                       |  4 +++
 .../org/softwareheritage/graph/rpc/Traversal.java  | 12 +++----
 swh/graph/http_client.py                           | 19 ++++++++--
 swh/graph/http_naive_client.py                     | 17 +++++++--
 swh/graph/tests/test_http_client.py                | 42 ++++++++++++++++++++++
 5 files changed, 82 insertions(+), 12 deletions(-)
Changes applied before test
commit 8aa1356d7aa3e0416c2b03502244b87620cbb99a
Merge: 8549673 e2dfaf7
Author: Jenkins user <jenkins@localhost>
Date:   Thu Sep 29 14:15:33 2022 +0000

    Merge branch 'diff-target' into HEAD

commit e2dfaf726bdcf3cdad13b8f9c67b1d494dbef083
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Sep 29 15:41:27 2022 +0200

    Apply 'max_matching_nodes' restriction after 'return_types' filter
    
    Otherwise, less results may be returned, if the non-matching nodes are
    before the matching ones.

commit b4504ecb3cb5de7db7d36a8b3a6d34a899f49636
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Sep 29 15:39:27 2022 +0200

    http_client: Add max_matching_nodes parameter to visit_nodes()

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

olasd added a subscriber: olasd.

The logic seems sound, but I'm proposing an (untested) edit to make the code clearer, WDYT?

java/src/main/java/org/softwareheritage/graph/rpc/Traversal.java
283–305
This revision is now accepted and ready to land.Sep 29 2022, 5:55 PM
java/src/main/java/org/softwareheritage/graph/rpc/Traversal.java
283–305

actually I planned an ever simpler change: using only nodebuilder because the boolean is redundant

java/src/main/java/org/softwareheritage/graph/rpc/Traversal.java
283–305
This revision was landed with ongoing or failed builds.Sep 30 2022, 3:18 PM
This revision was automatically updated to reflect the committed changes.