Skip to content

Conversation

@pcrespov
Copy link
Member

@pcrespov pcrespov commented May 16, 2025

What do these changes do?

This pull request introduces new filtering capabilities for listing solvers in the public API .The changes include adding support for filtering by key patterns and version display patterns, updating API endpoints and dependencies to reflect these new features, and renaming modules for better semantics.

  • NOTE that these entrypoints are still not displayed in the OAS since the will be released in 0.8 (current version is 0.7.1
image

New Filtering Features

  • ServiceListFilters and SolversListFilters now support filtering by service_key_pattern and version_display_pattern, enabling more granular queries for services and solvers (services.py, solvers_filters.py). [1] [2]
  • Updated the list_services_paginated and latest_solvers methods to apply these filters when provided, using fnmatch for pattern matching (catalog_rpc_server.py, _service_solvers.py). [1] [2]

API Enhancements

  • Added a new dependency function get_solvers_filters to parse and validate query parameters for solver filters (models_schemas_solvers_filters.py).
  • Updated API routes to include the new filtering options, such as list_solvers and list_solvers_releases endpoints (solvers.py). [1] [2]
  • Enhanced unit tests to verify the functionality of the new filters (test_api_routers_solvers.py).

Refactoring and Renaming

  • Renamed solvers_jobs_getters.py to solvers_jobs_read.py for better semantic clarity and updated all references accordingly (root.py, function_jobs_routes.py). [1] [2]
  • Consolidated and streamlined type validation using TypeAdapter in the catalog service's RPC API (_services.py). [1] [2]

Minor Adjustments

  • Added support for the version_display field in the catalog's mock data generator (catalog_services.py).
  • Introduced a TypeAlias for PortKindStr in the solvers schema for improved type clarity (solvers.py).

Related issue/s

How to test

Dev-ops

None

@pcrespov pcrespov self-assigned this May 16, 2025
@pcrespov pcrespov added a:api framework api, data schemas, a:catalog catalog service a:apiserver api-server service labels May 16, 2025
@codecov
Copy link

codecov bot commented May 16, 2025

Codecov Report

Attention: Patch coverage is 98.59155% with 1 line in your changes missing coverage. Please review.

Project coverage is 87.60%. Comparing base (eee1de2) to head (ba1b511).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7695      +/-   ##
==========================================
+ Coverage   87.56%   87.60%   +0.04%     
==========================================
  Files        1812     1807       -5     
  Lines       70372    70224     -148     
  Branches     1144     1144              
==========================================
- Hits        61619    61518     -101     
+ Misses       8441     8394      -47     
  Partials      312      312              
Flag Coverage Δ
integrationtests 64.40% <ø> (-0.02%) ⬇️
unittests 86.82% <98.59%> (+0.03%) ⬆️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library 93.92% <ø> (ø)
pkg_dask_task_models_library 98.48% <ø> (ø)
pkg_models_library 93.07% <100.00%> (+<0.01%) ⬆️
pkg_notifications_library 85.26% <ø> (ø)
pkg_postgres_database 88.58% <ø> (ø)
pkg_service_integration 69.92% <ø> (ø)
pkg_service_library 72.36% <ø> (ø)
pkg_settings_library 90.90% <ø> (ø)
pkg_simcore_sdk 85.07% <ø> (+0.17%) ⬆️
agent 96.46% <ø> (ø)
api_server 91.68% <100.00%> (+0.05%) ⬆️
autoscaling 96.07% <ø> (ø)
catalog 92.70% <97.43%> (+0.05%) ⬆️
clusters_keeper 99.25% <ø> (ø)
dask_sidecar 89.86% <ø> (ø)
datcore_adapter 98.12% <ø> (ø)
director 76.87% <ø> (ø)
director_v2 91.13% <ø> (+0.02%) ⬆️
dynamic_scheduler 96.76% <ø> (ø)
dynamic_sidecar 90.18% <ø> (ø)
efs_guardian 89.79% <ø> (ø)
invitations 93.28% <ø> (ø)
payments 92.63% <ø> (ø)
resource_usage_tracker 89.13% <ø> (+0.10%) ⬆️
storage 87.49% <ø> (-0.36%) ⬇️
webclient ∅ <ø> (∅)
webserver 85.84% <ø> (+0.02%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eee1de2...ba1b511. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pcrespov pcrespov force-pushed the is7692/filter-solvers branch from 0f8bfb2 to 1370bc2 Compare May 16, 2025 18:49
@pcrespov pcrespov added this to the Bazinga! milestone May 16, 2025
@pcrespov pcrespov force-pushed the is7692/filter-solvers branch from 1370bc2 to 3d2fe5c Compare May 17, 2025 10:33
@pcrespov pcrespov changed the title WIP: ✨ Is7692/filter solvers public-api: list solvers filtered by service_key and version_display patterns May 17, 2025
@pcrespov pcrespov force-pushed the is7692/filter-solvers branch 2 times, most recently from 49013ea to cfa0e2e Compare May 19, 2025 08:22
@pcrespov pcrespov marked this pull request as ready for review May 19, 2025 08:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the public API for listing solvers by adding pattern-based filtering on solver IDs and version display. It also refactors related modules, updates Pydantic models, introduces new FastAPI dependencies, and expands test coverage to validate the filters.

  • Add service_key_pattern and version_display_pattern to DB filters and RPC/listing logic
  • Introduce SolversListFilters schema and get_solvers_filters dependency in the API server
  • Refactor module names (e.g., solvers_jobs_getterssolvers_jobs_read) and update import paths
  • Extend pytest fixtures and mocks to support version display in catalog data

Reviewed Changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
services/catalog/.../models/services_db.py Renamed filter and access-rights classes; added pattern fields to ServiceDBFilters.
services/catalog/.../api/rpc/_services.py Replaced custom adapter function with TypeAdapter calls for ServiceDBFilters.
services/catalog/.../_service_solvers.py Updated latest_solvers signature to accept pagination and filter parameters; added filtering.
packages/pytest-simcore/.../helpers/catalog_services.py Added version_display override to mock factory signature.
packages/pytest-simcore/.../helpers/catalog_rpc_server.py Implemented fnmatch-based filtering in RPC mock based on new DB filters.
services/api-server/.../models/schemas/solvers.py Migrated PortKindStr to TypeAlias; left a commented divider.
services/api-server/.../api/routes/solvers.py Added SolversListFilters dependency and wired filters into latest_solvers calls.
Comments suppressed due to low confidence (5)

services/catalog/src/simcore_service_catalog/_service_solvers.py:164

  • The docstring refers to offset and limit, but the method signature uses pagination_offset and pagination_limit. Update the parameter names in the docstring for consistency.
offset: Pagination offset

packages/pytest-simcore/src/pytest_simcore/helpers/catalog_services.py:24

  • The function signature now includes version_display, but the docstring above does not mention this new parameter; please update the docstring to document version_display.
deprecated: datetime | None = None,  # DB column

services/catalog/src/simcore_service_catalog/models/services_db.py:251

  • [nitpick] The class name ServiceDBFilters is inconsistent with other filter names like SolversListFilters and the original ServiceFiltersDB. Consider aligning the name with the existing pattern (e.g., ServiceFiltersDB).
class ServiceDBFilters(Filters):

packages/pytest-simcore/src/pytest_simcore/helpers/catalog_rpc_server.py:67

  • [nitpick] The loop variable src is not descriptive; consider renaming it to service or item to improve readability.
for src in services_list:

services/api-server/src/simcore_service_api_server/models/schemas/solvers.py:29

  • [nitpick] This commented divider is no longer needed and can be removed to keep the schema file clean.
# SOLVER ----------

Copy link
Collaborator

@matusdrobuliak66 matusdrobuliak66 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@pcrespov pcrespov force-pushed the is7692/filter-solvers branch from cfa0e2e to 941817c Compare May 19, 2025 13:30
@pcrespov pcrespov enabled auto-merge (squash) May 19, 2025 13:31
@pcrespov
Copy link
Member Author

@mergify queue

@mergify
Copy link
Contributor

mergify bot commented May 19, 2025

queue

🟠 Waiting for conditions to match

  • -closed [📌 queue requirement]
  • any of: [🔀 queue conditions]
    • all of: [📌 queue conditions of queue default]
      • branch-protection-review-decision = APPROVED [🛡 GitHub branch protection]
      • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
      • #approved-reviews-by>=2
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0
      • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
      • #review-threads-unresolved=0
      • -conflict
      • -draft
      • base=master
      • label!=🤖-do-not-merge
      • label=🤖-automerge
      • any of: [🛡 GitHub branch protection]
        • check-skipped = deploy to dockerhub
        • check-neutral = deploy to dockerhub
        • check-success = deploy to dockerhub
      • any of: [🛡 GitHub branch protection]
        • check-success = system-tests
        • check-neutral = system-tests
        • check-skipped = system-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = unit-tests
        • check-neutral = unit-tests
        • check-skipped = unit-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = check OAS' are up to date
        • check-neutral = check OAS' are up to date
        • check-skipped = check OAS' are up to date
      • any of: [🛡 GitHub branch protection]
        • check-success = integration-tests
        • check-neutral = integration-tests
        • check-skipped = integration-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = build-test-images (frontend) / build-test-images
        • check-neutral = build-test-images (frontend) / build-test-images
        • check-skipped = build-test-images (frontend) / build-test-images
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of: [📌 queue -> configuration change requirements]
    • -mergify-configuration-changed
    • check-success = Configuration changed

@pcrespov pcrespov added the 🤖-automerge marks PR as ready to be merged for Mergify label May 19, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 19, 2025

Quality Gate Passed Quality Gate passed

Issues
0 New issues
1 Accepted issue

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@pcrespov pcrespov disabled auto-merge May 19, 2025 14:20
@pcrespov pcrespov merged commit b46a1dd into ITISFoundation:master May 19, 2025
95 checks passed
@pcrespov pcrespov deleted the is7692/filter-solvers branch May 19, 2025 14:21
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Jun 6, 2025
92 tasks
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Aug 5, 2025
88 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-automerge marks PR as ready to be merged for Mergify a:api framework api, data schemas, a:apiserver api-server service a:catalog catalog service

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Solver listing filters by key and version_display patterns

4 participants