# 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)

  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 = {'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)])

  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 = {'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)

  Bases: `BaseTaskDataModel`

  Action for sending a notification.

  action: Literal[ActionTypes.SEND_NOTIFICATION]
  channel: str
  data: NotificationDataEmail | None
  model_config = {'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)

  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 = {'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(*values)

  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)

  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 = {'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)

  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 = {'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.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)

  Bases: `BaseTaskDataWithExecutor`

  In-memory task data for the AssembleSignedSource task.

  classmethod backend_is_auto(backend: str) → str

    Ensure that the backend is “auto”.

  environment: int | str
  model_config = {'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], unsigned_ids: list[int] = <factory>)

  Bases: `BaseDynamicTaskDataWithExecutor`

  Dynamic data for the AssembleSignedSource task.

  environment_id: int
  get_input_artifacts_ids() → list[int]

    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 = {'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
  unsigned_ids: list[int]

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

  Bases: `BaseTaskDataWithExecutor`, `BaseTaskDataWithExtraRepositories`

  In memory task data for the Autopkgtest task.

  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 = {'extra': 'forbid', 'validate_assignment': True}

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

  needs_internet: AutopkgtestNeedsInternet
  pin_packages: dict[str, list[str]]
  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>)

  Bases: `BaseDynamicTaskDataWithExecutor`, `BaseDynamicTaskDataWithExtraRepositories`

  Dynamic data for the Autopkgtest task.

  environment_id: int
  get_input_artifacts_ids() → list[int]

    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

    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 = {'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)

  Bases: `BaseTaskDataModel`

  Possible values for fail_on.

  failed_test: bool
  flaky_test: bool
  model_config = {'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: LookupMultiple, context_artifacts: LookupMultiple = <factory>)

  Bases: `BaseTaskDataModel`

  Input for an autopkgtest task.

  binary_artifacts: LookupMultiple
  context_artifacts: LookupMultiple
  model_config = {'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(*values)

  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)

  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 = {'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(*values)

  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>)

  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]

    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

    Extract the source package name.

    Returns:

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

  model_config = {'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)

  Bases: `BaseDynamicTaskData`

  Dynamic task data for executors.

  environment_id: int | None
  model_config = {'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[ExtraExternalRepository] | None = None)

  Bases: `BaseDynamicTaskData`

  Dynamic task data for extra repositories.

  extra_repositories: list[ExtraExternalRepository] | None
  model_config = {'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, architectures: list[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(pattern='^(\\w|-)+$')])]] | None = None)

  Bases: `BaseTaskDataModel`, `ABC`

  Generic extra repositories for Debian tasks.

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

    Rewrite an empty architectures list to None.

  classmethod convert_empty_components_to_none(value: list[str] | None) → list[str] | None

    Rewrite an empty components list to None.

  model_config = {'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)

  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 = {'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)

  Bases: `BaseTaskInput`

  Task input annotated with a task data field name.

  label: str

    the task data label.

  model_config = {'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')

  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 = {'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

  Bases: `BaseModel`

  Stricter pydantic defaults for task data models.

  model_config = {'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]

    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)

  Bases: `BaseTaskData`

  Base task data with fields used to configure executors.

  backend: BackendType
  build_architecture: str | None
  environment: int | str | None
  model_config = {'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, build_architecture: str)

  Bases: `BaseTaskData`

  Base task data with fields used to configure extra_repositories.

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

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

class debusine.tasks.models.BaseTaskInput

  Bases: `BaseModel`

  Base for structures defining task input artifacts and collections.

  model_config = {'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)

  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 = {'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

    Serialize the data field.

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

  Bases: `BaseTaskDataWithExecutor`

  In memory task data for the Blhc task.

  build_architecture: str
  environment: int | str
  extra_flags: list[BlhcFlags]
  input: BlhcInput
  model_config = {'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: DebianPackageBuildLog | None = None)

  Bases: `BaseDynamicTaskDataWithExecutor`

  Dynamic data for the Blhc task.

  environment_id: int
  get_input_artifacts_ids() → list[int]

    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

    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 = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.BlhcFlags(*values)

  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)

  Bases: `BaseTaskDataModel`

  Input for a blhc task.

  artifact: int | str
  model_config = {'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)

  Bases: `BaseTaskDataModel`

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

  kind: CollectionItemMatcherKind
  model_config = {'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(*values)

  Bases: `StrEnum`

  Possible values for CollectionItemMatcher.kind.

  CONTAINS = 'contains'
  ENDSWITH = 'endswith'
  EXACT = 'exact'
  IN = 'in'
  STARTSWITH = 'startswith'

class debusine.tasks.models.Confirmation(*, confirmed: bool, comment: str | None = None)

  Bases: `BaseTaskDataModel`

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

  comment: str | None
  confirmed: bool
  model_config = {'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: BackendType = BackendType.AUTO, environment: int | str, build_architecture: str, input: DebDiffInput, extra_flags: list[DebDiffFlags] = <factory>)

  Bases: `BaseTaskDataWithExecutor`

  In memory task data for the DebDiff task.

  build_architecture: str
  environment: int | str
  extra_flags: list[DebDiffFlags]
  input: DebDiffInput
  model_config = {'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: Annotated[list[int] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, input_binary_artifacts_ids: Annotated[list[list[int]] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None)

  Bases: `BaseDynamicTaskDataWithExecutor`

  Dynamic data for the DebDiff task.

  environment_id: int
  get_input_artifacts_ids() → list[int]

    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

    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 = {'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

    Validate mutually exclusive input artifacts.

    Ensure input_source_artifacts_ids and input_binary_artifacts_ids are not both set.

class debusine.tasks.models.DebDiffFlags(*values)

  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)

  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

    Ensure only source or binary artifacts are present.

  model_config = {'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: DebootstrapVariant | None = None, extra_packages: list[str] = <factory>, use_signed_by: bool = True, gpgv_command: GpgvCommand | None = None)

  Bases: `SystemBootstrapOptions`

  Structure of debootstrap options.

  model_config = {'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(*values)

  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)])

  Bases: `BaseTaskDataModel`

  Disk image definition.

  bootloader: str | None
  filename: str
  format: DiskImageFormat
  kernel_package: str | None
  model_config = {'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(*values)

  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')]] = [])

  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

    Add an EventReaction to the named event.

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

  model_config = {'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]

    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, architectures: list[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(pattern='^(\\w|-)+$')])]] | None = None, suite: int | str)

  Bases: `BaseExtraRepository`

  An extra Debusine-hosted repository for Debian tasks.

  model_config = {'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, architectures: 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, preserve_empty_path=None)], suite: Annotated[str, _PydanticGeneralMetadata(pattern='^(\\w|[./ -])+$')], signing_key: str | None = None)

  Bases: `BaseExtraRepository`

  An extra external repository for Debian tasks.

  as_deb822_source(signed_by_filename: str | None = None) → str

    Render a Deb822 sources.list.d entry.

  flat_repository() → Self

    Check if suite is a flat repository.

  model_config = {'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, preserve_empty_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)

  Bases: `BaseTaskDataWithExecutor`

  In-memory task data for the ExtractForSigning task.

  classmethod backend_is_auto(backend: str) → str

    Ensure that the backend is “auto”.

  environment: int | str
  input: ExtractForSigningInput
  model_config = {'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])

  Bases: `BaseDynamicTaskDataWithExecutor`

  Dynamic data for the ExtractForSigning task.

  environment_id: int
  get_input_artifacts_ids() → list[int]

    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 = {'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)

  Bases: `BaseTaskDataModel`

  Input for the ExtractForSigning task.

  binary_artifacts: LookupMultiple
  model_config = {'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.GpgvCommand(*values)

  Bases: `StrEnum`

  Possible values for gpgv_command.

  GPGV = 'gpgv'
  GPGV_SQ = 'gpgv-sq'

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

  Bases: `BaseTaskDataModel`

  Usage log for cached executor images.

  backends: set[BackendType]
  model_config = {'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

    Ensure that the version is known.

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

  Bases: `BaseTaskDataModel`

  Entry in ImageCacheUsageLog for cached executor images.

  backend: BackendType | None
  filename: str
  model_config = {'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

    Ensure that the timestamp is TZ-aware.

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

  Bases: `BaseLabeledTaskInput`

  Represent declared multiple input artifacts for a task.

  artifacts: Sequence[BaseTaskInputArtifact]

    Artifact data if it’s already known

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

    Create an InputArtifactMultiple from a list of artifact IDs.

  lookup: LookupMultiple

    Lookup used to obtain the artifacts.

  model_config = {'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]

    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)

  Bases: `BaseInputArtifactSingle`

  Represent a declared single input artifact for a task.

  model_config = {'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]

    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])

  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 = {'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: BackendType = BackendType.AUTO, environment: int | str | None = None, build_architecture: str | None = None, input: LintianInput, output: LintianOutput = <factory>, target_distribution: str = 'debian:unstable', include_tags: list[str] = <factory>, exclude_tags: list[str] = <factory>, fail_on_severity: LintianFailOnSeverity = LintianFailOnSeverity.ERROR)

  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 = {'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>)

  Bases: `BaseDynamicTaskDataWithExecutor`

  Dynamic data for the Lintian task.

  get_input_artifacts_ids() → list[int]

    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

    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 = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.LintianFailOnSeverity(*values)

  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: LookupMultiple = <factory>)

  Bases: `BaseTaskDataModel`

  Input for a lintian task.

  binary_artifacts: LookupMultiple
  check_one_of_source_or_binary() → Self

    Ensure a source or binary artifact is present.

  model_config = {'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)

  Bases: `BaseTaskDataModel`

  Output configuration for a Lintian task.

  binary_all_analysis: bool
  binary_any_analysis: bool
  model_config = {'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], ...] = (), error_on_empty: bool = False)

  Bases: `BaseTaskDataModel`

  Dictionary lookups for collection items.

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

    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 = {'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]

    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)

  Bases: `]]`

  Lookups resulting in multiple collection items.

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

    Export the usual input representation of this lookup.

    This reverses the transformations applied by `normalize()`.

  model_config = {'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, ...]

    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)

  Bases: `BaseTaskDataWithExecutor`

  In memory task data for the MakeSourcePackageUpload task.

  environment: int | str
  input: MakeSourcePackageUploadInput
  model_config = {'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)

  Bases: `BaseDynamicTaskDataWithExecutor`

  Expanded dynamic data for the MakeSourcePackageUpload task.

  environment_id: int
  get_input_artifacts_ids() → list[int]

    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

    Extract the source package name.

    Returns:

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

  input_source_artifact_id: int
  model_config = {'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)

  Bases: `BaseTaskDataModel`

  Input for a MakeSourcePackageUpload task.

  model_config = {'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)

  Bases: `BaseTaskData`

  In memory task data for the MergeUploads task.

  backend: BackendType
  environment: int | str | None
  input: MergeUploadsInput
  model_config = {'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])

  Bases: `BaseDynamicTaskData`

  Expanded dynamic data for the MergeUploads task.

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

    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

    Extract the source package name.

    Returns:

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

  input_uploads_ids: list[int]
  model_config = {'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)

  Bases: `BaseTaskDataModel`

  Input for a MergeUploads task.

  model_config = {'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: MmDebstrapVariant | None = None, extra_packages: list[str] = <factory>, use_signed_by: bool = True, gpgv_command: GpgvCommand | None = None)

  Bases: `SystemBootstrapOptions`

  Structure of MmDebstrap options.

  model_config = {'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)

  Bases: `SystemBootstrapData`

  In memory task data for the MmDebstrap task.

  bootstrap_options: MmDebstrapBootstrapOptions
  model_config = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.MmDebstrapVariant(*values)

  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)

  Bases: `BaseTaskDataWithExecutor`

  In memory task data for the Noop task.

  model_config = {'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_: EmailStr | None = None, to: list[EmailStr] | None = None, cc: list[EmailStr] = <factory>, subject: str | None = None)

  Bases: `BaseTaskDataModel`

  Channel data for email notifications.

  cc: list[EmailStr]
  from_: EmailStr | None
  model_config = {'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)

  Bases: `BaseTaskDataModel`

  Data produced when a task is completed.

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

    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 = {'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)

  Bases: `BaseTaskDataModel`

  An error encountered when running a task.

  code: str
  message: str
  model_config = {'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')

  Bases: `BaseTaskDataModel`

  Partition definition.

  filesystem: str
  model_config = {'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, build_architecture: str | None = None, backend: BackendType = BackendType.AUTO, environment: int | str, input: PiupartsDataInput, base_tgz: int | str)

  Bases: `BaseTaskDataWithExecutor`, `BaseTaskDataWithExtraRepositories`

  In memory task data for the Piuparts task.

  base_tgz: int | str
  environment: int | str
  input: PiupartsDataInput
  model_config = {'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)

  Bases: `BaseTaskDataModel`

  Input for a piuparts task.

  binary_artifacts: LookupMultiple
  model_config = {'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)

  Bases: `BaseDynamicTaskDataWithExecutor`, `BaseDynamicTaskDataWithExtraRepositories`

  Dynamic data for the Piuparts task.

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

    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 = {'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)

  Bases: `BaseTaskDataModel`

  The result of a regression analysis.

  details: dict[str, Any] | list[Any] | None
  model_config = {'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(*values)

  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)

  Bases: `BaseTaskDataModel`

  binmu for a sbuild task.

  changelog: str
  maintainer: NameEmail | None
  model_config = {'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(*values)

  Bases: `StrEnum`

  Possible values for build_components.

  ALL = 'all'
  ANY = 'any'
  SOURCE = 'source'

class debusine.tasks.models.SbuildBuildDepResolver(*values)

  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[ExtraDebusineRepository | ExtraExternalRepository] | None = None, build_architecture: str, backend: BackendType = BackendType.AUTO, environment: int | str, input: SbuildInput, build_components: list[SbuildBuildComponent] = <factory>, binnmu: SbuildBinNMU | None = None, build_profiles: list[str] | None = None, build_dep_resolver: SbuildBuildDepResolver | None = None, aspcud_criteria: str | None = None, resolve_alternatives: bool = False)

  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

    Binnmus are incompatible with architecture-independent builds.

  environment: int | str
  input: SbuildInput
  model_config = {'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[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)

  Bases: `BaseDynamicTaskDataWithExecutor`, `BaseDynamicTaskDataWithExtraRepositories`

  Dynamic data for the Sbuild task.

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

    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

    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 = {'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: LookupMultiple = <factory>)

  Bases: `BaseTaskDataModel`

  Input for a sbuild task.

  extra_binary_artifacts: LookupMultiple
  model_config = {'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)

  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 = {'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, gpgv_command: GpgvCommand | None = None)

  Bases: `BaseTaskDataModel`

  Structure of SystemBootstrap options.

  architecture: str
  extra_packages: list[str]
  gpgv_command: GpgvCommand | None
  model_config = {'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)

  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 = {'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(*values)

  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)

  Bases: `BaseTaskDataModel`

  Description of a repository keyring.

  install: bool
  model_config = {'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

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

    We don’t want to allow reading arbitrary paths.

class debusine.tasks.models.SystemBootstrapRepositoryType(*values)

  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)

  Bases: `SystemBootstrapData`

  Base for in-memory class data for SystemImageBuild tasks.

  bootstrap_options: DebootstrapBootstrapOptions
  disk_image: DiskImage
  model_config = {'extra': 'forbid', 'validate_assignment': True}

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

class debusine.tasks.models.WorkerType(*values)

  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

  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

  Build a string lookup from segments and options.

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

  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]

  Parse a string lookup into options and segments.

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

  Field validator to require that list items are unique.