mass_driver.commands

The different main commands of the mass-driver tool

Module Contents

Functions

drivers_command

Process the CLI for ‘Drivers’ subcommand

forges_command

Process the CLI for ‘Forges’ subcommand

sources_command

Process the CLI for ‘Sources’ subcommand

plugins_command

Process the CLI for a generic plugin subcommand

run_command

Process the CLI for ‘run’

scanners_command

Process the CLI for ‘scan’

review_pr_command

Review a list of Pull Requests

config_error_exit

Exit in case of bad config models

source_repolist_args

Read the repo from args, if any

read_repolist

Read the repo-list or repo-path arg, if any

maybe_save_outcome

Consider saving the outcome

save_outcome

Save the output to given JSON file handle

needs_run

Check if we need to call the activity_run command = Clone/Mig/Scan step

API

mass_driver.commands.drivers_command(args: argparse.Namespace)[source]

Process the CLI for ‘Drivers’ subcommand

mass_driver.commands.forges_command(args: argparse.Namespace)[source]

Process the CLI for ‘Forges’ subcommand

mass_driver.commands.sources_command(args: argparse.Namespace)[source]

Process the CLI for ‘Sources’ subcommand

mass_driver.commands.plugins_command(args: argparse.Namespace, plugin: str, entrypoint: Callable, discover: Callable)[source]

Process the CLI for a generic plugin subcommand

mass_driver.commands.run_command(args: argparse.Namespace) mass_driver.models.activity.ActivityOutcome[source]

Process the CLI for ‘run’

mass_driver.commands.scanners_command(args: argparse.Namespace)[source]

Process the CLI for ‘scan’

mass_driver.commands.review_pr_command(args: argparse.Namespace)[source]

Review a list of Pull Requests

mass_driver.commands.config_error_exit(e: pydantic.ValidationError)[source]

Exit in case of bad config models

mass_driver.commands.source_repolist_args(args) Optional[mass_driver.models.repository.IndexedRepos][source]

Read the repo from args, if any

mass_driver.commands.read_repolist(args) Optional[list[str]][source]

Read the repo-list or repo-path arg, if any

mass_driver.commands.maybe_save_outcome(args: argparse.Namespace, outcome: mass_driver.models.activity.ActivityOutcome)[source]

Consider saving the outcome

mass_driver.commands.save_outcome(outcome: mass_driver.models.activity.ActivityOutcome, out_file)[source]

Save the output to given JSON file handle

mass_driver.commands.needs_run(activity: mass_driver.models.activity.ActivityLoaded) bool[source]

Check if we need to call the activity_run command = Clone/Mig/Scan step

We usually do if: migration OR scan OR forge with git_push_first=True

Last one because git_push requires resolving ssh clone url to local repo path which is what clone step does in activity_run