Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

@vercel/flags-core: add flag/variant IDs for evaluation tracking#336

Draft
dferber90 wants to merge 1 commit into
main from
packed-ids
Draft

@vercel/flags-core: add flag/variant IDs for evaluation tracking #336
dferber90 wants to merge 1 commit into
main from
packed-ids

Conversation

@dferber90

@dferber90 dferber90 commented Mar 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add id and variantIds fields to Packed.FlagDefinition so evaluations can reference flags and variants by stable IDs
  • Evaluate now resolves variantId directly and includes it on EvaluationResult
  • New FLAG_EVALUATION event type sent to /v1/ingest via UsageTracker.trackEvaluation() for dashboard display
  • OpenFeature provider now returns variant on ResolutionDetails per the spec

Test plan

  • All 400 existing tests pass
  • TypeScript compiles cleanly
  • Backwards compatible: variantId is undefined when variantIds not present in definition
  • Verify FLAG_EVALUATION events appear in /v1/ingest with correct flagId/variantId/reason

🤖 Generated with Claude Code

... and evaluation tracking
Add `id` and `variantIds` fields to `Packed.FlagDefinition` so evaluations
can be reported with stable IDs. The evaluate function now resolves `variantId`
directly and includes it on `EvaluationResult`. A new `FLAG_EVALUATION` event
type is sent to `/v1/ingest` via `UsageTracker.trackEvaluation()`, and the
OpenFeature provider now returns `variant` on `ResolutionDetails`.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

vercel Bot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
shirt-shop Ready Ready Preview, Comment Mar 14, 2026 2:15pm
shirt-shop-api Ready Ready Preview, Comment Mar 14, 2026 2:15pm

@dferber90 dferber90 marked this pull request as draft March 14, 2026 14:22
variantId: options.variantId,
reason: options.reason,
deploymentId: process.env.VERCEL_DEPLOYMENT_ID,
region: process.env.VERCEL_REGION,

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.

can we send environment too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer

@miraan miraan miraan left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /