OFREP Single flag evaluation (Core API)

Offen
#8,435 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
55/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
openapi, python
Bereich
api, backend

Rechercherichtung

Beginne damit, die bestehende Auswertung von Identity-Flags und andere abgerechnete Endpunkte in der Core API zu lokalisieren, und vergleiche anschließend ihr Verhalten bei Requests, Persistenz und Abrechnung mit der Spezifikation von OFREP evaluateFlag. Überprüfe den Value-Fallback, das Reason-Vokabular, die 404-Antwort, die Persistenz von Identity-Attributen und das Abrechnungsverhalten des neuen Endpunkts anhand der Abnahmekriterien.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

In order to implement the OFREP specification, our Core API needs a new endpoint that evaluates a single flag given a set of identity traits. The Edge API counterpart is Flagsmith/edge-api#712.

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

(request)

POST /ofrep/v1/evaluate/flags/{feature.name} HTTP/1.1
Host: {flagsmith_host}
X-API-Key: {server_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

{
  "key": "{feature.name}",
  "value": "{multivariate_feature_option.value}",
  "reason": "SPLIT",
  "variant": "{multivariate_feature_option.key}"
}

(response, unknown flag)

HTTP/1.1 404 Not Found
Content-Type: application/json

{
  "key": "{feature.name}",
  "errorCode": "FLAG_NOT_FOUND"
}

Acceptance criteria

  • Our API exposes a new endpoint POST /ofrep/v1/evaluate/flags/{flagKey} compliant to the OFREP specification. As such, the endpoint:
    • Serves the flag's value as its remote configuration value, falling back to the flag's enabled state when no value is set.
    • Reports the flag's evaluation reason using the vocabulary OFREP defines.
    • Responds 404 Not Found when the environment has no such flag.
    • Is billed similarly to other billed endpoints.
    • Persists the identity and its traits on the same terms as identity flag evaluation.
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.