Page MenuHomeSoftware Heritage

maven: Fix last update datetime
ClosedPublic

Authored by ardumont on Feb 9 2022, 5:01 PM.

Details

Summary

We need to avoid using naive datetime as this fails during conversion.

Related to T3746
Related to P1280

Test Plan

tox

and docker run complete with this

swh@60d6fea3afe1:/$ swh lister run -l maven url=https://repo1.maven.org/maven2/ index_url=http://swh-lister-maven-nginx/export.fld
INFO:swh.lister.maven.lister:Downloading text index from http://swh-lister-maven-nginx/export.fld.
INFO:swh.lister.maven.lister:Found 2 poms.
INFO:swh.lister.maven.lister:Fetching poms..
INFO:swh.lister.maven.lister:Fetching URL https://repo1.maven.org/maven2/al/aldi/sprova4j/0.1.0/sprova4j-0.1.0.pom with params {}
INFO:swh.lister.maven.lister:Fetching URL https://repo1.maven.org/maven2/al/aldi/sprova4j/0.1.1/sprova4j-0.1.1.pom with params {}

whereas it crashed without it (see paste in the diff description).

Diff Detail

Repository
rDLS Listers
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 D7139 (id=25876)

Rebasing onto d4e1e8212a...

Current branch diff-target is up to date.
Changes applied before test
commit 7ff13903783a29dd0baf46a642afb7f4a9bece6b
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Feb 9 16:59:40 2022 +0100

    maven: Fix last update datetime
    
    We need to avoid using naive datetime as this fails during conversion.
    
    Related to T3746
    Related to P1280

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

swh/lister/maven/lister.py
307

It was there already but the usage was missed for the last update below.

ardumont edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Feb 9 2022, 5:06 PM
This revision was automatically updated to reflect the committed changes.