Page MenuHomeSoftware Heritage

model: Raise error on naive datetimes.
ClosedPublic

Authored by vlorentz on Aug 14 2020, 2:13 PM.

Details

Summary

We may unknowingly pass naive datetimes to the storage through them,
causing the underlying DB to assign them a timezone that might not match
the actual one.

It already happens in swh.model and swh.loader.package tests.

Diff Detail

Repository
rDMOD Data model
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 14575
Build 22448: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 22447: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D3793 (id=13312)

Rebasing onto d1db7b9954...

Current branch diff-target is up to date.
Changes applied before test
commit 6dd6acecc8297f8c9f77bdae0ccd291ceabdfd8e
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Aug 14 14:12:29 2020 +0200

    model: Raise error on naive datetimes.
    
    We may unknowingly pass naive datetimes to the storage through them,
    causing the underlying DB to assign them a timezone that might not match
    the actual one.
    
    It already happens in swh.model and swh.loader.package tests.

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

anlambert added a subscriber: anlambert.

Indeed, it seems a good idea to restrict naive dates.

This revision is now accepted and ready to land.Aug 14 2020, 3:01 PM
This revision was automatically updated to reflect the committed changes.