Page MenuHomeSoftware Heritage

cli: add a --runs option to 'swh-scheduler task list' tool
ClosedPublic

Authored by douardda on Feb 15 2019, 5:11 PM.

Details

Summary

this options allws to list task runs for selected tasks.

Diff Detail

Repository
rDSCH Scheduling utilities
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vlorentz added a subscriber: vlorentz.

The new API endpoints don't have tests.

(And we should probably write tests for the CLI at some point, it's getting complex.)

swh/scheduler/backend.py
463–466

duplicate (it's funny that flake8 didn't catch this)

476

Why a dict?

486–487

Rename to get_task_runs_from_backend?

489–492

same

502

same

swh/scheduler/cli.py
340–341

help='Also list past executions of each task.'

372–375

I'm not a huge fan of using the name run both for the boolean option and for storing the dictionary.

This revision now requires changes to proceed.Feb 15 2019, 6:06 PM
swh/scheduler/cli.py
372–375

runs *

douardda added inline comments.
swh/scheduler/backend.py
463–466

yep, it's weird...

476

indeed, should be an empty list/tuple here. thx

swh/scheduler/cli.py
372–375

I generally agree with that, but in some cases (like here), I see no real harm in doing so. The boolean value of runs remains valid all the way along, and finding a variable name is way too hard :-)

(And we should probably write tests for the CLI at some point, it's getting complex.)

IIRC, @zack added some to swh.model.cli
That might be a starting point.

add tests... and consequently fix the client part of the new backend method

This revision is now accepted and ready to land.Feb 20 2019, 10:28 AM
This revision was automatically updated to reflect the committed changes.