mass_driver.models.repository

Repositories for cloning and patching

Module Contents

Classes

SourcedRepo

A repository as-discovered, pre-cloning, along with any Sourced metadata

ClonedRepo

A repository after it has been successfully cloned, branch configured

Source

Base class for Sources of SourcedRepo, on which to apply patching or scan

Data

BranchName

A git branch name, assumed to exist remotely on the Forge

RepoID

A unique identifier for a repository to process

RepoUrl

A repo’s clone URL, either git@github.com format or local filesystem path

IndexedRepos

A “list” of repositories, but indexed by repo ID (SourcedRepo.repo_id)

IndexedClonedRepos

A “list” of cloned repositories, but indexed by repo ID (ClonedRepo.repo_id)

API

mass_driver.models.repository.BranchName = None

A git branch name, assumed to exist remotely on the Forge

mass_driver.models.repository.RepoID = None

A unique identifier for a repository to process

mass_driver.models.repository.RepoUrl = None

A repo’s clone URL, either git@github.com format or local filesystem path

class mass_driver.models.repository.SourcedRepo[source]

Bases: pydantic.BaseModel

A repository as-discovered, pre-cloning, along with any Sourced metadata

clone_url: mass_driver.models.repository.RepoUrl = None

The ‘git clone’-able URL

repo_id: mass_driver.models.repository.RepoID = None

A unique name for the repo, to identify it against others

upstream_branch: mass_driver.models.repository.BranchName | None = None

A git branch to check out fro mremote, if any (defaults to None = use as-is)

force_pull: bool = False

Pull the given branch before handing it over (useful when reusing repos)

patch_data: dict = None

Arbitrary data dict from Source

class mass_driver.models.repository.ClonedRepo[source]

Bases: mass_driver.models.repository.SourcedRepo

A repository after it has been successfully cloned, branch configured

cloned_path: pydantic.DirectoryPath = None

The filesystem path to the git cloned repo

current_branch: mass_driver.models.repository.BranchName = None

The name of the currently checked out branch

mass_driver.models.repository.IndexedRepos = None

A “list” of repositories, but indexed by repo ID (SourcedRepo.repo_id)

mass_driver.models.repository.IndexedClonedRepos = None

A “list” of cloned repositories, but indexed by repo ID (ClonedRepo.repo_id)

class mass_driver.models.repository.Source[source]

Bases: pydantic.BaseSettings

Base class for Sources of SourcedRepo, on which to apply patching or scan

abstract discover() mass_driver.models.repository.IndexedRepos[source]

Discover a list of repositories

class Config[source]

Configuration of the Source class

underscore_attrs_are_private = True

Ensure that _api is treated private

env_prefix = 'SOURCE_'