CodeownersBatcher (autotransform.batcher.codeowners)

The implementation for the CodeownersBatcher.

class autotransform.batcher.codeowners.CodeownersBatcher(*, codeowners_location: str, prefix: str, max_batch_size: int | None = None, metadata: Dict[str, Any] | None = None)

Bases: Batcher

A batcher which uses Github CODEOWNERS files to separate changes by owner. Titles will be of the form ‘prefix <owner>’

codeowners_location

The location of the CODEOWNERS file.

Type:

str

prefix

The prefix to use for titles.

Type:

str

max_batch_size

The maximum size of any batch. If None, then batches will have no max size. Defaults to None.

Type:

Optional[int]

metadata

The metadata to associate with Batches. Defaults to None.

Type:

Optional[Dict[str, Any]], optional

name

The name of the Component.

Type:

ClassVar[BatcherName]

batch(items: Sequence[Item]) List[Batch]

Take filtered Items and batch them based on CODEOWNERS.

Parameters:

items (Sequence[Item]) – The filtered Items to separate.

Returns:

A list of Batches representing all items owned by a given

owner.

Return type:

List[Batch]

codeowners_location: str
max_batch_size: int | None
metadata: Dict[str, Any] | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: ClassVar[BatcherName] = 'codeowners'
prefix: str