Page MenuHomeSoftware Heritage

model: known attribute in Tree structure
ClosedPublic

Authored by DanSeraf on Apr 27 2020, 4:05 PM.

Details

Summary

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

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 D3070 (id=10919)

Rebasing onto 3bca054d47...

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.

Build is green

Patch application report for D3070 (id=10920)

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

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 3bca054d47...

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.

Build is green

Patch application report for D3070 (id=10922)

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

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.

Build is green

Patch application report for D3070 (id=10924)

Rebasing onto 3bca054d47...

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 added a subscriber: vlorentz.
vlorentz added inline comments.
swh/scanner/model.py
95–103

Neither the name or the docstring is very clear about what it returns.

104–107
return {str(self.path): {
    "swhid": self.swhid,
    "known": self.known,
}}
109–112

This docstring could use an example

swh/scanner/tests/test_model.py
53

should also check the other ones are False

This revision now requires changes to proceed.Apr 27 2020, 5:00 PM

Build is green

Patch application report for D3070 (id=10928)

Rebasing onto 3bca054d47...

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.

This revision is now accepted and ready to land.Apr 28 2020, 4:55 PM