zuke.tools.codecov

← Python API reference

@zuke/codecov 1.1.0: @zuke/codecov — a typed Codecov CLI (codecovcli) task wrapper for Zuke builds.

Symbols

#

CodecovTasks

class
class CodecovTasks

Typed task functions for the Codecov CLI.

  • static async upload(ctx: ServiceContext, configure: Callable[[CodecovUploadSettings], CodecovUploadSettings] | None=None) -> ExecResult

    Upload coverage reports: codecovcli upload-process.

#

CodecovUploadSettings

class
class CodecovUploadSettings(ToolSettings)

Settings for codecovcli upload-process.

  • files(*paths: str) -> Self

    A coverage report file to upload (--file). Repeatable.

  • flags(*names: str) -> Self

    Tag the uploaded reports with a flag (--flag). Repeatable.

  • plugins(*names: str) -> Self

    Run an upload plugin, e.g. gcov or noop (--plugin). Repeatable.

  • token(value: str) -> Self

    Repository upload token. Routed through CODECOV_TOKEN rather than --token, because a child's argv is world-readable: ps or /proc/<pid>/cmdline shows it to every other user on the host and to every process the build starts. The environment of another process is not readable the same way, and the CLI documents the variable, so nothing is given up by preferring it. Also registered with the run's redactor, so a value that reaches the output some other way — an error message quoting a URL, a tool echoing its own configuration — is masked there too.

  • slug(value: str) -> Self

    Repository slug as OWNER/REPO (--slug).

  • sha(value: str) -> Self

    Commit SHA the coverage belongs to (--sha).

  • branch(value: str) -> Self

    Branch the coverage belongs to (--branch).

  • pull_request(value: str | float) -> Self

    Pull request number the coverage belongs to (--pr).

  • git_service(value: str) -> Self

    Git host the repo lives on, e.g. github (--git-service).

  • name(value: str) -> Self

    A custom display name for this upload (--name).

  • dir(value: str) -> Self

    Directory to search for coverage reports (--dir).

  • network_root_folder(value: str) -> Self

    Root folder used to resolve report file paths (--network-root-folder).

  • report_type(value: str) -> Self

    Report kind: coverage (default) or test_results (--report-type).

  • disable_telem() -> Self

    Keep the CLI from reporting its own errors to Codecov's Sentry (--disable-telem). A global flag, so it is emitted before the subcommand.

  • disable_search() -> Self

    Upload only the named files, skipping the auto-search (--disable-search).

  • handle_no_reports_found() -> Self

    Succeed instead of erroring when no reports are found (--handle-no-reports-found).

  • fail_on_error() -> Self

    Exit non-zero when the upload fails (--fail-on-error).

  • dry_run() -> Self

    Print what would be uploaded without sending anything (--dry-run).