Skip to content
Snippets Groups Projects

model: known attribute in Tree structure

The 'model' now has the "known" attribute and the Software Heritage persistent identifier is saved for unknown files.

tests adapted to the new attribute on the model


Migrated from D3070 (view on Phabricator)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Build is green

    Patch application report for D3070 (id=10919)

    Rebasing onto 3bca054d...

    Current branch diff-target is up to date.
    Changes applied before test
    commit 4f7fd3e0599c60e8d0adeb9e8f66e3c3f2bb60d7
    Author: Daniele Serafini <me@danieleserafini.eu>
    Date:   Mon Apr 27 16:00:10 2020 +0200
    
        scanner tests adapted to the new attribute on the model
    
    commit 66d6394ba20e452771c47b99deea1b8f6f3e7352
    Author: Daniele Serafini <me@danieleserafini.eu>
    Date:   Mon Apr 27 15:55:01 2020 +0200
    
        model: known attribute in Tree structure
        
        The scanner now has the "known" attribute and the
        Software Heritage persistent identifier is saved
        also for unknown files.
        
        model tests adapted to the new attribute

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

  • child diff

  • Build is green

    Patch application report for D3070 (id=10920)

    Could not rebase; Attempt merge onto 3bca054d...

    Updating 3bca054..4f7fd3e
    Fast-forward
     swh/scanner/model.py                               | 60 ++++++++++++++++++----
     swh/scanner/scanner.py                             | 10 ++--
     swh/scanner/tests/conftest.py                      |  6 +--
     swh/scanner/tests/data.py                          |  5 +-
     .../data/sample-folder-result-no-toexclude.json    | 12 -----
     swh/scanner/tests/data/sample-folder-result.json   | 13 -----
     swh/scanner/tests/flask_api.py                     | 14 ++---
     swh/scanner/tests/test_model.py                    | 40 ++++++++-------
     swh/scanner/tests/test_scanner.py                  | 30 +++++------
     9 files changed, 100 insertions(+), 90 deletions(-)
     delete mode 100644 swh/scanner/tests/data/sample-folder-result-no-toexclude.json
     delete mode 100644 swh/scanner/tests/data/sample-folder-result.json
    Changes applied before test
    commit 4f7fd3e0599c60e8d0adeb9e8f66e3c3f2bb60d7
    Author: Daniele Serafini <me@danieleserafini.eu>
    Date:   Mon Apr 27 16:00:10 2020 +0200
    
        scanner tests adapted to the new attribute on the model
    
    commit 66d6394ba20e452771c47b99deea1b8f6f3e7352
    Author: Daniele Serafini <me@danieleserafini.eu>
    Date:   Mon Apr 27 15:55:01 2020 +0200
    
        model: known attribute in Tree structure
        
        The scanner now has the "known" attribute and the
        Software Heritage persistent identifier is saved
        also for unknown files.
        
        model tests adapted to the new attribute

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

  • Build is green

    Patch application report for D3070 (id=10921)

    Rebasing onto 3bca054d...

    Current branch diff-target is up to date.
    Changes applied before test
    commit c8d7b09d7a5383934d1234e45eda31e395365429
    Author: Daniele Serafini <me@danieleserafini.eu>
    Date:   Mon Apr 27 15:55:01 2020 +0200
    
        model: known attribute in Tree structure
        
        The scanner now has the "known" attribute and the
        Software Heritage persistent identifier is saved
        also for unknown files.
        
        model tests adapted to the new attribute
        
        scanner tests adapted to the new attribute on the model

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

  • child diff

  • Build is green

    Patch application report for D3070 (id=10922)

    Could not rebase; Attempt merge onto 3bca054d...

    Updating 3bca054..4f7fd3e
    Fast-forward
     swh/scanner/model.py                               | 60 ++++++++++++++++++----
     swh/scanner/scanner.py                             | 10 ++--
     swh/scanner/tests/conftest.py                      |  6 +--
     swh/scanner/tests/data.py                          |  5 +-
     .../data/sample-folder-result-no-toexclude.json    | 12 -----
     swh/scanner/tests/data/sample-folder-result.json   | 13 -----
     swh/scanner/tests/flask_api.py                     | 14 ++---
     swh/scanner/tests/test_model.py                    | 40 ++++++++-------
     swh/scanner/tests/test_scanner.py                  | 30 +++++------
     9 files changed, 100 insertions(+), 90 deletions(-)
     delete mode 100644 swh/scanner/tests/data/sample-folder-result-no-toexclude.json
     delete mode 100644 swh/scanner/tests/data/sample-folder-result.json
    Changes applied before test
    commit 4f7fd3e0599c60e8d0adeb9e8f66e3c3f2bb60d7
    Author: Daniele Serafini <me@danieleserafini.eu>
    Date:   Mon Apr 27 16:00:10 2020 +0200
    
        scanner tests adapted to the new attribute on the model
    
    commit 66d6394ba20e452771c47b99deea1b8f6f3e7352
    Author: Daniele Serafini <me@danieleserafini.eu>
    Date:   Mon Apr 27 15:55:01 2020 +0200
    
        model: known attribute in Tree structure
        
        The scanner now has the "known" attribute and the
        Software Heritage persistent identifier is saved
        also for unknown files.
        
        model tests adapted to the new attribute

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

  • vlorentz
    vlorentz @vlorentz started a thread on the diff
92 93 print(f"{begin}{rel_path}{end}")
93 94
95 @property
96 def attributes(self):
97 """
98 Get the attributes of the current node grouped by the relative path.
99
100 Returns:
101 a dictionary containing a path as key and its known/unknown status and the
102 Software Heritage persistent identifier as values.
103
104 """
105 return {str(self.path): {"swhid": self.swhid, "known": self.known,}}
106
107 def toDict(self, dict_nodes={}) -> Dict[str, Dict[str, Dict]]:
108 """
  • vlorentz
    vlorentz @vlorentz started a thread on the diff
  • 91 92
    92 93 print(f"{begin}{rel_path}{end}")
    93 94
    95 @property
    96 def attributes(self):
    97 """
    98 Get the attributes of the current node grouped by the relative path.
    99
    100 Returns:
    101 a dictionary containing a path as key and its known/unknown status and the
    102 Software Heritage persistent identifier as values.
    103
    104 """
  • Build is green

    Patch application report for D3070 (id=10924)

    Rebasing onto 3bca054d...

    Current branch diff-target is up to date.
    Changes applied before test
    commit 80812af59952830df0462de14a0e90d86bde66d7
    Author: Daniele Serafini <me@danieleserafini.eu>
    Date:   Mon Apr 27 15:55:01 2020 +0200
    
        model: known attribute in Tree structure
        
        The scanner now has the "known" attribute and the
        Software Heritage persistent identifier is saved
        also for unknown files.
        
        tests adapted to the new attribute on the model

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

  • vlorentz
    vlorentz @vlorentz started a thread on the diff
  • 98 Get the attributes of the current node grouped by the relative path.
    99
    100 Returns:
    101 a dictionary containing a path as key and its known/unknown status and the
    102 Software Heritage persistent identifier as values.
    103
    104 """
    105 return {str(self.path): {"swhid": self.swhid, "known": self.known,}}
    106
    107 def toDict(self, dict_nodes={}) -> Dict[str, Dict[str, Dict]]:
    108 """
    109 Recursively groups the current child nodes inside a dictionary.
    110
    111 For example, if you have the following structure:
    112
    113 .. code-block:: none
  • vlorentz
    vlorentz @vlorentz started a thread on the diff
  • 41 46 filesample_path = temp_folder["filesample"]
    42 47
    43 48 for path, pid in temp_folder["paths"].items():
    44 if path == filesample_path:
    45 example_tree.addNode(path, pid)
    46 else:
    47 example_tree.addNode(path)
    49 example_tree.addNode(path, pid, True if path == filesample_path else False)
    48 50
    49 tree_dict = example_tree.getTree()
    51 result = example_tree.toDict()
    50 52
    51 assert len(tree_dict) == 1
    52 assert tree_dict["subdir0"]["filesample.txt"]
    53 assert len(result) == 6
    54
  • Merge request was returned for changes

  • requested changes

  • Build is green

    Patch application report for D3070 (id=10928)

    Rebasing onto 3bca054d...

    Current branch diff-target is up to date.
    Changes applied before test
    commit bbf296f7523aeb221c946508760abdf834aeaddb
    Author: Daniele Serafini <me@danieleserafini.eu>
    Date:   Mon Apr 27 15:55:01 2020 +0200
    
        model: known attribute in Tree structure
        
        The scanner now has the "known" attribute and the
        Software Heritage persistent identifier is saved
        also for unknown files.
        
        tests adapted to the new attribute on the model

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

  • vlorentz mentioned in merge request !15 (closed)

    mentioned in merge request !15 (closed)

  • Merge request was accepted

  • vlorentz approved this merge request

    approved this merge request

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading