Task models

Models used by debusine tasks.

class debusine.tasks.models.ActionRecordInTaskHistory(*, action: Literal[ActionTypes.RECORD_IN_TASK_HISTORY] = ActionTypes.RECORD_IN_TASK_HISTORY, subject: str | None = None, context: str | None = None)[source]

Bases: BaseTaskDataModel

Action for recording the task run in a task-history collection.

action: Literal[ActionTypes.RECORD_IN_TASK_HISTORY]
context: str | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

subject: str | None
class debusine.tasks.models.ActionRetryWithDelays(*, action: Literal[ActionTypes.RETRY_WITH_DELAYS] = ActionTypes.RETRY_WITH_DELAYS, delays: Annotated[list[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(pattern=re.compile('^([0-9]+)([mhdw])$'))])]], MinLen(min_length=1)])[source]

Bases: BaseTaskDataModel

Action for retrying a work request with delays.

action: Literal[ActionTypes.RETRY_WITH_DELAYS]
delays: Annotated[list[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(pattern=re.compile('^([0-9]+)([mhdw])$'))])]], FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])]
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.ActionSendNotification(*, action: Literal[ActionTypes.SEND_NOTIFICATION] = ActionTypes.SEND_NOTIFICATION, channel: str, data: NotificationDataEmail | None = None)[source]

Bases: BaseTaskDataModel

Action for sending a notification.

action: Literal[ActionTypes.SEND_NOTIFICATION]
channel: str
data: NotificationDataEmail | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.ActionSkipIfLookupResultChanged(*, action: Literal[ActionTypes.SKIP_IF_LOOKUP_RESULT_CHANGED] = ActionTypes.SKIP_IF_LOOKUP_RESULT_CHANGED, lookup: str, collection_item_id: int | None, promise_name: str | None = None)[source]

Bases: BaseTaskDataModel

Action for skipping a work request if a lookup result changed.

action: Literal[ActionTypes.SKIP_IF_LOOKUP_RESULT_CHANGED]
collection_item_id: int | None
lookup: str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

promise_name: str | None
class debusine.tasks.models.ActionTypes(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Possible values for EventReaction actions.

RECORD_IN_TASK_HISTORY = 'record-in-task-history'
RETRY_WITH_DELAYS = 'retry-with-delays'
SEND_NOTIFICATION = 'send-notification'
SKIP_IF_LOOKUP_RESULT_CHANGED = 'skip-if-lookup-result-changed'
UPDATE_COLLECTION_WITH_ARTIFACTS = 'update-collection-with-artifacts'
UPDATE_COLLECTION_WITH_DATA = 'update-collection-with-data'
class debusine.tasks.models.ActionUpdateCollectionWithArtifacts(*, action: Literal[ActionTypes.UPDATE_COLLECTION_WITH_ARTIFACTS] = ActionTypes.UPDATE_COLLECTION_WITH_ARTIFACTS, collection: int | str, name_template: str | None = None, variables: dict[str, Any] | None = None, artifact_filters: dict[str, Any], created_at: datetime | None = None)[source]

Bases: BaseTaskDataModel

Action for updating a collection with artifacts.

action: Literal[ActionTypes.UPDATE_COLLECTION_WITH_ARTIFACTS]
artifact_filters: dict[str, Any]
collection: int | str
created_at: datetime | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

name_template: str | None
variables: dict[str, Any] | None
class debusine.tasks.models.ActionUpdateCollectionWithData(*, action: Literal[ActionTypes.UPDATE_COLLECTION_WITH_DATA] = ActionTypes.UPDATE_COLLECTION_WITH_DATA, collection: int | str, category: BareDataCategory, name_template: str | None = None, data: dict[str, Any] | None = None, created_at: datetime | None = None)[source]

Bases: BaseTaskDataModel

Action for updating a collection with bare data.

action: Literal[ActionTypes.UPDATE_COLLECTION_WITH_DATA]
category: BareDataCategory
collection: int | str
created_at: datetime | None
data: dict[str, Any] | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

name_template: str | None
class debusine.tasks.models.ArtifactInfo(*, label: str, artifact_id: int, category: ArtifactCategory, data: ArtifactData, lookup: int | str)[source]

Bases: InputArtifactSingle

Information about an artifact.

artifact_id: int

Artifact ID

category: ArtifactCategory

Artifact category

data: ArtifactData

Artifact data

property id: int

Compatibility alias for artifact_id.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'validate_assignment': True}

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

class debusine.tasks.models.AssembleSignedSourceData(*, task_configuration: int | str | None = 'default@debusine:task-configuration', backend: BackendType = BackendType.AUTO, environment: int | str, build_architecture: str | None = None, template: int | str, signed: LookupMultiple)[source]

Bases: BaseTaskDataWithExecutor

In-memory task data for the AssembleSignedSource task.

classmethod backend_is_auto(backend: str) str[source]

Ensure that the backend is “auto”.

environment: int | str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

signed: LookupMultiple
template: int | str
class debusine.tasks.models.AssembleSignedSourceDynamicData(*, parameter_summary: str | None = None, subject: str | None = None, runtime_context: str | None = None, configuration_context: str | None = None, task_input_fields: dict[str, ~typing.Any] = <factory>, environment_id: int, template_id: int, signed_ids: list[int])[source]

Bases: BaseDynamicTaskDataWithExecutor

Dynamic data for the AssembleSignedSource task.

environment_id: int
get_input_artifacts_ids() list[int][source]

Return the list of input artifact IDs used by this task.

This is used by views to show what artifacts were used by a task.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

signed_ids: list[int]
template_id: int
class debusine.tasks.models.AutopkgtestData(*, task_configuration: int | str | None = 'default@debusine:task-configuration', extra_repositories: list[~debusine.tasks.models.ExtraDebusineRepository | ~debusine.tasks.models.ExtraExternalRepository] | None = None, backend: ~debusine.tasks.models.BackendType = BackendType.AUTO, environment: int | str, build_architecture: str, input: ~debusine.tasks.models.AutopkgtestInput, include_tests: list[str] = <factory>, exclude_tests: list[str] = <factory>, debug_level: ~typing.Annotated[int, ~annotated_types.Ge(ge=0), ~annotated_types.Le(le=3)] = 0, use_packages_from_base_repository: bool = False, extra_environment: dict[str, str] = <factory>, needs_internet: ~debusine.tasks.models.AutopkgtestNeedsInternet = AutopkgtestNeedsInternet.RUN, fail_on: ~debusine.tasks.models.AutopkgtestFailOn = <factory>, timeout: ~debusine.tasks.models.AutopkgtestTimeout | None = None)[source]

Bases: BaseTaskDataWithExecutor, BaseTaskDataWithExtraRepositories

In memory task data for the Autopkgtest task.

build_architecture: str
debug_level: Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=3)])]
environment: int | str
exclude_tests: list[str]
extra_environment: dict[str, str]
fail_on: AutopkgtestFailOn
include_tests: list[str]
input: AutopkgtestInput
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

needs_internet: AutopkgtestNeedsInternet
timeout: AutopkgtestTimeout | None
use_packages_from_base_repository: bool
class debusine.tasks.models.AutopkgtestDynamicData(*, parameter_summary: str | None = None, subject: str | None = None, runtime_context: str | None = None, configuration_context: str | None = None, task_input_fields: dict[str, ~typing.Any] = <factory>, extra_repositories: list[~debusine.tasks.models.ExtraExternalRepository] | None = None, environment_id: int, input_source_artifact_id: int, input_binary_artifacts_ids: list[int], input_context_artifacts_ids: list[int] = <factory>)[source]

Bases: BaseDynamicTaskDataWithExecutor, BaseDynamicTaskDataWithExtraRepositories

Dynamic data for the Autopkgtest task.

environment_id: int
get_input_artifacts_ids() list[int][source]

Return the list of input artifact IDs used by this task.

This is used by views to show what artifacts were used by a task.

get_source_package_name() str | None[source]

Extract the source package name.

Returns:

the source package name, if applicable, and None otherwise.

input_binary_artifacts_ids: list[int]
input_context_artifacts_ids: list[int]
input_source_artifact_id: int
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.AutopkgtestFailOn(*, failed_test: bool = True, flaky_test: bool = False, skipped_test: bool = False)[source]

Bases: BaseTaskDataModel

Possible values for fail_on.

failed_test: bool
flaky_test: bool
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

skipped_test: bool
class debusine.tasks.models.AutopkgtestInput(*, source_artifact: int | str, binary_artifacts: ~debusine.tasks.models.LookupMultiple, context_artifacts: ~debusine.tasks.models.LookupMultiple = <factory>)[source]

Bases: BaseTaskDataModel

Input for an autopkgtest task.

binary_artifacts: LookupMultiple
context_artifacts: LookupMultiple
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

source_artifact: int | str
class debusine.tasks.models.AutopkgtestNeedsInternet(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Possible values for needs_internet.

RUN = 'run'
SKIP = 'skip'
TRY = 'try'
class debusine.tasks.models.AutopkgtestTimeout(*, global_: Annotated[int | None, Ge(ge=0)] = None, factor: Annotated[int | None, Ge(ge=0)] = None, short: Annotated[int | None, Ge(ge=0)] = None, install: Annotated[int | None, Ge(ge=0)] = None, test: Annotated[int | None, Ge(ge=0)] = None, copy: Annotated[int | None, Ge(ge=0)] = None)[source]

Bases: BaseTaskDataModel

Timeout specifications for an autopkgtest task.

copy_: Annotated[int | None, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0)])]
factor: Annotated[int | None, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0)])]
global_: Annotated[int | None, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0)])]
install: Annotated[int | None, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0)])]
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

short: Annotated[int | None, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0)])]
test: Annotated[int | None, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0)])]
class debusine.tasks.models.BackendType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Possible values for backend.

AUTO = 'auto'
INCUS_LXC = 'incus-lxc'
INCUS_VM = 'incus-vm'
QEMU = 'qemu'
UNSHARE = 'unshare'
class debusine.tasks.models.BaseDynamicTaskData(*, parameter_summary: str | None = None, subject: str | None = None, runtime_context: str | None = None, configuration_context: str | None = None, task_input_fields: dict[str, ~typing.Any] = <factory>)[source]

Bases: BaseTaskDataModel

Base class for dynamic task data.

This is computed by the scheduler when dispatching a task to a worker. It may involve resolving artifact lookups.

configuration_context: str | None
get_input_artifacts_ids() list[int][source]

Return the list of input artifact IDs used by this task.

This is used by views to show what artifacts were used by a task.

get_source_package_name() str | None[source]

Extract the source package name.

Returns:

the source package name, if applicable, and None otherwise.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

parameter_summary: str | None

Brief human-readable summary of the most important parameters to this work request.

runtime_context: str | None

An abstract string value representing the runtime context in which the task is executed, for the purpose of recording statistics. It is meant to represent some of the task parameters that can significantly alter the runtime behaviour of the task.

subject: str | None

An abstract string value representing the subject of the task, for the purpose of recording statistics. It is meant to group possible inputs into groups that we expect to behave similarly.

task_input_fields: dict[str, Any]

Storage for resolved task input fields

class debusine.tasks.models.BaseDynamicTaskDataWithExecutor(*, parameter_summary: str | None = None, subject: str | None = None, runtime_context: str | None = None, configuration_context: str | None = None, task_input_fields: dict[str, ~typing.Any] = <factory>, environment_id: int | None = None)[source]

Bases: BaseDynamicTaskData

Dynamic task data for executors.

environment_id: int | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.BaseDynamicTaskDataWithExtraRepositories(*, parameter_summary: str | None = None, subject: str | None = None, runtime_context: str | None = None, configuration_context: str | None = None, task_input_fields: dict[str, ~typing.Any] = <factory>, extra_repositories: list[~debusine.tasks.models.ExtraExternalRepository] | None = None)[source]

Bases: BaseDynamicTaskData

Dynamic task data for extra repositories.

extra_repositories: list[ExtraExternalRepository] | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.BaseExtraRepository(*, components: list[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(pattern='^(\\w|-)+$')])]] | None = None)[source]

Bases: BaseTaskDataModel, ABC

Generic extra repositories for Debian tasks.

components: list[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(pattern='^(\\w|-)+$')])]] | None
classmethod convert_empty_components_to_none(value: list[str] | None) list[str] | None[source]

Rewrite an empty components list to None.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.BaseInputArtifactSingle(*, label: str, artifact_id: int | None = None, category: ArtifactCategory | None = None, data: ArtifactData | None = None, lookup: int | str)[source]

Bases: BaseTaskInputArtifact, BaseLabeledTaskInput

Single task input artifact.

lookup: int | str

Lookup used to obtain the artifact. Usually from the task data but could be generated by the task logic.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'validate_assignment': True}

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

class debusine.tasks.models.BaseLabeledTaskInput(*, label: str)[source]

Bases: BaseTaskInput

Task input annotated with a task data field name.

label: str

the task data label.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'validate_assignment': True}

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

class debusine.tasks.models.BaseTaskData(*, task_configuration: int | str | None = 'default@debusine:task-configuration')[source]

Bases: BaseTaskDataModel

Base class for task data.

Task data is encoded as JSON in the database and in the API, and it is modeled as a pydantic data structure in memory for both ease of access and validation.

DEFAULT_TASK_CONFIGURATION_LOOKUP: ClassVar[str] = 'default@debusine:task-configuration'
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

task_configuration: int | str | None

debusine:task-configuration collection to use to configure the task. This is resolved to an ID when configuration is applied

class debusine.tasks.models.BaseTaskDataModel[source]

Bases: BaseModel

Stricter pydantic defaults for task data models.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

model_dump(**kwargs: Any) dict[str, Any][source]

Use aliases by default when serializing.

class debusine.tasks.models.BaseTaskDataWithExecutor(*, task_configuration: int | str | None = 'default@debusine:task-configuration', backend: BackendType = BackendType.AUTO, environment: int | str | None = None, build_architecture: str | None = None)[source]

Bases: BaseTaskData

Base task data with fields used to configure executors.

backend: BackendType
build_architecture: str | None
environment: int | str | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.BaseTaskDataWithExtraRepositories(*, task_configuration: int | str | None = 'default@debusine:task-configuration', extra_repositories: list[ExtraDebusineRepository | ExtraExternalRepository] | None = None)[source]

Bases: BaseTaskData

Base task data with fields used to configure extra_repositories.

extra_repositories: list[ExtraDebusineRepository | ExtraExternalRepository] | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.BaseTaskInput[source]

Bases: BaseModel

Base for structures defining task input artifacts and collections.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'validate_assignment': True}

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

class debusine.tasks.models.BaseTaskInputArtifact(*, artifact_id: int | None = None, category: ArtifactCategory | None = None, data: ArtifactData | None = None)[source]

Bases: BaseTaskInput

Represent an artifact as task input.

artifact_id: int | None

Artifact ID

category: ArtifactCategory | None

Artifact category

data: ArtifactData | None

Artifact data

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'validate_assignment': True}

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

serialize_data(data: ArtifactData | None) dict[str, Any] | None[source]

Serialize the data field.

class debusine.tasks.models.BlhcData(*, task_configuration: int | str | None = 'default@debusine:task-configuration', backend: ~debusine.tasks.models.BackendType = BackendType.AUTO, environment: int | str, build_architecture: str, input: ~debusine.tasks.models.BlhcInput, extra_flags: list[~debusine.tasks.models.BlhcFlags] = <factory>)[source]

Bases: BaseTaskDataWithExecutor

In memory task data for the Blhc task.

build_architecture: str
environment: int | str
extra_flags: list[BlhcFlags]
input: BlhcInput
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.BlhcDynamicData(*, parameter_summary: str | None = None, subject: str | None = None, runtime_context: str | None = None, configuration_context: str | None = None, task_input_fields: dict[str, ~typing.Any] = <factory>, environment_id: int, input_artifact_id: int, input_artifact_data: ~debusine.artifacts.models.DebianPackageBuildLog | None = None)[source]

Bases: BaseDynamicTaskDataWithExecutor

Dynamic data for the Blhc task.

environment_id: int
get_input_artifacts_ids() list[int][source]

Return the list of input artifact IDs used by this task.

This is used by views to show what artifacts were used by a task.

get_source_package_name() str | None[source]

Extract the source package name.

Returns:

the source package name, if applicable, and None otherwise.

input_artifact_data: DebianPackageBuildLog | None
input_artifact_id: int
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.BlhcFlags(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Possible values for extra_flags.

ALL = '--all'
BINDNOW = '--bindnow'
BUILDD = '--buildd'
COLOR = '--color'
DEBIAN = '--debian'
LINE_NUMBERS = '--line-numbers'
PIE = '--pie'
class debusine.tasks.models.BlhcInput(*, artifact: int | str)[source]

Bases: BaseTaskDataModel

Input for a blhc task.

artifact: int | str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.CollectionItemMatcher(*, kind: CollectionItemMatcherKind, value: Any)[source]

Bases: BaseTaskDataModel

A matcher for collection item name or per-item data fields.

kind: CollectionItemMatcherKind
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'validate_assignment': True}

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

value: Any
class debusine.tasks.models.CollectionItemMatcherKind(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Possible values for CollectionItemMatcher.kind.

CONTAINS = 'contains'
ENDSWITH = 'endswith'
EXACT = 'exact'
STARTSWITH = 'startswith'
class debusine.tasks.models.Confirmation(*, confirmed: bool, comment: str | None = None)[source]

Bases: BaseTaskDataModel

A record that a work request was confirmed or denied by a user.

comment: str | None
confirmed: bool
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.DebDiffData(*, task_configuration: int | str | None = 'default@debusine:task-configuration', backend: ~debusine.tasks.models.BackendType = BackendType.AUTO, environment: int | str, build_architecture: str, input: ~debusine.tasks.models.DebDiffInput, extra_flags: list[~debusine.tasks.models.DebDiffFlags] = <factory>)[source]

Bases: BaseTaskDataWithExecutor

In memory task data for the DebDiff task.

build_architecture: str
environment: int | str
extra_flags: list[DebDiffFlags]
input: DebDiffInput
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.DebDiffDynamicData(*, parameter_summary: str | None = None, subject: str | None = None, runtime_context: str | None = None, configuration_context: str | None = None, task_input_fields: dict[str, ~typing.Any] = <factory>, environment_id: int, input_source_artifacts_ids: ~typing.Annotated[list[int] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, input_binary_artifacts_ids: ~typing.Annotated[list[list[int]] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None)[source]

Bases: BaseDynamicTaskDataWithExecutor

Dynamic data for the DebDiff task.

environment_id: int
get_input_artifacts_ids() list[int][source]

Return the list of input artifact IDs used by this task.

This is used by views to show what artifacts were used by a task.

get_source_package_name() str | None[source]

Extract the source package name.

Returns:

the source package name, if applicable, and None otherwise.

input_binary_artifacts_ids: Annotated[list[list[int]] | None, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=2), MaxLen(max_length=2)])]
input_source_artifacts_ids: Annotated[list[int] | None, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=2), MaxLen(max_length=2)])]
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

validate_source_or_binary_exclusive() Self[source]

Validate mutually exclusive input artifacts.

Ensure input_source_artifacts_ids and input_binary_artifacts_ids are not both set.

class debusine.tasks.models.DebDiffFlags(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Possible values for extra_flags.

DIFFSTAT = '--diffstat'
DIRS = '--dirs'
IGNORE_SPACE = '--ignore-space'
NOCONTROL = '--nocontrol'
PATCHES = '--apply-patches'
SHOW_MOVED = '--show-moved'
WDIFF = '--wdiff-source-control'
class debusine.tasks.models.DebDiffInput(*, source_artifacts: Annotated[list[int | str] | None, MinLen(min_length=2), MaxLen(max_length=2)] = None, binary_artifacts: Annotated[list[LookupMultiple] | None, MinLen(min_length=2), MaxLen(max_length=2)] = None)[source]

Bases: BaseTaskDataModel

Input for a debdiff task.

binary_artifacts: Annotated[list[LookupMultiple] | None, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=2), MaxLen(max_length=2)])]
check_one_of_source_or_binary() Self[source]

Ensure only source or binary artifacts are present.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

source_artifacts: Annotated[list[int | str] | None, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=2), MaxLen(max_length=2)])]
class debusine.tasks.models.DebootstrapBootstrapOptions(*, architecture: str, variant: ~debusine.tasks.models.DebootstrapVariant | None = None, extra_packages: list[str] = <factory>, use_signed_by: bool = True)[source]

Bases: SystemBootstrapOptions

Structure of debootstrap options.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

variant: DebootstrapVariant | None
class debusine.tasks.models.DebootstrapVariant(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Variants supported by debootstrap.

BUILDD = 'buildd'
MINBASE = 'minbase'
class debusine.tasks.models.DiskImage(*, format: DiskImageFormat, filename: str = 'image', kernel_package: str | None = None, bootloader: str | None = None, partitions: Annotated[list[Partition], MinLen(min_length=1)])[source]

Bases: BaseTaskDataModel

Disk image definition.

bootloader: str | None
filename: str
format: DiskImageFormat
kernel_package: str | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

partitions: Annotated[list[Partition], FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])]
class debusine.tasks.models.DiskImageFormat(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Possible disk image formats.

QCOW2 = 'qcow2'
RAW = 'raw'
class debusine.tasks.models.EventReactions(*, on_creation: list[Annotated[ActionSkipIfLookupResultChanged | ActionSendNotification | ActionUpdateCollectionWithArtifacts | ActionUpdateCollectionWithData | ActionRetryWithDelays | ActionRecordInTaskHistory, FieldInfo(annotation=NoneType, required=True, discriminator='action')]] = [], on_unblock: list[Annotated[ActionSkipIfLookupResultChanged | ActionSendNotification | ActionUpdateCollectionWithArtifacts | ActionUpdateCollectionWithData | ActionRetryWithDelays | ActionRecordInTaskHistory, FieldInfo(annotation=NoneType, required=True, discriminator='action')]] = [], on_assignment: list[Annotated[ActionSkipIfLookupResultChanged | ActionSendNotification | ActionUpdateCollectionWithArtifacts | ActionUpdateCollectionWithData | ActionRetryWithDelays | ActionRecordInTaskHistory, FieldInfo(annotation=NoneType, required=True, discriminator='action')]] = [], on_success: list[Annotated[ActionSkipIfLookupResultChanged | ActionSendNotification | ActionUpdateCollectionWithArtifacts | ActionUpdateCollectionWithData | ActionRetryWithDelays | ActionRecordInTaskHistory, FieldInfo(annotation=NoneType, required=True, discriminator='action')]] = [], on_failure: list[Annotated[ActionSkipIfLookupResultChanged | ActionSendNotification | ActionUpdateCollectionWithArtifacts | ActionUpdateCollectionWithData | ActionRetryWithDelays | ActionRecordInTaskHistory, FieldInfo(annotation=NoneType, required=True, discriminator='action')]] = [])[source]

Bases: BaseTaskDataModel

Structure for event reactions.

add_reaction(name: Literal['on_creation', 'on_unblock', 'on_assignment', 'on_success', 'on_failure'], action: Annotated[ActionSkipIfLookupResultChanged | ActionSendNotification | ActionUpdateCollectionWithArtifacts | ActionUpdateCollectionWithData | ActionRetryWithDelays | ActionRecordInTaskHistory, FieldInfo(annotation=NoneType, required=True, discriminator='action')]) None[source]

Add an EventReaction to the named event.

This is a noop if the named event already contains this EventReaction.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

model_dump(**kwargs: Any) dict[str, Any][source]

Wrap pydantic to ensure discriminators are serializers.

on_assignment: list[Annotated[ActionSkipIfLookupResultChanged | ActionSendNotification | ActionUpdateCollectionWithArtifacts | ActionUpdateCollectionWithData | ActionRetryWithDelays | ActionRecordInTaskHistory, FieldInfo(annotation=NoneType, required=True, discriminator='action')]]
on_creation: list[Annotated[ActionSkipIfLookupResultChanged | ActionSendNotification | ActionUpdateCollectionWithArtifacts | ActionUpdateCollectionWithData | ActionRetryWithDelays | ActionRecordInTaskHistory, FieldInfo(annotation=NoneType, required=True, discriminator='action')]]
on_failure: list[Annotated[ActionSkipIfLookupResultChanged | ActionSendNotification | ActionUpdateCollectionWithArtifacts | ActionUpdateCollectionWithData | ActionRetryWithDelays | ActionRecordInTaskHistory, FieldInfo(annotation=NoneType, required=True, discriminator='action')]]
on_success: list[Annotated[ActionSkipIfLookupResultChanged | ActionSendNotification | ActionUpdateCollectionWithArtifacts | ActionUpdateCollectionWithData | ActionRetryWithDelays | ActionRecordInTaskHistory, FieldInfo(annotation=NoneType, required=True, discriminator='action')]]
on_unblock: list[Annotated[ActionSkipIfLookupResultChanged | ActionSendNotification | ActionUpdateCollectionWithArtifacts | ActionUpdateCollectionWithData | ActionRetryWithDelays | ActionRecordInTaskHistory, FieldInfo(annotation=NoneType, required=True, discriminator='action')]]
class debusine.tasks.models.ExtraDebusineRepository(*, components: list[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(pattern='^(\\w|-)+$')])]] | None = None, suite: int | str)[source]

Bases: BaseExtraRepository

An extra Debusine-hosted repository for Debian tasks.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

suite: int | str
class debusine.tasks.models.ExtraExternalRepository(*, components: list[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(pattern='^(\\w|-)+$')])]] | None = None, url: Annotated[AnyUrl, UrlConstraints(max_length=None, allowed_schemes=None, host_required=True, default_host=None, default_port=None, default_path=None)], suite: Annotated[str, _PydanticGeneralMetadata(pattern='^(\\w|[./ -])+$')], signing_key: str | None = None)[source]

Bases: BaseExtraRepository

An extra external repository for Debian tasks.

as_deb822_source(signed_by_filename: str | None = None) str[source]

Render a Deb822 sources.list.d entry.

flat_repository() Self[source]

Check if suite is a flat repository.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

signing_key: str | None
suite: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(pattern='^(\\w|[./ -])+$')])]
url: Annotated[AnyUrl, UrlConstraints(max_length=None, allowed_schemes=None, host_required=True, default_host=None, default_port=None, default_path=None)]
class debusine.tasks.models.ExtractForSigningData(*, task_configuration: int | str | None = 'default@debusine:task-configuration', backend: BackendType = BackendType.AUTO, environment: int | str, build_architecture: str | None = None, input: ExtractForSigningInput)[source]

Bases: BaseTaskDataWithExecutor

In-memory task data for the ExtractForSigning task.

classmethod backend_is_auto(backend: str) str[source]

Ensure that the backend is “auto”.

environment: int | str
input: ExtractForSigningInput
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.ExtractForSigningDynamicData(*, parameter_summary: str | None = None, subject: str | None = None, runtime_context: str | None = None, configuration_context: str | None = None, task_input_fields: dict[str, ~typing.Any] = <factory>, environment_id: int, input_template_artifact_id: int, input_binary_artifacts_ids: list[int])[source]

Bases: BaseDynamicTaskDataWithExecutor

Dynamic data for the ExtractForSigning task.

environment_id: int
get_input_artifacts_ids() list[int][source]

Return the list of input artifact IDs used by this task.

This is used by views to show what artifacts were used by a task.

input_binary_artifacts_ids: list[int]
input_template_artifact_id: int
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.ExtractForSigningInput(*, template_artifact: int | str, binary_artifacts: LookupMultiple)[source]

Bases: BaseTaskDataModel

Input for the ExtractForSigning task.

binary_artifacts: LookupMultiple
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

template_artifact: int | str
class debusine.tasks.models.ImageCacheUsageLog(*, version: int = 1, backends: set[~debusine.tasks.models.BackendType] = <factory>, usage: list[~debusine.tasks.models.ImageCacheUsageLogEntry] = <factory>)[source]

Bases: BaseTaskDataModel

Usage log for cached executor images.

backends: set[BackendType]
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

usage: list[ImageCacheUsageLogEntry]
version: int
classmethod version_is_known(version: int) int[source]

Ensure that the version is known.

class debusine.tasks.models.ImageCacheUsageLogEntry(*, filename: str, backend: BackendType | None = None, timestamp: datetime)[source]

Bases: BaseTaskDataModel

Entry in ImageCacheUsageLog for cached executor images.

backend: BackendType | None
filename: str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

timestamp: datetime
classmethod timestamp_is_aware(timestamp: datetime) datetime[source]

Ensure that the timestamp is TZ-aware.

class debusine.tasks.models.InputArtifactMultiple(*, label: str, lookup: ~debusine.tasks.models.LookupMultiple, artifacts: list[~debusine.tasks.models.BaseTaskInputArtifact] = <factory>)[source]

Bases: BaseLabeledTaskInput

Represent declared multiple input artifacts for a task.

artifacts: list[BaseTaskInputArtifact]

Artifact data if it’s already known

classmethod from_ids(lookup: LookupMultiple, label: str, artifact_ids: Collection[int] | None) Self[source]

Create an InputArtifactMultiple from a list of artifact IDs.

lookup: LookupMultiple

Lookup used to obtain the artifacts.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'validate_assignment': True}

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

resolved_ids() list[int][source]

Return artifact_ids or [].

class debusine.tasks.models.InputArtifactSingle(*, label: str, artifact_id: int | None = None, category: ArtifactCategory | None = None, data: ArtifactData | None = None, lookup: int | str)[source]

Bases: BaseInputArtifactSingle

Represent a declared single input artifact for a task.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'validate_assignment': True}

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

resolved_ids() list[int][source]

Return [artifact_id] or [].

class debusine.tasks.models.InputCollectionSingle(*, label: str, lookup: int | str, collection_id: int, scope_name: str, workspace_name: str, category: CollectionCategory, name: str, data: dict[str, Any])[source]

Bases: BaseLabeledTaskInput

Information about a collection.

category: CollectionCategory

Category of the collection

collection_id: int

Collection ID

data: dict[str, Any]

Collection data

lookup: int | str

Lookup used to obtain the collection

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'validate_assignment': True}

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

name: str

Collection name

scope_name: str

Name of the scope that contains the collection

workspace_name: str

Name of the workspace that contains the collection

class debusine.tasks.models.LintianData(*, task_configuration: int | str | None = 'default@debusine:task-configuration', backend: ~debusine.tasks.models.BackendType = BackendType.AUTO, environment: int | str | None = None, build_architecture: str | None = None, input: ~debusine.tasks.models.LintianInput, output: ~debusine.tasks.models.LintianOutput = <factory>, target_distribution: str = 'debian:unstable', include_tags: list[str] = <factory>, exclude_tags: list[str] = <factory>, fail_on_severity: ~debusine.tasks.models.LintianFailOnSeverity = LintianFailOnSeverity.ERROR)[source]

Bases: BaseTaskDataWithExecutor

In memory task data for the Lintian task.

exclude_tags: list[str]
fail_on_severity: LintianFailOnSeverity
include_tags: list[str]
input: LintianInput
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

output: LintianOutput
target_distribution: str
class debusine.tasks.models.LintianDynamicData(*, parameter_summary: str | None = None, subject: str | None = None, runtime_context: str | None = None, configuration_context: str | None = None, task_input_fields: dict[str, ~typing.Any] = <factory>, environment_id: int | None = None, input_source_artifact_id: int | None = None, input_binary_artifacts_ids: list[int] = <factory>)[source]

Bases: BaseDynamicTaskDataWithExecutor

Dynamic data for the Lintian task.

get_input_artifacts_ids() list[int][source]

Return the list of input artifact IDs used by this task.

This is used by views to show what artifacts were used by a task.

get_source_package_name() str | None[source]

Extract the source package name.

Returns:

the source package name, if applicable, and None otherwise.

input_binary_artifacts_ids: list[int]
input_source_artifact_id: int | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.LintianFailOnSeverity(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Possible values for fail_on_severity.

ERROR = 'error'
EXPERIMENTAL = 'experimental'
INFO = 'info'
NONE = 'none'
OVERRIDDEN = 'overridden'
PEDANTIC = 'pedantic'
WARNING = 'warning'
class debusine.tasks.models.LintianInput(*, source_artifact: int | str | None = None, binary_artifacts: ~debusine.tasks.models.LookupMultiple = <factory>)[source]

Bases: BaseTaskDataModel

Input for a lintian task.

binary_artifacts: LookupMultiple
check_one_of_source_or_binary() Self[source]

Ensure a source or binary artifact is present.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

source_artifact: int | str | None
class debusine.tasks.models.LintianOutput(*, source_analysis: bool = True, binary_all_analysis: bool = True, binary_any_analysis: bool = True)[source]

Bases: BaseTaskDataModel

Output configuration for a Lintian task.

binary_all_analysis: bool
binary_any_analysis: bool
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

source_analysis: bool
class debusine.tasks.models.LookupDict(*, collection: int | str, child_type: LookupChildType = LookupChildType.ARTIFACT, category: str | None = None, name_matcher: CollectionItemMatcher | None = None, data_matchers: tuple[tuple[str, CollectionItemMatcher], ...] = (), lookup_filters: tuple[tuple[str, int | str | LookupMultiple], ...] = ())[source]

Bases: BaseTaskDataModel

Dictionary lookups for collection items.

category: str | None
child_type: LookupChildType
collection: int | str
data_matchers: tuple[tuple[str, CollectionItemMatcher], ...]
export() dict[str, Any][source]

Export the usual input representation of this lookup.

This reverses the transformations applied by normalize_matchers().

lookup_filters: tuple[tuple[str, int | str | LookupMultiple], ...]
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'validate_assignment': True}

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

name_matcher: CollectionItemMatcher | None
classmethod normalize_matchers(data: Any) dict[str, Any][source]

Transform the lookup syntax into a form more convenient for pydantic.

name, name__*, data__KEY, and data__KEY__* keys in values are transformed into CollectionItemMatcher instances stored in name_matcher and data_matchers. lookup__KEY keys are transformed into entries in lookup_filters. Conflicting lookup suffixes are rejected.

class debusine.tasks.models.LookupMultiple(root: RootModelRootType = PydanticUndefined)[source]

Bases: ]]

Lookups resulting in multiple collection items.

export() dict[str, Any] | list[int | str | dict[str, Any]][source]

Export the usual input representation of this lookup.

This reverses the transformations applied by normalize().

model_config: ClassVar[ConfigDict] = {'frozen': True, 'validate_assignment': True}

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

classmethod normalize(data: Any) tuple[Any, ...][source]

Normalize into a tuple of multiple matchers.

class debusine.tasks.models.MakeSourcePackageUploadData(*, task_configuration: int | str | None = 'default@debusine:task-configuration', backend: BackendType = BackendType.AUTO, environment: int | str, build_architecture: str | None = None, input: MakeSourcePackageUploadInput, since_version: str | None = None, target_distribution: str | None = None)[source]

Bases: BaseTaskDataWithExecutor

In memory task data for the MakeSourcePackageUpload task.

environment: int | str
input: MakeSourcePackageUploadInput
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

since_version: str | None
target_distribution: str | None
class debusine.tasks.models.MakeSourcePackageUploadDynamicData(*, parameter_summary: str | None = None, subject: str | None = None, runtime_context: str | None = None, configuration_context: str | None = None, task_input_fields: dict[str, ~typing.Any] = <factory>, environment_id: int, input_source_artifact_id: int)[source]

Bases: BaseDynamicTaskDataWithExecutor

Expanded dynamic data for the MakeSourcePackageUpload task.

environment_id: int
get_input_artifacts_ids() list[int][source]

Return the list of input artifact IDs used by this task.

This is used by views to show what artifacts were used by a task.

get_source_package_name() str | None[source]

Extract the source package name.

Returns:

the source package name, if applicable, and None otherwise.

input_source_artifact_id: int
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.MakeSourcePackageUploadInput(*, source_artifact: int | str)[source]

Bases: BaseTaskDataModel

Input for a MakeSourcePackageUpload task.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

source_artifact: int | str
class debusine.tasks.models.MergeUploadsData(*, task_configuration: int | str | None = 'default@debusine:task-configuration', backend: BackendType = BackendType.AUTO, environment: int | str | None = None, input: MergeUploadsInput)[source]

Bases: BaseTaskData

In memory task data for the MergeUploads task.

backend: BackendType
environment: int | str | None
input: MergeUploadsInput
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.MergeUploadsDynamicData(*, parameter_summary: str | None = None, subject: str | None = None, runtime_context: str | None = None, configuration_context: str | None = None, task_input_fields: dict[str, ~typing.Any] = <factory>, environment_id: int | None = None, input_uploads_ids: list[int])[source]

Bases: BaseDynamicTaskData

Expanded dynamic data for the MergeUploads task.

environment_id: int | None
get_input_artifacts_ids() list[int][source]

Return the list of input artifact IDs used by this task.

This is used by views to show what artifacts were used by a task.

get_source_package_name() str | None[source]

Extract the source package name.

Returns:

the source package name, if applicable, and None otherwise.

input_uploads_ids: list[int]
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.MergeUploadsInput(*, uploads: LookupMultiple)[source]

Bases: BaseTaskDataModel

Input for a MergeUploads task.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

uploads: LookupMultiple
class debusine.tasks.models.MmDebstrapBootstrapOptions(*, architecture: str, variant: ~debusine.tasks.models.MmDebstrapVariant | None = None, extra_packages: list[str] = <factory>, use_signed_by: bool = True)[source]

Bases: SystemBootstrapOptions

Structure of MmDebstrap options.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

use_signed_by: bool
variant: MmDebstrapVariant | None
class debusine.tasks.models.MmDebstrapData(*, task_configuration: int | str | None = 'default@debusine:task-configuration', bootstrap_options: MmDebstrapBootstrapOptions, bootstrap_repositories: Annotated[list[SystemBootstrapRepository], MinLen(min_length=1)], customization_script: str | None = None)[source]

Bases: SystemBootstrapData

In memory task data for the MmDebstrap task.

bootstrap_options: MmDebstrapBootstrapOptions
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.MmDebstrapVariant(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Variants supported by mmdebstrap.

APT = 'apt'
BUILDD = 'buildd'
CUSTOM = 'custom'
DASH = '-'
DEBOOTSTRAP = 'debootstrap'
ESSENTIAL = 'essential'
EXTRACT = 'extract'
IMPORTANT = 'important'
MINBASE = 'minbase'
REQUIRED = 'required'
STANDARD = 'standard'
class debusine.tasks.models.NoopData(*, task_configuration: int | str | None = 'default@debusine:task-configuration', backend: BackendType = BackendType.AUTO, environment: int | str | None = None, build_architecture: str | None = None, result: WorkRequestResults = WorkRequestResults.SUCCESS)[source]

Bases: BaseTaskDataWithExecutor

In memory task data for the Noop task.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

result: WorkRequestResults
class debusine.tasks.models.NotificationDataEmail(*, from_: ~pydantic.networks.EmailStr | None = None, to: list[~pydantic.networks.EmailStr] | None = None, cc: list[~pydantic.networks.EmailStr] = <factory>, subject: str | None = None)[source]

Bases: BaseTaskDataModel

Channel data for email notifications.

cc: list[EmailStr]
from_: EmailStr | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

subject: str | None
to: list[EmailStr] | None
class debusine.tasks.models.OutputData(*, runtime_statistics: RuntimeStatistics | None = None, errors: list[OutputDataError] | None = None, skip_reason: str | None = None, regression_analysis: dict[str, RegressionAnalysis] | None = None, confirmation: Confirmation | None = None)[source]

Bases: BaseTaskDataModel

Data produced when a task is completed.

confirmation: Confirmation | None
errors: list[OutputDataError] | None
merge(other: OutputData) OutputData[source]

Return the combination of two OutputData objects.

Merge all the fields that were explicitly set on each model. If a field is set on both models, the values in other take precedence.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

regression_analysis: dict[str, RegressionAnalysis] | None
runtime_statistics: RuntimeStatistics | None
skip_reason: str | None
class debusine.tasks.models.OutputDataError(*, message: str, code: str)[source]

Bases: BaseTaskDataModel

An error encountered when running a task.

code: str
message: str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.Partition(*, size: int, filesystem: str, mountpoint: str = 'none')[source]

Bases: BaseTaskDataModel

Partition definition.

filesystem: str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

mountpoint: str
size: int
class debusine.tasks.models.PiupartsData(*, task_configuration: int | str | None = 'default@debusine:task-configuration', extra_repositories: list[ExtraDebusineRepository | ExtraExternalRepository] | None = None, backend: BackendType = BackendType.AUTO, environment: int | str, build_architecture: str, input: PiupartsDataInput, base_tgz: int | str)[source]

Bases: BaseTaskDataWithExecutor, BaseTaskDataWithExtraRepositories

In memory task data for the Piuparts task.

base_tgz: int | str
build_architecture: str
environment: int | str
input: PiupartsDataInput
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.PiupartsDataInput(*, binary_artifacts: LookupMultiple)[source]

Bases: BaseTaskDataModel

Input for a piuparts task.

binary_artifacts: LookupMultiple
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.PiupartsDynamicData(*, parameter_summary: str | None = None, subject: str | None = None, runtime_context: str | None = None, configuration_context: str | None = None, task_input_fields: dict[str, ~typing.Any] = <factory>, extra_repositories: list[~debusine.tasks.models.ExtraExternalRepository] | None = None, environment_id: int, input_binary_artifacts_ids: list[int], base_tgz_id: int)[source]

Bases: BaseDynamicTaskDataWithExecutor, BaseDynamicTaskDataWithExtraRepositories

Dynamic data for the Piuparts task.

base_tgz_id: int
environment_id: int
get_input_artifacts_ids() list[int][source]

Return the list of input artifact IDs used by this task.

This is used by views to show what artifacts were used by a task.

input_binary_artifacts_ids: list[int]
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.RegressionAnalysis(*, original_source_version: str | None = None, original_artifact_id: int | None = None, new_source_version: str | None = None, new_artifact_id: int | None = None, status: RegressionAnalysisStatus, details: dict[str, Any] | list[Any] | None = None, original_url: str | None = None, new_url: str | None = None)[source]

Bases: BaseTaskDataModel

The result of a regression analysis.

details: dict[str, Any] | list[Any] | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

new_artifact_id: int | None
new_source_version: str | None
new_url: str | None
original_artifact_id: int | None
original_source_version: str | None
original_url: str | None
status: RegressionAnalysisStatus
class debusine.tasks.models.RegressionAnalysisStatus(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Possible values for RegressionAnalysis.status.

ERROR = 'error'
IMPROVEMENT = 'improvement'
NO_RESULT = 'no-result'
REGRESSION = 'regression'
STABLE = 'stable'
class debusine.tasks.models.SbuildBinNMU(*, changelog: str, suffix: str, timestamp: datetime | None = None, maintainer: NameEmail | None = None)[source]

Bases: BaseTaskDataModel

binmu for a sbuild task.

changelog: str
maintainer: NameEmail | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

suffix: str
timestamp: datetime | None
class debusine.tasks.models.SbuildBuildComponent(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Possible values for build_components.

ALL = 'all'
ANY = 'any'
SOURCE = 'source'
class debusine.tasks.models.SbuildBuildDepResolver(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Possible values for build_dep_resolver.

APT = 'apt'
APTITUDE = 'aptitude'
ASPCUD = 'aspcud'
XAPT = 'xapt'
class debusine.tasks.models.SbuildData(*, task_configuration: int | str | None = 'default@debusine:task-configuration', extra_repositories: list[~debusine.tasks.models.ExtraDebusineRepository | ~debusine.tasks.models.ExtraExternalRepository] | None = None, backend: ~debusine.tasks.models.BackendType = BackendType.AUTO, environment: int | str, build_architecture: str, input: ~debusine.tasks.models.SbuildInput, build_components: list[~debusine.tasks.models.SbuildBuildComponent] = <factory>, binnmu: ~debusine.tasks.models.SbuildBinNMU | None = None, build_profiles: list[str] | None = None, build_dep_resolver: ~debusine.tasks.models.SbuildBuildDepResolver | None = None, aspcud_criteria: str | None = None, resolve_alternatives: bool = False)[source]

Bases: BaseTaskDataWithExecutor, BaseTaskDataWithExtraRepositories

In memory task data for the Sbuild task.

aspcud_criteria: str | None
binnmu: SbuildBinNMU | None
build_architecture: str
build_components: list[SbuildBuildComponent]
build_dep_resolver: SbuildBuildDepResolver | None
build_profiles: list[str] | None
check_binnmu_against_components() Self[source]

Binnmus are incompatible with architecture-independent builds.

environment: int | str
input: SbuildInput
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

resolve_alternatives: bool
class debusine.tasks.models.SbuildDynamicData(*, parameter_summary: str | None = None, subject: str | None = None, runtime_context: str | None = None, configuration_context: str | None = None, task_input_fields: dict[str, ~typing.Any] = <factory>, extra_repositories: list[~debusine.tasks.models.ExtraExternalRepository] | None = None, environment_id: int | None = None, input_source_artifact_id: int, input_extra_binary_artifacts_ids: list[int] = <factory>, binnmu_maintainer: str | None = None)[source]

Bases: BaseDynamicTaskDataWithExecutor, BaseDynamicTaskDataWithExtraRepositories

Dynamic data for the Sbuild task.

binnmu_maintainer: str | None
get_input_artifacts_ids() list[int][source]

Return the list of input artifact IDs used by this task.

This is used by views to show what artifacts were used by a task.

get_source_package_name() str | None[source]

Extract the source package name.

Returns:

the source package name, if applicable, and None otherwise.

input_extra_binary_artifacts_ids: list[int]
input_source_artifact_id: int
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.SbuildInput(*, source_artifact: int | str, extra_binary_artifacts: ~debusine.tasks.models.LookupMultiple = <factory>)[source]

Bases: BaseTaskDataModel

Input for a sbuild task.

extra_binary_artifacts: LookupMultiple
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

source_artifact: int | str
class debusine.tasks.models.SystemBootstrapData(*, task_configuration: int | str | None = 'default@debusine:task-configuration', bootstrap_options: SystemBootstrapOptions, bootstrap_repositories: Annotated[list[SystemBootstrapRepository], MinLen(min_length=1)], customization_script: str | None = None)[source]

Bases: BaseTaskData

Base for in-memory class data for SystemBootstrap tasks.

bootstrap_options: SystemBootstrapOptions
bootstrap_repositories: Annotated[list[SystemBootstrapRepository], FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])]
customization_script: str | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.SystemBootstrapOptions(*, architecture: str, variant: str | None = None, extra_packages: list[str] = <factory>, use_signed_by: bool = True)[source]

Bases: BaseTaskDataModel

Structure of SystemBootstrap options.

architecture: str
extra_packages: list[str]
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

use_signed_by: bool
variant: str | None
class debusine.tasks.models.SystemBootstrapRepository(*, mirror: str, suite: str, types: ~typing.Annotated[list[~debusine.tasks.models.SystemBootstrapRepositoryType], ~annotated_types.MinLen(min_length=1), ~pydantic.functional_validators.AfterValidator(func=~debusine.tasks.models.require_unique)] = <factory>, components: ~typing.Annotated[list[str], ~pydantic.functional_validators.AfterValidator(func=~debusine.tasks.models.require_unique)] | None = None, check_signature_with: ~debusine.tasks.models.SystemBootstrapRepositoryCheckSignatureWith = SystemBootstrapRepositoryCheckSignatureWith.SYSTEM, keyring_package: str | None = None, keyring: ~debusine.tasks.models.SystemBootstrapRepositoryKeyring | None = None)[source]

Bases: BaseTaskDataModel

Description of one repository in SystemBootstrapData.

check_signature_with: SystemBootstrapRepositoryCheckSignatureWith
components: Annotated[list[str], AfterValidator(func=require_unique)] | None
keyring: SystemBootstrapRepositoryKeyring | None
keyring_package: str | None
mirror: str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

suite: str
types: Annotated[list[SystemBootstrapRepositoryType], FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)]), AfterValidator(func=require_unique)]
class debusine.tasks.models.SystemBootstrapRepositoryCheckSignatureWith(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Possible values for check_signature_with.

EXTERNAL = 'external'
NO_CHECK = 'no-check'
SYSTEM = 'system'
class debusine.tasks.models.SystemBootstrapRepositoryKeyring(*, url: AnyUrl, sha256sum: str = '', install: bool = False)[source]

Bases: BaseTaskDataModel

Description of a repository keyring.

install: bool
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

sha256sum: str
url: AnyUrl
classmethod validate_url(url: AnyUrl) AnyUrl[source]

Reject file:// URLs outside /usr/(local/)share/keyrings/.

We don’t want to allow reading arbitrary paths.

class debusine.tasks.models.SystemBootstrapRepositoryType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Possible values for repository types.

DEB = 'deb'
DEB_SRC = 'deb-src'
class debusine.tasks.models.SystemImageBuildData(*, task_configuration: int | str | None = 'default@debusine:task-configuration', bootstrap_options: DebootstrapBootstrapOptions, bootstrap_repositories: Annotated[list[SystemBootstrapRepository], MinLen(min_length=1)], customization_script: str | None = None, disk_image: DiskImage)[source]

Bases: SystemBootstrapData

Base for in-memory class data for SystemImageBuild tasks.

bootstrap_options: DebootstrapBootstrapOptions
disk_image: DiskImage
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.WorkerType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: DjangoChoicesEnum

The type of a Worker.

CELERY = 'celery'
EXTERNAL = 'external'
SCHEDULER = 'scheduler'
SIGNING = 'signing'
debusine.tasks.models.build_key_value_lookup_segment(lookup_type: str, filters: dict[str, str]) str[source]

Build a lookup segment consisting of a series of key=value filters.

debusine.tasks.models.build_lookup_string(*segments: str, options: dict[str, Any] | None = None) str[source]

Build a string lookup from segments and options.

debusine.tasks.models.parse_key_value_lookup_segment(segment: str) tuple[str, dict[str, str]][source]

Parse a lookup segment consisting of a series of key=value filters.

debusine.tasks.models.parse_lookup_string(lookup: str) tuple[list[str], dict[str, str] | None][source]

Parse a string lookup into options and segments.

debusine.tasks.models.require_unique(v: list[Any]) list[Any][source]

Field validator to require that list items are unique.