Page MenuHomeSoftware Heritage

Fix pagination in api_raw_extrinsic_metadata_swhid
ClosedPublic

Authored by vlorentz on Jun 3 2022, 11:43 AM.

Details

Summary

This code path was never actually tested before upgrading to
hypothesis ~6.45.

base64.urlsafe_b64encode returns bytes, which applied str()
to since D7938.

This reverts commit ce5824a68aed3b2717542c4e31d99152af7c2605.

Diff Detail

Repository
rDWAPPS Web applications
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 29731
Build 46467: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 46466: arc lint + arc unit

Event Timeline

Build was aborted

Patch application report for D7955 (id=28645)

Rebasing onto ce5824a68a...

Current branch diff-target is up to date.
Changes applied before test
commit 9ad820f6465f3c46bf1476334d1b47bad7a9da20
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Jun 3 11:43:15 2022 +0200

    Revert "tests: Fix flaky ones since hypothesis 6.46.11 release"
    
    This reverts commit ce5824a68aed3b2717542c4e31d99152af7c2605.

commit 429dbf811a37fabd3bcaeb26857a38393a9e3a86
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Jun 3 11:41:40 2022 +0200

    Fix pagination in api_raw_extrinsic_metadata_swhid
    
    This code path was never actually tested before upgrading to
    hypothesis ~6.45.
    
    base64.urlsafe_b64encode returns bytes, which Django applied str()
    to, causing the token to be

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

Build was aborted

Patch application report for D7955 (id=28648)

Rebasing onto ce5824a68a...

Current branch diff-target is up to date.
Changes applied before test
commit 3a4e607645bd45269ec72cb5e9b4a487c71145ae
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Jun 3 11:43:15 2022 +0200

    Revert "tests: Fix flaky ones since hypothesis 6.46.11 release"
    
    This reverts commit ce5824a68aed3b2717542c4e31d99152af7c2605.

commit 1c512a8365afb9485e9ac202046fd1ca4223a3c4
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Jun 3 11:41:40 2022 +0200

    Fix pagination in api_raw_extrinsic_metadata_swhid
    
    This code path was not properly tested before upgrading to
    hypothesis ~6.45.
    
    base64.urlsafe_b64encode returns bytes, which applied str()
    to since 6e52f32e3e842dbb68edf1fb220f18c7eef8a28d.

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

Harbormaster returned this revision to the author for changes because remote builds failed.Jun 3 2022, 12:25 PM
Harbormaster failed remote builds in B29731: Diff 28648!

Build is green

Patch application report for D7955 (id=28648)

Rebasing onto ce5824a68a...

Current branch diff-target is up to date.
Changes applied before test
commit 3a4e607645bd45269ec72cb5e9b4a487c71145ae
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Jun 3 11:43:15 2022 +0200

    Revert "tests: Fix flaky ones since hypothesis 6.46.11 release"
    
    This reverts commit ce5824a68aed3b2717542c4e31d99152af7c2605.

commit 1c512a8365afb9485e9ac202046fd1ca4223a3c4
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Jun 3 11:41:40 2022 +0200

    Fix pagination in api_raw_extrinsic_metadata_swhid
    
    This code path was not properly tested before upgrading to
    hypothesis ~6.45.
    
    base64.urlsafe_b64encode returns bytes, which applied str()
    to since 6e52f32e3e842dbb68edf1fb220f18c7eef8a28d.

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

anlambert added a subscriber: anlambert.

Looks good to me. I will submit another diff to ensure the query_params parameter of the reverse function is of type Dict[str, Optional[str]] in order to avoid that kind of issues.

This revision is now accepted and ready to land.Jun 3 2022, 1:41 PM