Skip to content

fix(metrics)!: fbt requires item IDs and prints readable results - #269

Merged
pviti merged 1 commit into
monorepofrom
fix/metrics-fbt
Oct 2, 2026
Merged

pviti merged 1 commit into
monorepofrom
fix/metrics-fbt

Conversation

@pviti

@pviti pviti commented Oct 2, 2026

Copy link
Copy Markdown
Member

metrics:fbt had two problems, checked against the FBT documentation of the Metrics API.

Changes

  • --in is required, --filter is removed.
    • The API requires filter.line_items.item_ids.in and answers 400 Bad Request without it. It documents no other filter for FBT, and the MCP Metrics fbt tool schema likewise accepts only item_ids.
    • Before, the CLI sent {} without --in, and with --in it mixed the user's --filter into the query.
    • The --in description now says that the orders must contain all the items: FBT's in is a logical AND, unlike the standard filters.
  • Readable output.
    • The results were printed with String(data), which gives [object Object],….
    • Each item is now one line: name (or ID), type and ID, number of orders.

Tests

5 fbt tests, 22 for the plugin:

  • request body;
  • output lines;
  • repeated --in flags;
  • --in required;
  • --filter refused;
  • API errors.

4 of them fail with the previous code.

The change is breaking for the command (--filter removed). The plugin goes to its next major with oclif 5 anyway (2.0.0).

🤖 Generated with Claude Code

The Metrics API refuses an FBT query without `filter.line_items.item_ids`
(400 Bad Request) and documents no other filter for it, so `--in` is now
required and `--filter` is gone: without --in the command sent an empty
query, and with it the filter was mixed into a query the API doesn't
define. The --in description says that the orders must contain all the
items (FBT's `in` is a logical AND).

The results were printed as `[object Object],…`: each item is now a line
with its name, type, ID and number of orders.

BREAKING CHANGE: metrics:fbt no longer has the --filter flag and requires --in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pviti
pviti merged commit b070d67 into monorepo Oct 2, 2026
6 checks passed
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.

1 participant