Page MenuHomeSoftware Heritage

nixguix: Filter out releases with URLs different from the expected one
ClosedPublic

Authored by vlorentz on Dec 8 2021, 6:41 PM.

Details

Summary

This solves two problems:

  1. if the URL changes but the content doesn't, then the new snapshot would keep using the release with the old URL in its name.
  2. if there are two URLs pointing to the same content, the base loader would crash because it cannot know which one to pick.

Depends on D6803.
Resolves SWH-LOADER-CORE-115

Diff Detail

Repository
rDLDBASE Generic VCS/Package Loader
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 D6804 (id=24664)

Could not rebase; Attempt merge onto 98506af074...

Updating 98506af..b211232
Fast-forward
 swh/loader/package/loader.py                       | 23 +++++++++++--
 swh/loader/package/nixguix/loader.py               | 21 +++++++++++-
 .../owner-3_repository-1_revision-1.tgz            |  1 +
 .../nixpkgs-swh_sources.json                       |  5 +++
 swh/loader/package/nixguix/tests/test_nixguix.py   | 38 +++++++++-------------
 5 files changed, 62 insertions(+), 26 deletions(-)
 create mode 120000 swh/loader/package/nixguix/tests/data/https_github.com/owner-3_repository-1_revision-1.tgz
Changes applied before test
commit b211232a7b63143597fe82fc4b42abba882eb069
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Dec 8 18:39:58 2021 +0100

    nixguix: Filter out releases with URLs different from the expected one
    
    This solves two problems:
    
    1. if the URL changes but the content doesn't, then the new snapshot would keep
       using the release with the old URL in its name.
    2. if there are two URLs pointing to the same content, the base loader would
       crash because it cannot know which one to pick.

commit 636c1ddb9c87a2172e3ca1271a1726b3adc96d15
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Dec 8 18:35:32 2021 +0100

    nixguix: Deduplicate test data

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

This revision is now accepted and ready to land.Dec 9 2021, 10:15 AM