OFREP Bulk flag evaluation (Core API)

オープン
#8,437 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
api, backend

調査の方向性

既存の identity flag 評価エンドポイントとその他の課金対象エンドポイントから始め、それらの動作を OFREP evaluateFlagsBulk 仕様と比較します。SSE ストリームのルックアップを除外したうえで、bulk 評価、永続化、課金、ETag、条件付きレスポンスをカバーするように POST /ofrep/v1/evaluate/flags を実装してテストします。すべての受け入れ条件を満たせば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
7.1k
フォーク
603
平均マージ
3日 8時間
マージ済み PR(30日)
102

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Flagsmith/flagsmith のほかの issue

Flagsmith/flagsmith の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。