Page MenuHomeSoftware Heritage

api_route: Ensure never_cache is honored for all response status codes
ClosedPublic

Authored by anlambert on Feb 17 2021, 1:55 PM.

Details

Summary

Previously never cache headers were only added for responses with status code
200 but error responses must also be considered.

So move never_cache parameter handling of api_route decorator from apiurls
module to apiresponse one.

Related to T2774

Diff Detail

Repository
rDWAPPS Web applications
Branch
fix-never-cache-error-responses
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 19289
Build 29914: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 29913: arc lint + arc unit

Unit TestsFailed

TimeTest
0 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.api.test_apiresponse
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/test_apiresponse.py:156: in <module> @given(content(), directory(), revision()) .tox/py3/lib/python3.7/site-packages/swh/web/tests/strategies.py:91: in content
0 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.api.test_utils
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/test_utils.py:110: in <module> @given(release()) .tox/py3/lib/python3.7/site-packages/swh/web/tests/strategies.py:350: in release
0 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.api.views.test_content
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_content.py:20: in <module> @given(content()) .tox/py3/lib/python3.7/site-packages/swh/web/tests/strategies.py:91: in content
0 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.api.views.test_directory
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_directory.py:17: in <module> @given(directory()) .tox/py3/lib/python3.7/site-packages/swh/web/tests/strategies.py:223: in directory
0 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.api.views.test_graph
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_graph.py:168: in <module> @given(origin()) .tox/py3/lib/python3.7/site-packages/swh/web/tests/strategies.py:269: in origin
View Full Test Results (23 Failed)

Event Timeline

Build has FAILED

Patch application report for D5094 (id=18188)

Rebasing onto 113957105c...

Current branch diff-target is up to date.
Changes applied before test
commit eecf55400525d38c1a93508ba3694ad2837100db
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Wed Feb 17 13:49:48 2021 +0100

    api_route: Ensure never_cache is honored for all response status codes
    
    Previously never cache headers were only added for responses with status code
    200 but error responses must also be considered.
    
    So move never_cache parameter handling of api_route decorator from apiurls
    module to apiresponse one.
    
    Related to T2774

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

Harbormaster returned this revision to the author for changes because remote builds failed.Feb 17 2021, 1:58 PM
Harbormaster failed remote builds in B19289: Diff 18188!

Diff failing not due to the change but due to D5093
(should fix this provided D5077 is landed/released first)

Build is green

Patch application report for D5094 (id=18193)

Rebasing onto 2e0ccea86a...

Current branch diff-target is up to date.
Changes applied before test
commit 2fbbbb95ef8b582f48efe189d46f0fe0d613e5dd
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Wed Feb 17 13:49:48 2021 +0100

    api_route: Ensure never_cache is honored for all response status codes
    
    Previously never cache headers were only added for responses with status code
    200 but error responses must also be considered.
    
    So move never_cache parameter handling of api_route decorator from apiurls
    module to apiresponse one.
    
    Related to T2774

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

This revision is now accepted and ready to land.Feb 17 2021, 3:57 PM