Page MenuHomeSoftware Heritage

Implement storage of the ExtID.extid_version field
ClosedPublic

Authored by olasd on Jul 23 2021, 5:25 PM.

Details

Summary

This fields allows having multiple version of the ExtID -> SWHID
mapping, for instance when the implementation of a loader changes in a
backwards-incompatible way.

For now, we don't change the API used to query or store ExtIDs. When
querying for the SWHIDs corresponding to a given external objects, all
versions are returned, and the client is expected to do the filtering.

Test Plan

adapted tests to check storage of the version field; added test for
behavior of multiple identical extids having different versions

Diff Detail

Repository
rDSTO Storage manager
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build has FAILED

Patch application report for D6023 (id=21771)

Rebasing onto 9747aed6cb...

Current branch diff-target is up to date.
Changes applied before test
commit 029f82f21b934458f9992102c21f290c6eaa0b6e
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Fri Jul 23 16:13:08 2021 +0200

    Implement storage of the ExtID.extid_version field
    
    This fields allows having multiple version of the ExtID -> SWHID
    mapping, for instance when the implementation of a loader changes in a
    backwards-incompatible way.
    
    For now, we don't change the API used to query or store ExtIDs. When
    querying for the SWHIDs corresponding to a given external objects, all
    versions are returned, and the client is expected to do the filtering.

Link to build: https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/1355/
See console output for more information: https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/1355/console

Harbormaster returned this revision to the author for changes because remote builds failed.Jul 23 2021, 5:26 PM
Harbormaster failed remote builds in B22738: Diff 21771!

Add migration script and appease flake8

Build is green

Patch application report for D6023 (id=21772)

Rebasing onto 9747aed6cb...

Current branch diff-target is up to date.
Changes applied before test
commit 7a380458f4ab3b013440817e72485714e6b1585c
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Fri Jul 23 16:13:08 2021 +0200

    Implement storage of the ExtID.extid_version field
    
    This fields allows having multiple version of the ExtID -> SWHID
    mapping, for instance when the implementation of a loader changes in a
    backwards-incompatible way.
    
    For now, we don't change the API used to query or store ExtIDs. When
    querying for the SWHIDs corresponding to a given external objects, all
    versions are returned, and the client is expected to do the filtering.

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

olasd requested review of this revision.Jul 23 2021, 5:45 PM
vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
sql/upgrades/176.sql
11
This revision is now accepted and ready to land.Jul 26 2021, 2:33 PM

Pushed it as is given the suggested comment. I'll adapt accordingly in another commit.

Identified the name of the diff in phabricator: 21772.

Then locally retrieved the commit and merged it in master as is:

$ git checkout-from-staging 21772  # git alias [2]
remote: Enumerating objects: 52, done.
remote: Counting objects: 100% (52/52), done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 27 (delta 22), reused 0 (delta 0)
Unpacking objects: 100% (27/27), 3.63 KiB | 154.00 KiB/s, done.
From https://forge.softwareheritage.org/source/staging
 * [new tag]           phabricator/diff/21772 -> diff/21772
Switched to branch 'diff/21772'
$ git checkout master
$ git merge diff/21772
$ git push origin master

[2]

$ head -2 ~/.config/git/config
[alias]
        checkout-from-staging = "!f() { git fetch -nf https://forge.softwareheritage.org/source/staging.git phabricator/diff/$1:diff/$1 && git checkout diff/$1; }; f"