Skip to content

feat(lib-cloudinfo): add ProductsQuery for sched/nvme filters#61

Merged
ramonamela merged 3 commits into
masterfrom
feat/cloudinfo-sched-nvme-filters
May 6, 2026
Merged

feat(lib-cloudinfo): add ProductsQuery for sched/nvme filters#61
ramonamela merged 3 commits into
masterfrom
feat/cloudinfo-sched-nvme-filters

Conversation

@ramonamela
Copy link
Copy Markdown
Collaborator

@ramonamela ramonamela commented Apr 22, 2026

Summary

Surfaces the sched and nvme query parameters introduced in seqeralabs/cloudinfo#48 through lib-cloudinfo, and adds a forward-looking features field on CloudProduct.

  • New ProductsQuery options object (io.seqera.cloudinfo.api) with a hand-rolled builder, matching the existing CloudInfoClient.Builder style.
  • New CloudInfoClient.getProducts(provider, region, ProductsQuery) overload. The existing 2-arg getProducts is preserved and delegates to the new overload — backwards compatible.
  • Query string is only appended for set flags; a null query is equivalent to calling the 2-arg overload.
  • New CloudProduct.features (List<String>) field for per-product capability tokens (e.g. SCHED, NVME, family-type:general-purpose).
  • Bumps lib-cloudinfo to 1.1.0; changelog + README updated.

Note on features population

The features field is introduced as a forward-looking placeholder, not populated yet. The cloudinfo backend does not emit it today, so CloudProduct.features deserialises to null for every product. We're adding the field in lib-cloudinfo ahead of time because we already know this is the direction we want to go — with cloudinfo as the single source of truth for instance-type capabilities, and consumers reading capability tokens off each product rather than combining separate filter calls.

The actual computation and population of features (across providers and capabilities) will land in follow-up cloudinfo efforts. Once cloudinfo emits the field, no client-side change is required — the DTO is already wired.

Usage

ProductsQuery query = ProductsQuery.builder()
    .sched(true)
    .nvme(true)
    .build();

List<CloudProduct> products = client.getProducts("amazon", "us-east-1", query);

Test plan

  • ./gradlew :lib-cloudinfo:compileJava :lib-cloudinfo:compileTestGroovy — clean
  • ./gradlew :lib-cloudinfo:test — passing, including:
    • should fetch products with null query equal to no query
    • should filter products with sched=true to a subset
    • should filter products with nvme=true to a subset
    • should return all products for unconfigured provider when filters set (uses google)
    • features field round-trip / null / empty / equals-hashCode coverage on CloudProduct
  • Tests run against live cloudinfo.seqera.io and confirm PR Add multi-token support for HxClient #48 is deployed (filters reduce the AWS product set; google is unaffected).

ramonamela and others added 3 commits April 21, 2026 18:41
Expose the sched and nvme query parameters introduced in
seqeralabs/cloudinfo#48 via a new ProductsQuery options object and a
getProducts(provider, region, ProductsQuery) overload on CloudInfoClient.
The existing two-argument getProducts method is preserved and now
delegates to the new overload.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…ct capability tokens

CloudProduct gains a List<String> features field carrying the
per-product capability tokens advertised by the CloudInfo backend
(SCHED, NVME, GPU, family-type, etc.). Consumers map these strings
onto a domain-specific enum (e.g. the platform's Feature enum on
InstanceType). Null preserves backward compatibility for older
backend versions that do not populate the field; an empty list
explicitly means "no features advertised".

Folded into the unreleased 1.1.0 entry of changelog.txt (no version
bump). README's CloudProduct row reflects the new field.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@ramonamela ramonamela marked this pull request as ready for review May 6, 2026 14:02
@ramonamela ramonamela merged commit 60ef072 into master May 6, 2026
3 checks passed
@ramonamela ramonamela deleted the feat/cloudinfo-sched-nvme-filters branch May 6, 2026 14:33
@ramonamela ramonamela mentioned this pull request May 7, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants