-
Notifications
You must be signed in to change notification settings - Fork 93
Closed
Copy link
Labels
enhancementNew feature or requestNew feature or request
Description
Requirements
Problem
Currently, we have inconsistent handling of selectors across different flagd services:
- Sync Service (
flagd/pkg/service/flag-sync/handler.go:34): Usesreq.GetSelector()from the request body - Evaluation Service: Uses
flagd-selectorheader - OFREP Service: Uses
flagd-selectorheader
This inconsistency can lead to confusion for users and makes the API surface less predictable.
Proposal
Normalize selector handling across all services by:
- Preferred approach: Use the
flagd-selectorheader as the primary method for all services - Backward compatibility: For the sync service, continue to accept
selectorin the request body as a fallback for a deprecation period
Implementation Strategy
- Update sync service to check for
flagd-selectorheader first - Fall back to request body
selectorfield if header is not present - Log deprecation warning when using request body selector
- Document the change and migration path
- Remove request body selector support in a future major version (e.g., v2.0.0)
Benefits
- Consistent API across all flagd services
- Easier to understand and use for developers
- Aligns with common patterns for query/filter parameters in gRPC metadata
Breaking Changes
None initially (backward compatible), but request body selector would be removed in a future major release.
Additional Context
The sync service currently processes the selector at:
selectorExpression := req.GetSelector()
selector := store.NewSelector(selectorExpression)This should be updated to prioritize metadata/header values while maintaining backward compatibility.
toddbaerttoddbaertCopilot
Sub-issues
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request