prep release 1.23.0
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
Priorityenum (high|medium|low) andConfig.priority; emits X‑Priority when set; per‑requestpriority=andRequestContext.prioritywith precedence per‑request > context > config; async/sync parity. -
CLI/schema:
infrahubctl schema format(comment‑preserving viaruamel.yaml) with canonical key ordering and optional--strip-defaults,--sort-by-order-weight,--backfill-order-weight;schema validateruns 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 infoshows the deployment ID. -
Branch/protocols/types: removed
client.branch.diff_data()(always 404); addBranchStatus.MERGE_FAILED; update protocols for Infrahub 1.11; supportIPAddressattribute 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 includesopsmill/infrahub-sync. -
Repository config: add advisory messages encouraging a
watchblock in.infrahub.ymlfor 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()withget_diff_tree()orget_diff_summary(). - Priority header: set
Config.priority(high|medium|low) to emit X‑Priority; override per request withpriority=or viaRequestContext.priority. When unset, no header is sent. - CI/CD: version now derives from git tags via
hatch-vcs; ensure releases fetch tags (actions/checkoutwithfetch-depth: 0andfetch-tags: true). The generatedinfrahub_sdk/_version.pyis ignored by git. - Schema formatting: consider adding
infrahubctl schema format --checkto CI; optional flags are safe and idempotent; the schema‑drift check is warn‑only. infrahubctl object loadimportspyarrowlazily; install thectlextra if needed:pip install 'infrahub-sdk[ctl]'.
- 429 retry is enabled by default; tune or disable via