Page MenuHomeSoftware Heritage

assets/webapp-utils: Add lowercase validator for core SWHIDs
ClosedPublic

Authored by anlambert on Apr 30 2021, 2:43 PM.

Details

Summary

When entering a SWHID in a search input, check its core part is in lowercase
and do not validate the form if it is not.

An error message clearly indicating that core SWHID should be in lowercase
will then be displayed.

Nevertheless, core SWHID with uppercase chars in it will still be automatically
fixed when provided to its resolve URL /<swhid>

Related to T3298

Diff Detail

Repository
rDWAPPS Web applications
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 D5655 (id=20194)

Rebasing onto 03cfd89a1d...

Current branch diff-target is up to date.
Changes applied before test
commit 9d4fe4aa6cba0d49c09827239723b7590880ef83
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Apr 30 14:39:13 2021 +0200

    assets/webapp-utils: Do not validate core SWHIDs with upperchase chars
    
    When entering a SWHID in a search input, check its core part is in lowercase
    and do not validate the form if it is not.
    
    An error message clearly indicating that core SWHID should be in lowercase
    will then be displayed.
    
    Nevertheless, core SWHID with uppercase chars in it will still be automatically
    fixed when provided to its resolve URL /<swhid>
    
    Related to T3298

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

anlambert retitled this revision from assets/webapp-utils: Do not validate core SWHIDs with upperchase chars to assets/webapp-utils: Do not validate core SWHIDs with uppercase chars.Apr 30 2021, 2:53 PM

Build has FAILED

Patch application report for D5655 (id=20195)

Rebasing onto 03cfd89a1d...

Current branch diff-target is up to date.
Changes applied before test
commit 1652204157ca01024f6bc03adde4e14c78bf7a3c
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Apr 30 14:39:13 2021 +0200

    assets/webapp-utils: Do not validate core SWHIDs with uppercase chars
    
    When entering a SWHID in a search input, check its core part is in lowercase
    and do not validate the form if it is not.
    
    An error message clearly indicating that core SWHID should be in lowercase
    will then be displayed.
    
    Nevertheless, core SWHID with uppercase chars in it will still be automatically
    fixed when provided to its resolve URL /<swhid>
    
    Related to T3298

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

Build has FAILED

Patch application report for D5655 (id=20195)

Rebasing onto 03cfd89a1d...

Current branch diff-target is up to date.
Changes applied before test
commit 1652204157ca01024f6bc03adde4e14c78bf7a3c
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Apr 30 14:39:13 2021 +0200

    assets/webapp-utils: Do not validate core SWHIDs with uppercase chars
    
    When entering a SWHID in a search input, check its core part is in lowercase
    and do not validate the form if it is not.
    
    An error message clearly indicating that core SWHID should be in lowercase
    will then be displayed.
    
    Nevertheless, core SWHID with uppercase chars in it will still be automatically
    fixed when provided to its resolve URL /<swhid>
    
    Related to T3298

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

Update commit message and display valid SWHID in error message.

anlambert retitled this revision from assets/webapp-utils: Do not validate core SWHIDs with uppercase chars to assets/webapp-utils: Add lowercase validator for core SWHIDs.Apr 30 2021, 4:32 PM
anlambert edited the summary of this revision. (Show Details)

Build is green

Patch application report for D5655 (id=20197)

Rebasing onto 03cfd89a1d...

Current branch diff-target is up to date.
Changes applied before test
commit 1d61e250f933a0a79945e0aa45fccbd4f05b7ed3
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Apr 30 14:39:13 2021 +0200

    assets/webapp-utils: Add lowercase validator for core SWHIDs
    
    When entering a SWHID in a search input, check its core part is in lowercase
    and do not validate the form if it is not.
    
    An error message clearly indicating that core SWHID should be in lowercase
    will then be displayed.
    
    Nevertheless, core SWHID with uppercase chars in it will still be automatically
    fixed when provided to its resolve URL /<swhid>
    
    Related to T3298

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

ardumont added a subscriber: ardumont.

lgtm (i think)

This revision is now accepted and ready to land.Apr 30 2021, 5:20 PM

Build is green

Patch application report for D5655 (id=20200)

Rebasing onto 450988b969...

Current branch diff-target is up to date.
Changes applied before test
commit 6195763423075074d875853cc098977eac6ace86
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Apr 30 14:39:13 2021 +0200

    assets/webapp-utils: Add lowercase validator for core SWHIDs
    
    When entering a SWHID in a search input, check its core part is in lowercase
    and do not validate the form if it is not.
    
    An error message clearly indicating that core SWHID should be in lowercase
    will then be displayed.
    
    Nevertheless, core SWHID with uppercase chars in it will still be automatically
    fixed when provided to its resolve URL /<swhid>
    
    Related to T3298

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