prep release 1.23.0

Merged
WV
3mo ago
+10922-781

Summary by cubic

Prepares SDK 1.23.0 with automatic HTTP 429 backoff, request priority, a comment‑preserving schema formatter with offline validation, and server deployment ID exposure. Also removes the dead branch‑diff path, updates protocols (Infrahub 1.11), adds the IPAddress kind, improves task APIs/diagnostics, optimizes pagination, and switches versioning to hatch-vcs.

  • Networking/resilience: transparent retry on HTTP 429 across regular, multipart, and streaming requests; configurable via rate_limit_*; default enabled with a retry budget of 10; raises RateLimitError when exhausted.

  • Request priority: new Priority enum (high|medium|low) and Config.priority; emits X‑Priority when set; per‑request priority= and RequestContext.priority with precedence per‑request > context > config; async/sync parity.

  • CLI/schema: infrahubctl schema format (comment‑preserving via ruamel.yaml) with canonical key ordering and optional --strip-defaults, --sort-by-order-weight, --backfill-order-weight; schema validate runs offline against generated write models and reports warnings for non‑settable fields; warn‑only schema‑drift check and baseline added.

  • Schema contract/models: commit generated write/read models under infrahub_sdk/schema/generated/ used by the offline validator.

  • Server info: new get_server_information() returns version and deployment ID; infrahubctl info shows the deployment ID.

  • Branch/protocols/types: removed client.branch.diff_data() (always 404); add BranchStatus.MERGE_FAILED; update protocols for Infrahub 1.11; support IPAddress attribute kind.

  • Tasks: add retry/cancel helpers, surface available actions, and optional webhook delivery diagnostics.

  • Performance: pagination offset/limit now pass as GraphQL variables to improve cache reuse.

  • Release/CI: derive package version from git tags via hatch-vcs; CI workflows fetch full history and tags; repository‑dispatch fan‑out includes opsmill/infrahub-sync.

  • Repository config: add advisory messages encouraging a watch block in .infrahub.yml for generators.

  • Migration and rollout

    • 429 retry is enabled by default; tune or disable via rate_limit_retry_enabled, rate_limit_max_retries, rate_limit_backoff_base, rate_limit_backoff_max.
    • Replace any usage of client.branch.diff_data() with get_diff_tree() or get_diff_summary().
    • Priority header: set Config.priority (high|medium|low) to emit X‑Priority; override per request with priority= or via RequestContext.priority. When unset, no header is sent.
    • CI/CD: version now derives from git tags via hatch-vcs; ensure releases fetch tags (actions/checkout with fetch-depth: 0 and fetch-tags: true). The generated infrahub_sdk/_version.py is ignored by git.
    • Schema formatting: consider adding infrahubctl schema format --check to CI; optional flags are safe and idempotent; the schema‑drift check is warn‑only.
    • infrahubctl object load imports pyarrow lazily; install the ctl extra if needed: pip install 'infrahub-sdk[ctl]'.