Skip to content

feat: adds db filter by persisted storage#3189

Merged
stalniy merged 1 commit into
mainfrom
feat/db-filter-storage
May 18, 2026
Merged

feat: adds db filter by persisted storage#3189
stalniy merged 1 commit into
mainfrom
feat/db-filter-storage

Conversation

@stalniy
Copy link
Copy Markdown
Contributor

@stalniy stalniy commented May 18, 2026

Why

ref CON-344

What

Summary by CodeRabbit

Release Notes

  • Tests

    • Added unit tests validating persistent storage class aggregation across storage volumes.
    • Added integration tests for provider candidate filtering based on persistent storage classes.
  • Bug Fixes

    • Provider candidate search now properly evaluates required persistent storage classes when identifying compatible providers.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8fbac441-20f5-4d1e-a51c-2fb104b08c42

📥 Commits

Reviewing files that changed from the base of the PR and between 9417865 and 2fd2b24.

📒 Files selected for processing (4)
  • apps/provider-inventory/src/repositories/bid-screening/bid-screening.aggregator.spec.ts
  • apps/provider-inventory/src/repositories/bid-screening/bid-screening.aggregator.ts
  • apps/provider-inventory/src/repositories/bid-screening/bid-screening.repository.integration.ts
  • apps/provider-inventory/src/repositories/bid-screening/bid-screening.repository.ts

📝 Walkthrough

Walkthrough

This PR extends bid-screening aggregation and filtering to include persistent storage classes. The aggregator extracts and deduplicates storage class values from persistent volumes per unit, the repository filters candidates via JSONB containment on provider storage classes, and integration tests validate the full flow with enhanced test harness support.

Changes

Persistent Storage Class Filtering for Bid Screening

Layer / File(s) Summary
Persistent storage token extraction in aggregator
apps/provider-inventory/src/repositories/bid-screening/bid-screening.aggregator.ts
aggregateCriteria now calls collectPersistentStorageTokens to populate persistentClasses per unit by parsing storage volume attributes and deduplicating persistent class values. GPU token collection was renamed to collectGpuTokens for consistency.
Aggregator tests for persistentClasses behavior
apps/provider-inventory/src/repositories/bid-screening/bid-screening.aggregator.spec.ts
Tests validate single and multiple distinct classes, deduplication of repeated classes, filtering of ephemeral and RAM storage, and per-unit independence in mixed deployments.
Storage class WHERE clause in repository query
apps/provider-inventory/src/repositories/bid-screening/bid-screening.repository.ts
#buildWhere adds an arrayContains predicate for units with non-empty persistentClasses, enabling JSONB-based filtering of providers by their declared storage classes.
Integration test harness and storage class filter tests
apps/provider-inventory/src/repositories/bid-screening/bid-screening.repository.integration.ts
Test harness extended with storageClasses seeding, storage parameter support, and persistentVolume() factory. Integration tests cover containment semantics, all-classes requirement, omission for units without persistent storage, and mixed-deployment filtering.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

The changes follow an established per-unit aggregation pattern already present in GPU token logic. The new persistent storage token collector mirrors GPU token extraction but simpler (no vendor/model parsing, only class deduplication). Query clause addition is straightforward containment filtering. Test coverage is thorough but uses consistent existing patterns. No complex state management, concurrency, or security concerns.

Possibly related PRs

  • akash-network/console#3188: Both PRs extend the per-unit aggregation and SQL filtering pattern in bid-screening; this PR applies the same approach to storage classes that #3188 introduced for GPU tokens.

Suggested labels

size: S, experienced-contributor

Suggested reviewers

  • baktun14
  • ygrishajev
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/db-filter-storage

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.98%. Comparing base (9417865) to head (2fd2b24).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3189      +/-   ##
==========================================
- Coverage   63.74%   62.98%   -0.76%     
==========================================
  Files        1091     1050      -41     
  Lines       26479    25452    -1027     
  Branches     6422     6255     -167     
==========================================
- Hits        16879    16031     -848     
+ Misses       8402     8236     -166     
+ Partials     1198     1185      -13     
Flag Coverage Δ *Carryforward flag
api 84.26% <ø> (ø) Carriedforward from 9417865
deploy-web 46.68% <ø> (ø) Carriedforward from 9417865
log-collector ?
notifications 91.06% <ø> (ø) Carriedforward from 9417865
provider-console 81.48% <ø> (ø) Carriedforward from 9417865
provider-inventory 82.30% <100.00%> (+0.17%) ⬆️
provider-proxy 86.08% <ø> (ø) Carriedforward from 9417865
tx-signer ?

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
...sitories/bid-screening/bid-screening.aggregator.ts 100.00% <100.00%> (ø)
...sitories/bid-screening/bid-screening.repository.ts 100.00% <100.00%> (ø)

... and 41 files with indirect coverage changes

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

@stalniy stalniy added this pull request to the merge queue May 18, 2026
Merged via the queue into main with commit 956629a May 18, 2026
56 checks passed
@stalniy stalniy deleted the feat/db-filter-storage branch May 18, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants