Details
- Reviewers
anlambert - Group Reviewers
Reviewers - Commits
- rDWAPPS2d3644545750: Fix documentation of meaning of 404 on vault endpoints.
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 has FAILED
Link to build: https://jenkins.softwareheritage.org/job/DWAPPS/job/cypress-diff/458/
See console output for more information: https://jenkins.softwareheritage.org/job/DWAPPS/job/cypress-diff/458/console
Build is green
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tox/856/ for more details.
swh/web/api/views/vault.py | ||
---|---|---|
85–87 | Indeed, this is the meaning of the 404 code in case of a GET request: 15:39 $ curl http://localhost:5004/api/1/vault/directory/b1483f0996e94c0c80fc76e5ef0f760fbe9a491b/ | jq % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 945 100 945 0 0 37800 0 --:--:-- --:--:-- --:--:-- 37800 { "exception": "NotFoundExc", "reason": "Directory 'b1483f0996e94c0c80fc76e5ef0f760fbe9a491b' was never requested.", "traceback": "Traceback (most recent call last):\n File \"/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/web/api/apidoc.py\", line 315, in documented_view\n response = f(request, **kwargs)\n File \"/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/web/api/views/vault.py\", line 90, in api_vault_cook_directory\n res = _dispatch_cook_progress(request, 'directory', obj_id)\n File \"/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/web/api/views/vault.py\", line 26, in _dispatch_cook_progress\n .format(object_name, hex_id)))\n File \"/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/web/api/views/utils.py\", line 47, in api_lookup\n raise NotFoundExc(notfound_msg)\nswh.web.common.exc.NotFoundExc: Directory 'b1483f0996e94c0c80fc76e5ef0f760fbe9a491b' was never requested.\n" } But in case of a POST request, the 404 code really means that the directory is not archived: 15:38 $ curl -X POST http://localhost:5004/api/1/vault/directory/b1483f0996e94c0c80fc76e5ef0f760fbe9a491b/ | jq % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 925 100 925 0 0 23125 0 --:--:-- --:--:-- --:--:-- 23125 { "exception": "NotFoundExc", "reason": "Directory 'b1483f0996e94c0c80fc76e5ef0f760fbe9a491b' not found.", "traceback": "Traceback (most recent call last):\n File \"/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/web/api/apidoc.py\", line 315, in documented_view\n response = f(request, **kwargs)\n File \"/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/web/api/views/vault.py\", line 90, in api_vault_cook_directory\n res = _dispatch_cook_progress(request, 'directory', obj_id)\n File \"/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/web/api/views/vault.py\", line 32, in _dispatch_cook_progress\n .format(object_name, hex_id)))\n File \"/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/web/api/views/utils.py\", line 47, in api_lookup\n raise NotFoundExc(notfound_msg)\nswh.web.common.exc.NotFoundExc: Directory 'b1483f0996e94c0c80fc76e5ef0f760fbe9a491b' not found.\n" } So to be exhaustive in the doc, both cases should be present. |
Build has FAILED
Link to build: https://jenkins.softwareheritage.org/job/DWAPPS/job/cypress-diff/459/
See console output for more information: https://jenkins.softwareheritage.org/job/DWAPPS/job/cypress-diff/459/console
Build is green
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tox/857/ for more details.