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
Branch
master
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 4269
Build 5639: tox-on-jenkinsJenkins
Build 5638: arc lint + arc unit

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
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
swh/scheduler/cli.py
373–376

runs *

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.

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.