Skip to content

Validate filter membership values - #30

Merged
yosriady merged 1 commit into
mainfrom
agent/filter-membership-validation
Jul 29, 2026
Merged

Validate filter membership values#30
yosriady merged 1 commit into
mainfrom
agent/filter-membership-validation

Conversation

@yosriady

@yosriady yosriady commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • validate every analytics --filters entry against the canonical {field, op, value} envelope
  • support one nested analytics property-filter level while rejecting recursive groups
  • require values for value-carrying operators and preserve value-less existence operators
  • reject literal | characters in Tinybird-backed analytics and segment membership arrays
  • document the delimiter restriction in CLI help, README, and generated skill reference

Why

Tinybird membership values use | as their transport separator and cannot decode a literal pipe inside an array member losslessly. The public API now documents and rejects that input. The CLI should fail locally with an actionable error instead of forwarding an invalid request and returning an API 400.

Validation

  • pnpm test - 165 passing, 18 live/integration tests skipped
  • pnpm typecheck
  • pnpm lint
  • pnpm build

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@yosriady

Copy link
Copy Markdown
Contributor Author

@codex review

@yosriady
yosriady marked this pull request as ready for review July 29, 2026 07:58
@yosriady yosriady changed the title Validate Tinybird filter membership values Validate filter membership values Jul 29, 2026
@yosriady
yosriady merged commit 741ea89 into main Jul 29, 2026
7 checks passed
@yosriady
yosriady deleted the agent/filter-membership-validation branch July 29, 2026 07:59

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b83ceba586

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/commands/analytics.ts
Comment on lines +180 to +182
parsed.forEach((filter, index) =>
validateAnalyticsFilter(filter, `--filters[${index}]`, true),
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate filters carried inside analytics params

When filters are supplied through pipe-specific --params—for example funnel's steps[*].filters, or flow's global_filters and step filters—this validation is never invoked because the --params branch serializes nested objects unchanged. Consequently a membership value such as ["alpha|beta"] is still sent to Tinybird and produces the API 400 this change is intended to catch locally; apply the delimiter validation to these documented filter-bearing params as well.

Useful? React with 👍 / 👎.

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.

1 participant