Filter feature flags by group type in SDK and `/feature_flags` endpoint
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Inizia tracciando l’implementazione di get_all_flags del Ruby SDK e la gestione della richiesta o della risposta /feature_flags; l’issue non indica file o test specifici. Esamina come le definizioni dei flag espongono i metadati dei gruppi di targeting e determina dove deve essere applicato il filtraggio. Il lavoro è completo quando i chiamanti possono richiedere i flag per un tipo di gruppo mantenendo il comportamento esistente quando non viene fornito alcun filtro, con copertura per i flag person e per gli altri flag di gruppo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Context
We are using PostHog feature flags with group analytics to manage per-project feature toggles in our application. We have a project group type and want to allow users to opt-in/out of features for their specific project.
Current Behavior
When calling get_all_flags with a groups parameter, PostHog returns all feature flags regardless of their targeting type - person-based flags, group-based flags of all group types, etc.
client.get_all_flags(
distinct_id,
groups: { project: "project-uuid-here" }
)
# Returns ALL flags: person-based, project-group, space-group, etc.
The groups parameter serves as an evaluation context, not as a filter. There seems to be no way to retrieve only the flags that target a specific group type.
Expected Behavior
It would be useful to have the ability to filter the response to only include flags that match a specific group type. For example:
client.get_all_flags(
distinct_id,
groups: { project: "project-uuid" },
filter_by_group: :project # only return flags associated with a "project-uuid"
)
Use Case
We have a dashboard where users manage features for their project. We need to display only the feature flags relevant to that project's group type, not person-level flags or flags targeting other group types. Currently, the only workaround I can think of:
- Using a naming convention/prefix to identify flags by group type
- Making a separate REST API call to
/api/projects/{id}/feature_flags/to fetch flag definitions with metadata, then cross-referencing
Both might work (I have not yet verified the 2nd flow), but feel like they shouldn't be necessary given that the flag definitions already contain this information.
Additional Context
This also relates to the early access feature management not supporting groups. For applications that need organization/project-level feature opt-in (rather than individual user opt-in), the current tooling requires significant workarounds.
- Lingua principale
- Ruby
- Stelle
- 36
- Fork
- 34
- Merge medio
- 1g 13h
- PR unite (30g)
- 18
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PostHog/posthog-ruby
-
bug enhancement feature/flags
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
PostHog/posthog-ruby#189 ·
-
enhancement feature/flags
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
PostHog/posthog-ruby#188 ·
-
bug enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
PostHog/posthog-ruby#186 ·
-
enhancement team/logs
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
PostHog/posthog-ruby#185 ·
-
SDK references Apertadocumentation
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
PostHog/posthog-ruby#148 ·
Tutte le issue di PostHog/posthog-ruby
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Please Drop ruby 3.2 support Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
googleapis/google-api-ruby-client#28001 · 5 reazioni ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100