saltext.github.utils.gh.statecores

Shared cores implementing the repository-scoped states: the full inspect -> test-gate -> apply flow, including change reporting.

They are consumed by the classic github_repo state module as well as the github resource type’s state modules, which are both thin wrappers handling identity and connection resolution.

The cores return complete state return dictionaries (name, changes, result, comment) and raise CommandExecutionError (usually the gh subclasses) on failures, which the wrappers translate into a failed state return.

exception saltext.github.utils.gh.statecores.StateError(message, *, changes=None)[source]

Raised when applying state changes failed. Compound states can attach the changes that were applied before the failure, which failed()/catch_errors() include in the state return.

saltext.github.utils.gh.statecores.failed(name, err)[source]

Render a raised error into a failed state return, including partially applied changes carried by the error (StateError).

saltext.github.utils.gh.statecores.catch_errors(func)[source]

Wrap a state function to render raised CommandExecutionError into a failed state return instead of a traceback.

saltext.github.utils.gh.statecores.differs(current, desired)[source]

Report whether a managed parameter needs updating. The identity check makes boolean comparisons exact: since True == 1 in Python, an equality check alone would not register e.g. 1 -> True.