OFREP Bulk flag evaluation (Core API)

Offen
#8,437 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
52/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
api, backend

Rechercherichtung

Beginne mit dem bestehenden Endpunkt zur Auswertung von Identity-Flags und anderen abgerechneten Endpunkten; vergleiche anschließend ihr Verhalten mit der Spezifikation von OFREP evaluateFlagsBulk. Implementiere und teste POST /ofrep/v1/evaluate/flags, sodass Bulk-Auswertung, Persistenz, Abrechnung, ETag und bedingte Antworten abgedeckt sind, wobei SSE-Stream-Lookups ausgeschlossen sind; abgeschlossen ist die Aufgabe, wenn alle Akzeptanzkriterien erfüllt sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

In order to implement the OFREP specification, our Core API needs a new endpoint that evaluates all flags in an environment given a set of identity traits. The Edge API counterpart is Flagsmith/edge-api#711.

An interpretation of the specification to our data model is as the following example:

(request)

POST /ofrep/v1/evaluate/flags HTTP/1.1
Host: {flagsmith_host}
X-API-Key: {client_side_environment_key}
Content-Type: application/json

{
  "context": {
    "targetingKey": "{identity.identifier}",
    "trait1": "value1",
    "trait2": "value2"
  }
}

(response)

HTTP/1.1 200 OK
Content-Type: application/json
ETag: "{etag}"

{
  "flags": [
    {
      "key": "{feature.name}",
      "value": "{feature_state.feature_state_value}",
      "reason": "TARGETING_MATCH"
    },
    {
      "key": "{feature.name}",
      "value": {feature_state.enabled},
      "reason": "STATIC"
    },
    {
      "key": "{feature.name}",
      "value": "{multivariate_feature_option.value}",
      "reason": "SPLIT",
      "variant": "{multivariate_feature_option.key}"
    }
  ],
  "metadata": {
    "version": "{environment.updated_at}"
  }
}

Acceptance criteria

  • Our API exposes a new endpoint POST /ofrep/v1/evaluate/flags compliant to the OFREP specification. As such, the endpoint:
    • Responds with an ETag header derived from the response body.
    • Accepts an If-None-Match header which can lead to a 304 Not Modified response.
    • Serves each flag's value as its remote configuration value, falling back to the flag's enabled state when no value is set.
    • Reports each flag's evaluation reason using the vocabulary OFREP defines.
    • Is billed similarly to other billed endpoints.
    • Persists the identity and its traits on the same terms as identity flag evaluation.

[!IMPORTANT]
Server-Sent Events stream lookups are out of scope for this issue.

Vorherrschende Sprache
Python
Sterne
7.1k
Forks
603
Ø Merge
3 T. 8 Std.
Gemergte PRs (30 T.)
102

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus Flagsmith/flagsmith

Alle Issues in Flagsmith/flagsmith

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.