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

douardda created this revision.Feb 15 2019, 5:11 PM
vlorentz requested changes to this revision.Feb 15 2019, 6:06 PM
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
464–467

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

477

Why a dict?

487–488

Rename to get_task_runs_from_backend?

490–493

same

503

same

swh/scheduler/cli.py
341–342

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

373–376

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
vlorentz added inline comments.Feb 15 2019, 6:06 PM
swh/scheduler/cli.py
373–376

runs *

douardda marked 3 inline comments as done.Feb 19 2019, 9:55 AM
douardda added inline comments.
swh/scheduler/backend.py
464–467

yep, it's weird...

477

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

swh/scheduler/cli.py
373–376

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.

douardda updated this revision to Diff 3637.Feb 20 2019, 10:22 AM

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

vlorentz accepted this revision.Feb 20 2019, 10:28 AM
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.