mass_driver.models.migration

Migration definitions, as map of PatchDriver over Sequence of Repos

Module Contents

Classes

MigrationFile

The config file describing a migration, as transcribed before driver lookup

MigrationLoaded

A Migration configuration, once the driver is loaded with its config

ForgeFile

The config file describing a forge, before we load the Forge class

ForgeLoaded

The config file describing a forge, once the Forge class is loaded

SourceConfigFile

The config file describing a discovery event, as transcribed before Source lookup

SourceConfigLoaded

A Source configuration, once the Source is loaded with its config

Functions

load_migration

Load up a TOML config of a migration into memory

driver_from_config

Create PatchDriver instance from config file (TOML)

load_driver

Look up driver and validate configuration (de-opaquify)

load_forge_toml

Load up a TOML config of a forge into memory

forge_from_config

Create Forge instance from config file (TOML)

load_forge

Look up driver and validate configuration (de-opaquify)

load_sourceconfig

Load up a TOML config of a migration into memory

source_from_config

Create Source instance from config file (TOML)

load_source

Look up source and validate configuration (de-opaquify)

Data

TOML_PROJECTKEY

API

mass_driver.models.migration.TOML_PROJECTKEY = 'mass-driver'
class mass_driver.models.migration.MigrationFile[source]

Bases: pydantic.BaseModel

The config file describing a migration, as transcribed before driver lookup

commit_message: str = None

The git commit message body to use when committing the migration

commit_author_name: str | None = None

Override the default (global) git commit author name

commit_author_email: str | None = None

Override the default (global) git commit author email

branch_name: str | None = None

The branch name, if any, to use when committing the PatchDriver

driver_name: str = None

The plugin-name of the PatchDriver to use, via plugin discovery

driver_config: dict = None

The (opaque) configuration of the PatchDriver. Validated once driver loaded

class mass_driver.models.migration.MigrationLoaded[source]

Bases: mass_driver.models.migration.MigrationFile

A Migration configuration, once the driver is loaded with its config

driver: mass_driver.models.patchdriver.PatchDriver = None

Driver loaded (with validated configuration)

classmethod from_config(config_toml: str)[source]

Get a loaded migration from config contents

mass_driver.models.migration.load_migration(migration_config: str) mass_driver.models.migration.MigrationFile[source]

Load up a TOML config of a migration into memory

mass_driver.models.migration.driver_from_config(config: mass_driver.models.migration.MigrationFile) mass_driver.models.patchdriver.PatchDriver[source]

Create PatchDriver instance from config file (TOML)

mass_driver.models.migration.load_driver(config: mass_driver.models.migration.MigrationFile) mass_driver.models.migration.MigrationLoaded[source]

Look up driver and validate configuration (de-opaquify)

class mass_driver.models.migration.ForgeFile[source]

Bases: pydantic.BaseModel

The config file describing a forge, before we load the Forge class

base_branch: mass_driver.models.forge.BranchName | None = None

The base branch from which to create PR from (e.g. master or main)

head_branch: mass_driver.models.forge.BranchName = None

The head branch from which to create PR from (e.g. bugfix1)

git_push_first: bool = True

Do we need to push that branch before forging a PR?

interactive_pause_every: int | None = None

How many forge action before pausing interactively, wait for OK (rate-limit)

draft_pr: bool = None

Is the PR to be created a Draft?

pr_title: str = None

The title of the PR to create

pr_body: str = None

The body of the PR to create (multiline)

forge_name: str = None

The name of the forge to create PRs with, as plugin name

forge_config: dict = None

Forge config vars. Overrides FORGE_ envvars: use for non-secrets

class mass_driver.models.migration.ForgeLoaded[source]

Bases: mass_driver.models.migration.ForgeFile

The config file describing a forge, once the Forge class is loaded

forge: mass_driver.models.forge.Forge = None

Forge loaded (with validated configuration)

classmethod from_config(config_toml: str)[source]

Get a loaded forge from config contents

mass_driver.models.migration.load_forge_toml(forge_config: str) mass_driver.models.migration.ForgeFile[source]

Load up a TOML config of a forge into memory

mass_driver.models.migration.forge_from_config(config: mass_driver.models.migration.ForgeFile) mass_driver.models.migration.ForgeLoaded[source]

Create Forge instance from config file (TOML)

mass_driver.models.migration.load_forge(config: str) mass_driver.models.migration.ForgeLoaded[source]

Look up driver and validate configuration (de-opaquify)

class mass_driver.models.migration.SourceConfigFile[source]

Bases: pydantic.BaseModel

The config file describing a discovery event, as transcribed before Source lookup

source_name: str = None

The plugin-name of the Source to use, via plugin discovery

source_config: dict = None

The (opaque) configuration of the Source. Validated once source loaded

class mass_driver.models.migration.SourceConfigLoaded[source]

Bases: mass_driver.models.migration.SourceConfigFile

A Source configuration, once the Source is loaded with its config

source: mass_driver.models.repository.Source = None

Loaded Source (with validated configuration)

classmethod from_config(config_toml: str)[source]

Get a loaded sourceconfig from config contents

mass_driver.models.migration.load_sourceconfig(source_config: str) mass_driver.models.migration.SourceConfigFile[source]

Load up a TOML config of a migration into memory

mass_driver.models.migration.source_from_config(config: mass_driver.models.migration.SourceConfigFile) mass_driver.models.repository.Source[source]

Create Source instance from config file (TOML)

mass_driver.models.migration.load_source(config: mass_driver.models.migration.SourceConfigFile) mass_driver.models.migration.SourceConfigLoaded[source]

Look up source and validate configuration (de-opaquify)