Page MenuHomeSoftware Heritage

git.loader: fix failing origin visit update step due to uninitialized internal state variables
ClosedPublic

Authored by ardumont on Apr 15 2020, 10:17 AM.

Details

Summary

Currently, a failure happens for some reason. As some internal state variables
are not initialized (they are in fetch_data but not in __init__), this
makes the get_snapshot method fails because of it. Then that's making the
visit update step fails.

Adding the proper initialization for those variables in the __init__ method
should fix it. That will allow the failed state of the visit to be updated
properly in the storage. Associating an empty snapshot to the failed visit.

This should fix issues like [1]

[1] https://sentry.softwareheritage.org/share/issue/ace9143c0f6244b49b18cca49a5aa809/

Test Plan

tox

Diff Detail

Repository
rDLDG Git loader
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 11850
Build 17976: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 17975: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D3019 (id=10729)

Rebasing onto f4fcae5401...

Current branch diff-target is up to date.
Changes applied before test
commit d6a59370a142d8bbfdc06256e38f13e268a9c156
Author: Antoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com>
Date:   Wed Apr 15 10:15:59 2020 +0200

    git.loader: Initialize internal state in __init__
    
    This should fix issues like [1]
    
    https://sentry.softwareheritage.org/share/issue/ace9143c0f6244b49b18cca49a5aa809/

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

ardumont added a project: Git loader.
ardumont retitled this revision from git.loader: Initialize internal state in __init__ to git.loader: fix failing origin visit update step due to uninitialized internal state variables.
ardumont edited the summary of this revision. (Show Details)

Improve the git commit

Build is green

Patch application report for D3019 (id=10730)

Rebasing onto f4fcae5401...

Current branch diff-target is up to date.
Changes applied before test
commit 81ee46caa91f6c10252e1d7a704af7db05699321
Author: Antoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com>
Date:   Wed Apr 15 10:15:59 2020 +0200

    git.loader: fix failing origin visit update step
    
    due to uninitialized state variables
    
    Currently, a failure happens for some reason. As some internal state variables
    are not initialized (they are in fetch_data but not in __init__), this
    makes the get_snapshot method fails because of it. Then that's making the
    visit update step fails.
    
    Adding the proper initialization for those variables in the __init__ method
    should fix it. That will allow the failed state of the visit to be updated
    properly in the storage. Associating an empty snapshot to the failed visit.
    
    This should fix issues like [1]
    
    https://sentry.softwareheritage.org/share/issue/ace9143c0f6244b49b18cca49a5aa809/

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

anlambert added a subscriber: anlambert.

I got the exact same situation when I updated the mercurial loader to swh-model objects.

This revision is now accepted and ready to land.Apr 15 2020, 11:42 AM