Skip to content

fix(dataset-list): honor explicit metadata/provider filter#434

Merged
SgtPooki merged 2 commits intomasterfrom
fix/431-dataset-list-explicit-filter
May 4, 2026
Merged

fix(dataset-list): honor explicit metadata/provider filter#434
SgtPooki merged 2 commits intomasterfrom
fix/431-dataset-list-explicit-filter

Conversation

@SgtPooki
Copy link
Copy Markdown
Collaborator

@SgtPooki SgtPooki commented May 1, 2026

Closes #431.

What changed

dataset list --data-set-metadata <k=v> returned empty when the requested metadata diverged from DEFAULT_DATA_SET_METADATA (source=filecoin-pin, withIPFSIndexing=''), because createdWithFilecoinPin ran as a post-filter even after the explicit metadata filter already narrowed the set. Now the post-filter is skipped when the caller passed --data-set-metadata or --provider-id. Behavior with no flags is unchanged.

The empty-state message now distinguishes three cases:

  • explicit filter matched nothing → "No data sets matched the requested filter for this account."
  • default filter hid existing non-filecoin-pin datasets → suggests --all
  • no datasets at all → existing message

How to verify

pnpm test

Manual:

filecoin-pin dataset list --private-key "$KEY" --data-set-metadata source=storacha-migration
# previously: "No data sets managed by filecoin-pin..."
# now: lists matching datasets

Closes #431

`dataset list --data-set-metadata <k=v>` returned an empty list when
the requested metadata diverged from `DEFAULT_DATA_SET_METADATA`,
because `createdWithFilecoinPin` was applied as a post-filter even
after the explicit metadata filter narrowed the set.

Skip the `createdWithFilecoinPin` post-filter when the caller passed
`--data-set-metadata` or `--provider-id`. Keep the default
filecoin-pin-only filter when neither is set.

Replace the empty-state message with one of three variants depending
on context:
- explicit filter matched nothing
- default filter hid existing non-filecoin-pin datasets (suggest --all)
- no datasets at all (existing message)
Copilot AI review requested due to automatic review settings May 1, 2026 13:11
@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 May 1, 2026
@FilOzzy FilOzzy added this to FOC May 1, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC May 1, 2026
Copy link
Copy Markdown
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

Fixes dataset list behavior so explicit filters (--data-set-metadata / --provider-id) don’t get unintentionally overridden by the default “created with filecoin-pin” post-filter, and improves empty-state messaging to better reflect why no results are shown.

Changes:

  • Skip the createdWithFilecoinPin post-filter when an explicit provider/metadata filter is provided.
  • Add a filter-aware empty-state message (and a --all hint when the default filter hides results).
  • Add unit coverage for explicit-filter behavior and the new empty-state messaging paths.

Reviewed changes

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

File Description
src/data-set/run.ts Adjusts list filtering logic and computes a context-sensitive empty-state message.
src/data-set/display.ts Allows callers to provide a custom empty-state message for dataset list rendering.
src/test/unit/data-set.test.ts Adds tests covering explicit filter inclusion and empty message variants.

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

Comment thread src/data-set/run.ts Outdated
@SgtPooki SgtPooki self-assigned this May 1, 2026
Copy link
Copy Markdown
Collaborator Author

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

self review

@BigLep BigLep moved this from 📌 Triage to 🔎 Awaiting review in FOC May 1, 2026
@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting review to ✔️ Approved by reviewer in FOC May 4, 2026
@SgtPooki SgtPooki merged commit eaf22e4 into master May 4, 2026
12 checks passed
@SgtPooki SgtPooki deleted the fix/431-dataset-list-explicit-filter branch May 4, 2026 17:36
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC May 4, 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.

dataset list: --data-set-metadata filter ignored unless --all also passed

6 participants