Page MenuHomeSoftware Heritage

tasks: Simplify implementation and add tests for listed origins
ClosedPublic

Authored by anlambert on Apr 27 2022, 3:33 PM.

Details

Summary

Recent changes in swh-scheduler add new parameters to the celery tasks
produced from swh.scheduler.model.ListedOrigin instances.

So ensure to handle any new parameters by not hardcoding the expected
ones in task signatures.

Remove unsafe use of unnamed task parameters.

Add new tests checking task parameters produced from ListedOrigin
instances do no raise error when attempting to create a bzr loader.

Related to T4187

Diff Detail

Repository
rDLDBZR BZR loader
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 D7700 (id=27830)

Rebasing onto 2e9c4acf48...

Current branch diff-target is up to date.
Changes applied before test
commit a188e21a89e39bcb2fb1413fb7ac8e3f3538158a
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Apr 27 15:31:56 2022 +0200

    tasks: Simplify implementation and add tests for listed origins
    
    Recent changes in swh-scheduler add new parameters to the celery tasks
    produced from swh.scheduler.model.ListedOrigin instances.
    
    So ensure to handle any new parameters by not hardcoding the expected
    ones in task signatures.
    
    Remove unsafe use of unnamed task parameters.
    
    Add new tests checking task parameters produced from ListedOrigin
    instances do no raise error when attempting to create a bzr loader.
    
    Related to T4187

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

ardumont added a subscriber: ardumont.

I think those similar diffs can be pushed directly once jenkins agrees they build fine.

This revision is now accepted and ready to land.Apr 27 2022, 4:04 PM

I think those similar diffs can be pushed directly once jenkins agrees they build fine.

Only swh-loader-core remains to be processed for the package loader tasks but should be simpler than VCS ones,
I will handle all tasks simplification and tests for listed origins in a single commit.