Page MenuHomeSoftware Heritage

cli.add_forge_now: Open `schedule-first-visits` with sensible defaults
ClosedPublic

Authored by ardumont on Dec 7 2022, 3:19 PM.

Details

Summary

This should ease scheduling the first visits for add-forge-now request.

The following would be enough to fetch and schedule the forge just listed (be it in
production or staging):

swh scheduler add-forge-now \
  schedule-first-visits \
    --visit-type git \
    (--visit-type svn \ # if a lister lists multiple kinds of visit, we can mention it )
    --lister-name gitea \
    --lister-instance-name git.afpy.org \
    ( --production | --staging )  # to list only enabled | disabled origins

Future diffs will add other subcommand to that new module.

Related to https://gitlab.softwareheritage.org/infra/sysadm-environment/-/issues/4674

Test Plan

Common function extracted and tests added

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

Build is green

Patch application report for D8936 (id=32202)

Rebasing onto e2878b5f65...

Current branch diff-target is up to date.
Changes applied before test
commit 41163465a998d9b57e0f9fee2231745cfa4a9dbc
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Dec 7 15:14:32 2022 +0100

    cli.origin: Open `swh scheduler add-forge-now` with sensible defaults
    
    Related to https://gitlab.softwareheritage.org/infra/sysadm-environment/-/issues/4674

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

ardumont retitled this revision from cli.origin: Open `swh scheduler add-forge-now` with sensible defaults to cli.add_forge_now: Open `schedule-first-visits` with sensible defaultsg.Dec 7 2022, 4:15 PM
ardumont edited the summary of this revision. (Show Details)

Adapt according to irc sysadm discussion

ardumont retitled this revision from cli.add_forge_now: Open `schedule-first-visits` with sensible defaultsg to cli.add_forge_now: Open `schedule-first-visits` with sensible defaults.

Build is green

Patch application report for D8936 (id=32208)

Rebasing onto e2878b5f65...

Current branch diff-target is up to date.
Changes applied before test
commit 40b1fb9daf2df4706b96bcffbce91b10ba9bc39f
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Dec 7 15:14:32 2022 +0100

    cli.add_forge_now: Open `schedule-first-visits` with sensible defaults
    
    This should ease scheduling the first visits for add-forge-now request.
    
    The following would be enough to fetch and schedule the forge just listed (be it in
    production or staging):
swh scheduler add-forge-now \
  schedule-first-visits \
    --visit-type git \
    (--visit-type svn \ # if a lister lists multiple kinds of visit, we can mention it )
    --lister-name gitea \
    --lister-instance-name git.afpy.org \
    ( --production | --staging )  # to list only enabled | disabled origins
```

Related to https://gitlab.softwareheritage.org/infra/sysadm-environment/-/issues/4674
See https://jenkins.softwareheritage.org/job/DSCH/job/tests-on-diff/579/ for more details.
olasd added a subscriber: olasd.

A couple of suggestions inline, but lgtm otherwise, thanks!

swh/scheduler/tests/test_cli_add_forge_now.py
59
63
This revision is now accepted and ready to land.Dec 7 2022, 4:38 PM

d'oh at your suggestions, you're totally right!

Adapt according to suggestion

Build is green

Patch application report for D8936 (id=32211)

Rebasing onto e2878b5f65...

Current branch diff-target is up to date.
Changes applied before test
commit 1c34e9837faa1b955aa3ec98b8edc85e772f8f53
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Dec 7 15:14:32 2022 +0100

    cli.add_forge_now: Open `schedule-first-visits` with sensible defaults
    
    This should ease scheduling the first visits for add-forge-now request.
    
    The following would be enough to fetch and schedule the forge just listed (be it in
    production or staging):
swh scheduler add-forge-now \
  schedule-first-visits \
    --visit-type git \
    (--visit-type svn \ # if a lister lists multiple kinds of visit, we can mention it )
    --lister-name gitea \
    --lister-instance-name git.afpy.org \
    ( --production | --staging )  # to list only enabled | disabled origins
```

Related to https://gitlab.softwareheritage.org/infra/sysadm-environment/-/issues/4674
See https://jenkins.softwareheritage.org/job/DSCH/job/tests-on-diff/580/ for more details.