Skip to content

Replace _raw_get_items raw-httpx workaround with the typed 0.6.0 client #21

Description

@bburda

Summary

SovdClient._raw_get_items is a raw-httpx helper used for the query-param-filtered list calls (entity/global faults, logs, updates). It originally existed because the 0.5.0 generated client did not type those query params. The 0.6.0 client now types them, so the helper is no longer required for that reason - but the generated functions type the filters as per-endpoint enums, so a clean swap is non-trivial.

Proposed solution

Replace the four _raw_get_items call sites with the typed generated client functions and then remove _raw_get_items (and _fault_query_params if it becomes unused):

  • entity faults list -> list_<entity>_faults (status)
  • global faults list -> list_all_faults (status / include_muted / include_clusters)
  • entity logs list -> list_<entity>_logs (severity / context)
  • updates list -> list_updates (origin / target_version)

Map the string filters to the per-endpoint enums (ListComponentFaultsStatus, ListComponentLogsSeverity, etc.).

Additional context

  • Behavior change to decide on: the generated filter params are enums, so an out-of-enum filter string would raise locally instead of being passed through to the gateway. Choose between validating (enum) or keeping the lenient pass-through.
  • updates (origin / target_version) and logs context are plain strings (no enum) and convert trivially; only faults status and logs severity need per-entity-type enum mapping.
  • Deferred from the 0.6.0 client migration (Migrate to gateway 0.6.0 client #20) to keep that PR a focused version bump. The stale workaround comments were already corrected there.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions