Page MenuHomeSoftware Heritage

Accept <codemeta:name> and <codemeta:author> as alternatives to <atom:name>/<atom:title> and <atom:author>.
ClosedPublic

Authored by vlorentz on Dec 10 2020, 12:10 PM.

Details

Summary

This was broken by a8e86a92eeeba4ed5114ff2ef4096ba25213d98a,
as the check_metadata() checks whether there is a tag that *contains*
the expected name, checking for 'author' (the old name of 'atom:author')
accidentally matched 'codemeta:author' as well.

This resulted in the right behavior in the majority of the cases
(accepted 'codemeta:author'), but for the wrong reason, and explicitly
renaming to atom:author broke this.

Ditto for name.

A future commit will remove the substring matching to remove
false positives (eg. 'atom:authorblahblah' should not be accepted
as 'atom:author')

Resolves T2871.

Diff Detail

Repository
rDDEP Push deposit
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 D4713 (id=16694)

Rebasing onto 5ed8942e84...

Current branch diff-target is up to date.
Changes applied before test
commit 9e79057cc2f7d88f01e3bc2220ccd88ca26f565b
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Dec 10 12:09:40 2020 +0100

    Accept <codemeta:name> and <codemeta:author> as alternatives to <atom:name>/<atom:title> and <atom:author>.
    
    This was broken by a8e86a92eeeba4ed5114ff2ef4096ba25213d98a,
    as the check_metadata() checks whether there is a tag that *contains*
    the expected name, checking for 'author' (the old name of 'atom:author')
    accidentally matched 'codemeta:author' as well.
    
    This resulted in the right behavior in the majority of the cases
    (accepted 'codemeta:author'), but for the wrong reason, and explicitly
    renaming to atom:author broke this.
    
    Ditto for name.
    
    A future commit will remove the substring matching to remove
    false positives (eg. 'atom:authorblahblah' should not be accepted
    as 'atom:author')

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

ardumont added a subscriber: ardumont.

lgtm

(one print statement to remove as asked inline)

swh/deposit/tests/api/test_deposit_update.py
803

please, drop the print statement.

This revision is now accepted and ready to land.Dec 10 2020, 12:25 PM

Build is green

Patch application report for D4713 (id=16696)

Rebasing onto 5ed8942e84...

Current branch diff-target is up to date.
Changes applied before test
commit 00795b41d6ab75a2d9d79c61eaea9ca70e0617ce
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Dec 10 12:09:40 2020 +0100

    Accept <codemeta:name> and <codemeta:author> as alternatives to <atom:name>/<atom:title> and <atom:author>.
    
    This was broken by a8e86a92eeeba4ed5114ff2ef4096ba25213d98a,
    as the check_metadata() checks whether there is a tag that *contains*
    the expected name, checking for 'author' (the old name of 'atom:author')
    accidentally matched 'codemeta:author' as well.
    
    This resulted in the right behavior in the majority of the cases
    (accepted 'codemeta:author'), but for the wrong reason, and explicitly
    renaming to atom:author broke this.
    
    Ditto for name.
    
    A future commit will remove the substring matching to remove
    false positives (eg. 'atom:authorblahblah' should not be accepted
    as 'atom:author')

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