perago.choose_publish_base#

perago.choose_publish_base(*, workspace, current_head, commits, logical_task_key)[源代码]#

Choose the publish base that the current attempt is allowed to merge on.

Parameters:
workspaceWorkspaceInput | dict[str, Any]

Original workspace input for the attempt. Dictionaries are validated as perago.WorkspaceInput.

current_headstr

Current head commit of the target branch at publish time.

commitsSequence[object]

Commit range between the original input ref and current_head. Each commit must expose id and optional metadata either as attributes or mapping keys.

logical_task_keystr

Stable task identity that is allowed to advance the branch without tripping the publish fence.

Returns:
tuple[str, str | None]

Pair of (publish_base_head, superseded_commit). superseded_commit is None when the branch has not advanced beyond the input ref.

Raises:
PublishFenceError

Raised when the target branch advanced with commits that cannot all be attributed to logical_task_key.

pydantic.ValidationError

Raised when workspace cannot be validated as perago.WorkspaceInput.

参数:
返回类型:

tuple[str, str | None]