Skip to content

feat: [BE] Add filter_query support to published components endpoint #180

@Mbeaulne

Description

@Mbeaulne

Description

The GET /api/published_components/ endpoint currently supports only basic substring matching (name_substring, published_by_substring). To support the new homepage Components tab (TangleML/tangle-ui#1963) with filtering comparable to the pipeline runs list, the endpoint needs richer filtering capabilities.

Current state

Param Type Description
name_substring string Case-insensitive name match
published_by_substring string Case-insensitive publisher match
digest string Exact digest match
include_deprecated bool Include deprecated components

No support for combining filters, boolean logic, input/output search, or date filtering.

Proposed changes

Phase 1: Extend simple query params

Add these additional query parameters to the existing endpoint:

Param Type Description
description_substring string | null Case-insensitive search in component description
input_name_substring string | null Search across component input names
output_name_substring string | null Search across component output names
input_type_substring string | null Search across component input types
output_type_substring string | null Search across component output types

This matches the frontend's existing search filter options (Name, Input Name, Input Type, Output Name, Output Type) which are currently performed client-side only.

Phase 2 (future): filter_query support

Adopt the same filter_query JSON predicate system used by GET /api/pipeline_runs/ with component-specific system keys:

  • system/component.name — ValueContains, ValueEquals
  • system/component.description — ValueContains
  • system/component.published_by — ValueContains, ValueEquals
  • system/component.deprecated — ValueEquals
  • system/component.input_names — ValueContains
  • system/component.output_names — ValueContains

This is a larger effort and can be deferred. Phase 1 covers the immediate needs.

Implementation notes

  • Input/output names and types are stored inside the component spec (YAML/JSON blob in the component table)
  • For Phase 1, consider denormalizing searchable fields (description, input names, output names) to columns on PublishedComponentRow or using JSON column queries
  • Alternatively, query the component.spec JSON column directly (depends on DB engine support)

Relevant files

  • component_library_api_server.pyPublishedComponentService.list() method
  • backend_types_sql.pyPublishedComponentRow and Component models

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