Skip to content

feat: compact data-set list output#580

Merged
BravoNatalie merged 8 commits into
filecoin-project:masterfrom
shrirajpawar4:compact-summary
Jun 24, 2026
Merged

feat: compact data-set list output#580
BravoNatalie merged 8 commits into
filecoin-project:masterfrom
shrirajpawar4:compact-summary

Conversation

@shrirajpawar4

Copy link
Copy Markdown
Contributor

Summary

Fixes #578

This updates filecoin-pin data-set list / ls to use a compact one-row-per-data-set table while keeping detailed output for data-set show, piece-status, and termination flows.

The compact list now includes:

  • ID
  • Status
  • Provider ID
  • Pieces
  • Size
  • CDN

Implementation

  • Added an internal list-size enrichment helper under src/core/data-set/.
  • Calculates list row sizes by paging active on-chain pieces with getActivePieces.
  • Sums piece sizes using getSizeFromPieceCID.
  • Skips piece fetching for zero-piece or non-live data sets.
  • Treats size lookup failures as non-fatal and renders those rows as unknown.
  • Added displayDataSetList() for compact table rendering.
  • Updated only runDataSetListCommand() to use the compact renderer.

Visual Evidence

Before, data-set list used the same detailed multi-section renderer as show.

After, data-set list renders compact rows like:

ID   Status  Provider ID  Pieces  Size     CDN
158  live    2            3       3.0 MiB  disabled

1 data sets, 3 active pieces, 3.0 MiB total known size
Run `filecoin-pin data-set show <id>` for full details.

Verification

Passed:

  pnpm exec vitest run --project unit src/test/unit/core-data-set.test.ts src/test/unit/data-set.test.ts src/test/unit/data-set-display.test.ts
  pnpm exec biome check --no-errors-on-unmatched --files-ignore-unknown=true src/core/data-set/enrich-list-sizes.ts src/data-set/display.ts src/data-set/run.ts src/test/unit/core-data-set.test.ts src/
  test/unit/data-set.test.ts src/test/unit/data-set-display.test.ts
  git diff --check

@FilOzzy FilOzzy added team/filecoin-pin "Filecoin Pin" project is a stakeholder for this work. team/fs-wg FOC working group is a stakeholder for this work, and thus wants to track it on their project board. labels Jun 17, 2026
@FilOzzy FilOzzy added this to FOC Jun 17, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Jun 17, 2026
@BravoNatalie BravoNatalie requested review from BravoNatalie and removed request for BravoNatalie June 17, 2026 09:48
Comment thread src/core/data-set/enrich-list-sizes.ts Outdated
@github-project-automation github-project-automation Bot moved this from 📌 Triage to ⌨️ In Progress in FOC Jun 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the filecoin-pin data-set list / ls CLI flow to render a compact, one-row-per-data-set table (while keeping the existing detailed rendering for show, piece-status, and termination flows).

Changes:

  • Added displayDataSetList() compact renderer and switched runDataSetListCommand() to use it.
  • Updated CLI unit tests to distinguish between compact list rendering vs detailed rendering.
  • Added unit tests for the new compact list output formatting.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/data-set/run.ts Switches data-set list to use the new compact renderer.
src/data-set/display.ts Adds displayDataSetList() and supporting helpers for compact table output.
src/test/unit/data-set.test.ts Updates mocks/assertions to reflect the new renderer split (displayDataSetList vs displayDataSets).
src/test/unit/data-set-display.test.ts New unit tests covering compact table output behavior.
src/test/unit/core-data-set.test.ts Updates piece-size mocking used by core data-set tests (currently inconsistent with runtime usage).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/test/unit/core-data-set.test.ts
Comment thread src/data-set/display.ts

@BravoNatalie BravoNatalie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Everything looks good, but I have one point about the changes in get-data-set-pieces.ts.

Comment thread src/data-set/display.ts Outdated
Comment thread src/data-set/display.ts
Comment thread src/core/data-set/get-data-set-pieces.ts Outdated

@BravoNatalie BravoNatalie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great!

@github-project-automation github-project-automation Bot moved this from ⌨️ In Progress to ✔️ Approved by reviewer in FOC Jun 21, 2026
@rjan90 rjan90 added this to the M4.5: GA Fast Follows milestone Jun 22, 2026
@BravoNatalie BravoNatalie merged commit f350d5b into filecoin-project:master Jun 24, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team/filecoin-pin "Filecoin Pin" project is a stakeholder for this work. team/fs-wg FOC working group is a stakeholder for this work, and thus wants to track it on their project board.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add compact summary view to data-set list

5 participants