Merge release-1.11 into develop

Closed
IN
3mo ago
+13274-3595

Merging release-1.11 into develop after merging pull request #10077.


Summary by cubic

Merges release-1.11 into develop. Adds Phase 1 anonymous telemetry, the @urql GraphQL transport, the new IPAddress kind, stricter schema‑load reporting, faster id‑only relationship reads (incl. generics), paged diff field summaries, and validator/uniqueness wiring; also fixes recompute gaps, form filters, and git sync on merged branches, and derives the current branch from the URL in the UI and lets you switch to a branch from its details page. Adds a custom prefix‑length override for from‑pool IP allocations with a clear conflict guard.

  • Refactors

    • Replace Apollo with an imperative graphqlClient using @urql/core; remove <ApolloProvider>; keep TanStack Query; auth via @urql/exchange-auth; preserve priority and uploads; drop @apollo/client and upload client; add @urql/core, @urql/exchange-auth. Regenerate GraphQL types. (INFP‑563)
    • Validator plumbing: inject a determiner and constraint‑info merger into MergeConstraintValidator; determiner/scoper/deduplicator accept schema_branch per call (merge/rebase/proposed‑change).
    • GraphQL relationship reads: id‑only single‑relationship fields return the preloaded peer stub and carry the concrete peer kind so generic peers also skip hydration.
    • New attribute kind: IPAddress stores a bare address (no mask); kinds validate via classmethod _normalize_value; changing kind is rejected unless stored values are already canonical for the target kind. GraphQL exposes IPAddressType; SDK/types updated.
    • Schema load: validate via the write contract; report read‑only fields as warnings (incl. unchanged schema), reject unknown fields and misplaced attribute parameters; repository imports surface warnings and fail on unknowns.
    • Telemetry (INFP‑589): add adoption/activity signals — accounts.active, accounts.groups, branches.active, database.node_count.corenode, database.node_count.user, plus a 24h activity_24h summary (logins/unique_logins, checks started/passed/failed, artifacts created/updated, branches created/merged/deleted, webhooks succeeded/failed). Window is the previous full UTC day; each metric degrades independently to null; counts reuse branch‑aware paths and single‑pass kind queries.
    • Git fingerprints: Jinja2 transforms with a complete dependency closure omit the commit id; Python transforms/generators still require a watch. Unrelated commits no longer churn complete Jinja2 fingerprints.
    • Diff field summaries: page over changed nodes and fold into per‑kind summaries to scale large diffs.
    • UI branch context: derive the current branch from the URL; the branch details page shows your working branch and lets you switch to it.
    • Resource manager (IFC‑1869): support a custom prefix length on from‑pool IP allocations (address mask and prefix‑pool subnet size); re‑allocating with a conflicting prefix length raises a validation error; accept size as an alias for prefixlen for prefix pools until the public field is renamed.
  • Bug Fixes

    • Uniqueness checks: node‑scoped validations reach participating fields in mixed diffs and deduplicate across inheritance when broadened by schema changes; rebase paths pass the candidate schema_branch.
    • Coalesced recompute: relationship changes and deletions refresh readers’ computed attributes, display labels, and HFIDs, including cross‑relationship HFIDs; tolerant of profile/template kinds and kinds missing from the branch.
    • Jinja2 computed attributes: defer macros reading a number‑pool value until allocation; cascade defers to dependents; repository imports no longer always mark Jinja2 transforms as updated; normalize template_path comparison (Path vs string).
    • Frontend forms: relationship selectors honor common_parent; selections clear on parent change; inline “Add new” pre‑fills the parent.
    • Git sync: skip branches in a terminal (merged/deleting) state to avoid aborting repository synchronization.
    • Merge recovery: correct error message to instruct infrahub recover merge; docs added for recovery flow.
    • Frontend GraphQL: ensure every GraphQL call uses its own request with @urql to avoid cross‑request interference.
    • Default branch detection: identify the default branch by its flag, not the name “main”.