httk.workflow.hygiene

Describe and repair a project’s remotes, and check its workspace health.

Everything here answers an operator question about state that already exists: what is this remote configured to do, what is wrong with this workspace and can it be fixed. Nothing here is on the execution path of a job. The individual workspace checks are the ones the project-member repair and scan_project surface through core’s httk project repair; each repair is explicit.

Attributes

Classes

Finding

Describe one thing the check looked at and what it found.

Functions

describe_remote(name, *[, project])

Describe one remote: where it lives, what it is, how it is configured.

remove_remote(name, *[, project])

Remove one remote bundle, refusing while a transfer still needs it.

Module Contents

httk.workflow.hygiene.REMOTE_DESCRIPTION_FORMAT = 'httk-remote-description'[source]
httk.workflow.hygiene.TMP_MAXIMUM_AGE_SECONDS = 86400[source]
httk.workflow.hygiene.describe_remote(name, *, project=None)[source]

Describe one remote: where it lives, what it is, how it is configured.

Credential values never appear. A remote’s settings are reported with the file each one came from, and for a setting stored in the manifest-excluded credentials.json only its name is reported: a description an operator can paste into a bug report must never carry a password.

Parameters:
  • name (str) – Remote bundle name.

  • project (str | os.PathLike[str] | None) – Project directory used for project-local lookup.

Returns:

JSON-compatible remote description.

Raises:

ValueError – If the remote name is invalid or unknown.

Return type:

dict[str, object]

httk.workflow.hygiene.remove_remote(name, *, project=None)[source]

Remove one remote bundle, refusing while a transfer still needs it.

A sealed bundle that has not been acknowledged is work this remote still owes an answer about, and the adapter is how that answer is fetched. Removing the remote would leave the transfer with no way home, so it is refused by name — retire or fetch the transfer first.

Parameters:
  • name (str) – Remote bundle name.

  • project (str | os.PathLike[str] | None) – Project directory used for project-local lookup.

Returns:

JSON-compatible removal result.

Raises:

ValueError – If the remote is invalid, unknown, or still has transfers.

Return type:

dict[str, object]

class httk.workflow.hygiene.Finding[source]

Describe one thing the check looked at and what it found.

Parameters:
  • check – Check name.

  • status – Check result status.

  • message – Human-readable result.

  • repairable – Whether the finding can be repaired automatically.

  • repaired – Whether this run repaired the finding.

  • action – Repair action, when one was taken.

  • details – Structured result details.

check: str[source]
status: str[source]
message: str[source]
repairable: bool = False[source]
repaired: bool = False[source]
action: str | None = None[source]
details: dict[str, object][source]
as_mapping()[source]

Return the JSON representation of this finding.

Returns:

JSON-compatible finding members.

Return type:

dict[str, object]