Page MenuHomeSoftware Heritage

Open origin_visit api in storage + Update occurrence_add api
AbandonedPublic

Authored by ardumont on Aug 19 2016, 1:50 PM.

Details

Summary
  • Update occurrence_add api entry point to properly deal with origin_visit (T540)
  • Add origin_visit api entry points to create/update origin_visit (T538)
  • sql/upgrades/075: 074→075 - Add status info to origin_visit (T534)

Diff Detail

Repository
rDSTO Storage manager
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 391
Build 576: Software Heritage Python tests
Build 575: arc lint + arc unit

Event Timeline

ardumont retitled this revision from to sql/upgrades/075: 074→075 - Add status info to origin_visit.
ardumont updated this object.
ardumont edited the test plan for this revision. (Show Details)
ardumont added a reviewer: olasd.
ardumont retitled this revision from sql/upgrades/075: 074→075 - Add status info to origin_visit to T534-T538 - Open origin_visit api in storage.Aug 19 2016, 1:52 PM
ardumont updated this object.
ardumont edited edge metadata.
olasd requested changes to this revision.Aug 19 2016, 2:25 PM
olasd edited edge metadata.

A few comments inline

sql/swh-func.sql
838–854

I think this function could be done directly in language SQL : remove the declaration, and do return query with [...] returning visit;

swh/storage/tests/test_storage.py
1088

It'd be clearer if the tests were split between the add and update functions.

This revision now requires changes to proceed.Aug 19 2016, 2:25 PM
ardumont edited edge metadata.
  • sql/upgrades/075: 074→075 - Add status info to origin_visit
  • Add origin_visit api entry points to create/update origin_visit
ardumont added inline comments.
sql/swh-func.sql
838–854

Indeed ^^

ardumont added inline comments.
swh/storage/tests/test_storage.py
1088

I'm on it.

ardumont edited edge metadata.
  • Add origin_visit api entry points to create/update origin_visit
  • Add origin_visit api entry points to create/update origin_visit
  • Update occurrence_add api entry point to deal with origin_visit
  • Fix origin_visit time policy in occurrence_add api
  • Cleanup obsolete reference to date in occurrence_add entry
ardumont retitled this revision from T534-T538 - Open origin_visit api in storage to T534-T538 - Open origin_visit api in storage + Update occurrence_add api.Aug 22 2016, 12:38 PM
olasd requested changes to this revision.Aug 22 2016, 1:59 PM
olasd edited edge metadata.

For consistency with how other object additions are handled, I think we should add a visit column to the occurrence_history temporary table, and use that to populate the "visit" object, rather than pass a new argument to occurrence_add.

Case in point, one of the two new arguments is not being used currently (the origin_id is pulled from the temporary table).

We can revisit this later when we'll have nailed down the so-called snapshot objects, but for now I think consistency trumps any future goals.

sql/swh-func.sql
860

The origin_id is not used here (it's already a column in tmp_occurrence_history).

890

We're not pulling any data from origin_visit anymore so you can ditch this join.

This revision now requires changes to proceed.Aug 22 2016, 1:59 PM
ardumont edited edge metadata.
  • Update occurrence_add api entry point to properly deal with origin_visit
ardumont retitled this revision from T534-T538 - Open origin_visit api in storage + Update occurrence_add api to Open origin_visit api in storage + Update occurrence_add api.Aug 22 2016, 2:53 PM
ardumont updated this object.
ardumont edited edge metadata.
ardumont marked 2 inline comments as done.
ardumont updated this object.
  • Update occurrence_add api entry point to properly deal with origin_visit
olasd edited edge metadata.

I think both database upgrades should be merged as 075 is currently breaking stuff that 076 fixes. Apart from that, this looks good.

Thanks!

This revision is now accepted and ready to land.Aug 22 2016, 3:20 PM
ardumont edited edge metadata.
  • Update occurrence_add api entry point to properly deal with origin_visit
This revision now requires review to proceed.Aug 22 2016, 3:42 PM

I think both database upgrades should be merged as 075 is currently breaking stuff that 076 fixes.

Yes, done.