Page MenuHomeSoftware Heritage

Make relation_add sql function prefill entity tables if needed
ClosedPublic

Authored by douardda on Oct 13 2022, 11:11 AM.

Details

Summary

instead of depending on the proper behavior of the user of the
ProvenanceStoragePostgresql user.

splited from D8658 and
Depends on D8668

Diff Detail

Repository
rDPROV Provenance database
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 D8670 (id=31317)

Could not rebase; Attempt merge onto b3fa1f5924...

Updating b3fa1f5..e1da37d
Fast-forward
 swh/provenance/provenance.py                       |  16 -
 swh/provenance/sql/15-flavor.sql                   |   8 +-
 swh/provenance/sql/30-schema.sql                   |   5 +-
 swh/provenance/sql/40-funcs.sql                    | 365 +++------------------
 swh/provenance/sql/upgrades/004.sql                |  29 ++
 swh/provenance/storage/interface.py                |   4 -
 swh/provenance/storage/journal.py                  |   3 -
 swh/provenance/storage/postgresql.py               |  29 +-
 swh/provenance/tests/conftest.py                   |   4 +-
 swh/provenance/tests/test_cli.py                   |  17 +-
 swh/provenance/tests/test_provenance_db.py         |   6 +-
 swh/provenance/tests/test_provenance_storage.py    | 112 ++-----
 ....py => test_provenance_storage_denormalized.py} |   2 +-
 .../tests/test_provenance_storage_rabbitmq.py      |   7 +-
 ...st_provenance_storage_with_path_denormalized.py |  24 --
 ...provenance_storage_without_path_denormalized.py |  24 --
 .../tests/test_revision_content_layer.py           |  44 +--
 17 files changed, 157 insertions(+), 542 deletions(-)
 create mode 100644 swh/provenance/sql/upgrades/004.sql
 rename swh/provenance/tests/{test_provenance_storage_without_path.py => test_provenance_storage_denormalized.py} (95%)
 delete mode 100644 swh/provenance/tests/test_provenance_storage_with_path_denormalized.py
 delete mode 100644 swh/provenance/tests/test_provenance_storage_without_path_denormalized.py
Changes applied before test
commit e1da37d4375f859c139f247f14b971228cf43a7b
Author: David Douard <david.douard@sdfa3.org>
Date:   Wed Oct 12 15:18:52 2022 +0200

    Make relation_add sql function prefill entity tables if needed
    
    instead of depending on the proper behavior of the user of the
    ProvenanceStoragePostgresql user.

commit a0b2f0e9da09b8d2ddbaa80dfd57473185327dd7
Author: David Douard <david.douard@sdfa3.org>
Date:   Wed Oct 12 15:16:54 2022 +0200

    Remove the without-path db flavor
    
    it's not used, and keeping it makes code unnecessarly complex.

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

vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
swh/provenance/sql/40-funcs.sql
125

inconsistent indent

This revision is now accepted and ready to land.Oct 13 2022, 11:19 AM
swh/provenance/sql/40-funcs.sql
125

well it's somewhat consistent with the inconsistencies in this file...