Page MenuHomeSoftware Heritage

Rename the RawExtrinsicMetadata id field to target
ClosedPublic

Authored by olasd on Oct 23 2020, 5:20 PM.

Details

Summary

This backwards-compatible change prepares the transition to give
RawExtrinsicMetadata an id field that is computed intrinsically from its
contents (using the HashableObject mixin).

The next steps will be:

  • release swh.model with this change
  • use the target attribute in swh.storage and swh.loader.core
  • release both modules
  • drop the id attribute and test again
  • release swh.model again
  • add a computed id field on all ExtrinsicMetadata objects

Related to T2703

Test Plan

tox + pytest in swh.storage and swh.loader.core

Diff Detail

Repository
rDMOD Data model
Branch
raw-extrinsic-metadata-identifiers
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 16633
Build 25640: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 25639: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D4348 (id=15383)

Rebasing onto 498a107641...

Current branch diff-target is up to date.
Changes applied before test
commit 4df6ac7027ded0dfd61ecdccc7c9fbaef2300af2
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Tue Oct 20 14:19:13 2020 +0200

    Rename the RawExtrinsicMetadata id field to target
    
    This backwards-compatible change prepares the transition to give
    RawExtrinsicMetadata an `id` field that is computed intrinsically from its
    contents (using the HashableObject mixin).

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

Wouldn't it help the transition to also set an id attribute on instance? (You tell me, I don't know if it's actually used)

Wouldn't it help the transition to also set an id attribute on instance? (You tell me, I don't know if it's actually used)

There's an id property for that purpose on the RawExtrinsicMetadata class (unless I'm missing something?)

oh yes, my bad. could you add a test for it?

(Use https://docs.pytest.org/en/stable/warnings.html so it doesn't show in pytest's output)

oh yes, my bad. could you add a test for it?

Right. Done.

(Use https://docs.pytest.org/en/stable/warnings.html so it doesn't show in pytest's output)

I've applied that to one of the tests, and migrated all the others to the proper attribute, so the tox output is deprecation warnings-clean.

Build is green

Patch application report for D4348 (id=15404)

Rebasing onto 498a107641...

Current branch diff-target is up to date.
Changes applied before test
commit 9da17a51dfaff267db50726b26b6b21f11048569
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Tue Oct 20 14:19:13 2020 +0200

    Rename the RawExtrinsicMetadata id field to target
    
    This backwards-compatible change prepares the transition to give
    RawExtrinsicMetadata an `id` field that is computed intrinsically from its
    contents (using the HashableObject mixin).

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

This revision is now accepted and ready to land.Oct 27 2020, 10:35 AM