devops.release.ci

Wait until CI succeeded on the release commit before publishing.

Functions

latest_run(client, repository, workflow, ...)

Return the newest push run of a workflow on exactly this commit.

wait_for_ci(client, repository, sha, config, *)

Block until every configured workflow succeeded on the release commit.

devops.release.ci.latest_run(client, repository, workflow, sha, branch)[source]

Return the newest push run of a workflow on exactly this commit.

Parameters:
  • client (GitHubClient) – The GitHub client.

  • repository (str) – The repository as owner/name.

  • workflow (str) – The workflow file name, for example ci.yml.

  • sha (str) – The full commit SHA.

  • branch (str) – The release branch.

Returns:

dict[str, Any] | None – The newest matching run, or None if there is none yet.

Raises:

ReleaseError – If GitHub returns data in an unexpected shape.

Return type:

dict[str, Any] | None

devops.release.ci.wait_for_ci(client, repository, sha, config, *, echo=<built-in function print>, sleep=<built-in function sleep>, clock=<built-in function monotonic>)[source]

Block until every configured workflow succeeded on the release commit.

Only push runs on the release branch for this exact commit count, and the newest run of each workflow decides. Any other conclusion than success fails at once; a missing or running workflow fails when the timeout is reached.

Parameters:
  • client (GitHubClient) – The GitHub client.

  • repository (str) – The repository as owner/name.

  • sha (str) – The full commit SHA.

  • config (ReleaseConfig) – The release configuration with workflows, branch and timing.

  • echo (Callable[[str], None]) – Prints progress messages.

  • sleep (Callable[[float], None]) – Waits between polls.

  • clock (Callable[[], float]) – Returns monotonic time in seconds.

Raises:

ReleaseError – If a workflow did not succeed or the timeout is reached.

Return type:

None