Page MenuHomeSoftware Heritage

Add an 'swh-scheduler task schedule_origins' command to run a task on all origins.
ClosedPublic

Authored by vlorentz on Feb 26 2019, 2:21 PM.

Details

Summary

Depends on D1195
Resolves T1536

Note: schedule_origin_batches is copied verbatim from swh-indexer, I'm going to open a new diff in the indexer to deduplicate this code.

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 added a subscriber: douardda.
douardda added inline comments.
swh/scheduler/cli.py
350

nitpicking: the --no-dry-run is useless, IMHO. But it's already like this in other subcommands, so meh.

357

Please add a bit more doc in there. What value is expected for type? What are options arguments for? Maybe an example might be handy?

swh/scheduler/cli_utils.py
72

itertools.islice?

swh/scheduler/tests/test_cli.py
613

maybe strip the logging statements from the expectations in the test? I really don't like a test to fail because logging has been added/removed/modifed.

This revision now requires changes to proceed.Mar 8 2019, 11:52 AM
  • Rebase
  • Add a 'task schedule_origins' command to run a task on all origins.
  • Document arguments 'type' and 'options'.
  • itertools
  • Document schedule_task and schedule_origin_metadata_index.
vlorentz added inline comments.
swh/scheduler/cli_utils.py
72

I keep forgetting about this function! Thanks

swh/scheduler/tests/test_cli.py
613

I check against it to make sure there is no other output before Scheduled 3 tasks \(30 origins\). . I agree that's not ideal, but it's better than a silent error/warning.

vlorentz marked an inline comment as done.

rebase

typo + I really think this logging statements should not interfere with the test.

swh/scheduler/cli.py
357

known?

swh/scheduler/tests/test_cli.py
613

I was not suggesting to silence them, just to add a regex to ignore them when asserting

This revision now requires changes to proceed.Mar 14 2019, 11:31 AM
  • fix typo
  • Ignore INFO messages when testing CLI output.
This revision is now accepted and ready to land.Mar 14 2019, 4:32 PM
This revision was automatically updated to reflect the committed changes.