repository-service-tuf / repository-service-tuf-worker

Repository Service for TUF: Worker
MIT License
8 stars 15 forks source link

Force UTC timezone for all datetime objects #481

Closed MVrachev closed 2 months ago

MVrachev commented 3 months ago

The specification defines datetime as UTC time zone: https://theupdateframework.github.io/specification/latest/#file-formats-date-time The python-tuf project updated all their datetime objects, so it's time we do it now as well. I updated everywhere to replace datetime.utc() to datetime.now(timezone.utc) as datetime.utc() is documented for deprecation and is officially deprecated from python 12: https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow Also, I added to all datetime.now() calls the argument timezone.utc to make sure that we are consistent with python-tuf as python-tuf did that change as well: https://github.com/theupdateframework/python-tuf/pull/2573

Signed-off-by: Martin Vrachev martin.vrachev@broadcom.com

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (714a29d) to head (915a232). Report is 15 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #481 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 15 15 Lines 1071 1125 +54 ========================================= + Hits 1071 1125 +54 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.