Skip to content

feat: cf precheck --list-checks, client-side version check, User-Agent header (2.4.0)#16

Merged
jeffdi merged 3 commits intomainfrom
feature/version-check-and-list-checks
Apr 20, 2026
Merged

feat: cf precheck --list-checks, client-side version check, User-Agent header (2.4.0)#16
jeffdi merged 3 commits intomainfrom
feature/version-check-and-list-checks

Conversation

@jeffdi
Copy link
Copy Markdown
Contributor

@jeffdi jeffdi commented Apr 20, 2026

Summary

Three additions that together let us start the cf-cli upgrade lifecycle:

  • cf precheck --list-checks (and an expanded --help) prints the canonical set of precheck references. Check metadata now lives in chipfoundry_cli/check_refs.py as a single source of truth for help text, validation, and future tooling.
  • Client-side version check — every cf invocation polls GET /api/v1/cli/version (6h on-disk cache at ~/.chipfoundry-cli/version_check.json) and prints a dim yellow tip when a newer version is available. Louder red warning if current < minimum_supported. All errors swallowed so network flakes never block a real command. Opt out with CF_SKIP_VERSION_CHECK=1.
  • User-Agent: chipfoundry-cli/<ver> python/<py> <platform> on every outbound API call so the backend can attribute traffic and (post-May 13) apply the hard-floor rejection to pre-2.4.0 installs without affecting browser/portal/curl clients.

Bumps to 2.4.0.

Coordination with backend

The backend side (chipignite-backend-services#96, v1.18.1) already serves /api/v1/cli/version and runs the nudge middleware. The hard-floor middleware is parked there until after the May 13 shuttle deadline; this release is what customers need to install so they're ready for the flip.

Not yet published to PyPI — ship when ready.

Test plan

  • 23 new unit tests for version_check (semver parsing, warning tiers, cache behavior, network-error resilience)
  • --list-checks assertions added to test_precheck_command.py
  • Manually exercised against dev:
    • cf --version2.4.0
    • cf precheck --list-checks enumerates every check
    • With the backend advertising latest: 2.4.0, minimum_supported: 2.0.0, a 2.4.0 install prints no warning
    • Simulated minimum_supported: 2.5.0 locally → red "below minimum" tier fires

Made with Cursor

…t header (2.4.0)

New user-facing features
------------------------
* cf precheck --list-checks (and an expanded --help) prints the canonical
  list of precheck references, sourced from the new chipfoundry_cli.check_refs
  module so CLI help, validation, and future tooling share one definition.

* Client-side version check: every invocation polls GET /api/v1/cli/version
  (6h on-disk cache at ~/.chipfoundry-cli/version_check.json) and prints a
  dim yellow tip when a newer cf is available. A second, louder tier prints
  a red warning when the installed version is below the server's advertised
  minimum_supported. All failures are swallowed -- a flaky network must never
  block a real command. Gate-offable via CF_SKIP_VERSION_CHECK=1.

* User-Agent on every outbound API call is now
  "chipfoundry-cli/<version> python/<py-ver> <platform>" so the backend can
  attribute traffic and (post-May 13) apply hard-floor rejection to
  pre-2.4.0 installs without affecting browser/portal/curl clients.

Bumps cf-cli to 2.4.0.

Notes
-----
The backend (chipignite-backend-services 1.18.1) already serves the version
endpoint and has the nudge middleware live. The hard-floor middleware is
parked there until after the May 13 shuttle deadline, at which point flipping
MINIMUM_SUPPORTED_CLI_VERSION to 2.4.0 will start rejecting older installs.
This release is the first one customers can upgrade to in order to get ahead
of that flip.

Not yet published to PyPI; ship when ready.

Made-with: Cursor
Four tests were asserting on help/error strings that have drifted over time
(unrelated to this branch). Refresh them to match the current copy so CI can
verify the version-check / list-checks work in this PR without riding on
pre-existing red.

- test_config_help: SSH private key path wording
- test_init_help: "Initialize or refresh..." wording
- test_status_help: "Show project status" wording
- test_push_missing_required_files: accept the newer unlinked-project abort
  path alongside the legacy missing-file keywords

Made-with: Cursor
…ean CI

CI runners have no global git identity, so `git commit -m init` was exiting
128 ("please tell me who you are") and failing four remote-precheck-git tests
on every matrix run. Pass GIT_AUTHOR_* / GIT_COMMITTER_* via env rather than
mutating `git config --global` so local runs on developer machines remain
untouched.

Made-with: Cursor
@jeffdi jeffdi merged commit 21ffa31 into main Apr 20, 2026
12 checks passed
@jeffdi jeffdi deleted the feature/version-check-and-list-checks branch April 20, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants