Page MenuHomeSoftware Heritage

scanner: removed _iter_nodes_attr function in model (causes results duplication)
ClosedPublic

Authored by DanSeraf on Oct 13 2020, 8:54 AM.

Details

Summary

Since the model already provide a function to iterate the child nodes, _iter_nodes_attr is not useful and causes results duplication (Related T2690)

Function to_dict updated to reflect changes.

Test Plan

It would be nice to have another (sub)module to manage the scanner output rather than capture the stdout of the ndjson format to test the output.

Diff Detail

Repository
rDTSCN Code scanner
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 D4241 (id=14977)

Rebasing onto 88ded8631b...

Current branch diff-target is up to date.
Changes applied before test
commit 70136267f2b40b8a5b0011c6a2093f3f5e912bad
Author: Daniele Serafini <me@danieleserafini.eu>
Date:   Mon Oct 12 20:16:28 2020 +0200

    model: dropped _iter_nodes_attr function
    
    since the model already provide a function to iterate the child nodes,
    _iter_nodes_attr is not useful
    
    function to_dict updated to reflect changes

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

zack added a subscriber: zack.

I confirm this fixes the issue. LGTM, thanks !

A couple of things:

  • do not forget the Closes line (rather than Related) in the commit message, to auto-close T2690 upon landing
  • if you think testing logic should be improved (as per your comment in testing plan), please file a dedicated task with some more info/details
This revision is now accepted and ready to land.Oct 13 2020, 9:19 AM