Page MenuHomeSoftware Heritage

api: Specify date formats more precisely
ClosedPublic

Authored by vlorentz on Dec 2 2021, 3:54 PM.

Details

Summary

ie. explicitly mention it when we only output the intersection of
ISO8601 and RFC3339

Mentioning RFC3339 instead of only ISO8601 also improves consistency,
as some fields (revision and release dates) only follow RFC3339.

Depends on D6730.

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 D6731 (id=24454)

Could not rebase; Attempt merge onto 284eec7e75...

Updating 284eec7e..4eb21f79
Fast-forward
 swh/web/api/views/metadata.py    | 4 ++--
 swh/web/api/views/origin.py      | 2 +-
 swh/web/api/views/release.py     | 2 +-
 swh/web/api/views/revision.py    | 5 ++---
 swh/web/tests/api/test_apidoc.py | 9 ++++-----
 5 files changed, 10 insertions(+), 12 deletions(-)
Changes applied before test
commit 4eb21f796e52fb62b3d9686e6edcda4316629fa9
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Dec 2 15:53:25 2021 +0100

    api: Specify date formats more precisely
    
    ie. explicitly mention it when we only output the intersection of
    ISO8601 and RFC3339
    
    Mentioning RFC3339 instead of only ISO8601 also improves consistency,
    as some fields (revision and release dates) only follow RFC3339.

commit 9502510d8092715c96894f7699a6c8c589865d74
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Dec 2 15:50:50 2021 +0100

    api: Fix documentation of the format used for git date fields
    
    They may contain negative UTC offsets, which is allowed by RFC3339,
    but not by ISO8601.

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

This revision is now accepted and ready to land.Dec 2 2021, 4:19 PM