Skip to content

Add --do-not-check-self-updates CLI flag #89

Description

@zavijavasoft

When running the Caupain CLI, it always checks for a newer version of Caupain itself by calling the GitHub Releases API (https://api.github.com/repos/deezer/caupain/releases/latest). This happens on every run, in parallel with dependency update checks.

If GitHub is unreachable or blocked (corporate networks, air-gapped CI)
outbound network access is restricted or discouraged
the extra HTTP request adds latency to an otherwise local check
CI jobs only need to report dependency updates, not whether Caupain itself is outdated
In these cases the self-update check is unnecessary, and failures or slowness from that request can get in the way of the main task.

My solution is:

Add a CLI flag to skip the self-update check, for example:

caupain --do-not-check-self-updates

When this flag is set, Caupain should not call the GitHub API to check for a newer Caupain release, and should not include self-update information in the report.

Default behavior should stay the same: without the flag, self-update checking continues as today.

Alternatives:

Environment variable (e.g. CAUPAIN_SKIP_SELF_UPDATE=1) — works well in CI, but less discoverable than a CLI flag and not visible in --help.
Configuration file option (e.g. in caupain.toml) — good for persistent local setup, but heavier for one-off CI usage.
Disable self-update check by default — would reduce surprise network calls, but changes existing behavior and removes a useful hint for interactive users.
Rely on --no-cache or --quiet — these control caching/output, not the self-update GitHub request.
A dedicated CLI flag seems like the smallest, most explicit change. A config/env option could be added later if maintainers prefer.

Additional context

The self-update logic lives in CLISelfUpdateResolver, which is always passed to DependencyUpdateChecker from CaupainCLI. The core already supports disabling this by passing null as selfUpdateResolver (the Gradle plugin does not use self-update checking).

Example use cases:

# CI: check dependencies only, no GitHub self-update call
caupain --do-not-check-self-updates -q
# Offline / restricted network
caupain --do-not-check-self-updates -i gradle/libs.versions.toml

If this is accepted, I can open a PR with the flag, a unit test, README update, and shell completion updates.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Fields

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions