1fanwang opened a new pull request, #70353:
URL: https://github.com/apache/airflow/pull/70353

   ## Why
   
   Airflow has no vendor-neutral way to evaluate feature flags. Teams that want 
to canary or
   progressively roll out a change (a new operator behavior, a migration, an 
executor option) either
   hard-code a specific vendor SDK inside a `PythonOperator` or write a bespoke 
hook per backend.
   [OpenFeature](https://openfeature.dev) is the CNCF standard for exactly 
this: one evaluation API with
   a pluggable *provider* per backend (flagd, GrowthBook, Unleash, an in-house 
system).
   
   ## What
   
   A new `apache-airflow-providers-openfeature` provider:
   
   - `OpenFeatureHook` — registers an OpenFeature provider from a connection 
and evaluates
     boolean/string flags with a targeting context.
   - `FeatureFlagSensor` — waits until a flag is enabled for a targeting 
entity, e.g. hold a task until a
     rollout reaches its `dag_id`.
   - `FractionalProvider` — a dependency-free, in-process provider for 
deterministic percentage rollouts,
     so a canary works with no external flag daemon (mirrors flagd's fractional 
op).
   
   The hook also backs a cluster-policy pattern (documented in the provider 
index): consult a flag from
   `task_policy` in `airflow_local_settings.py` to flip a cohort's 
`pool`/`queue` and ramp a platform
   change like a canary, with no core change. That progressive-delivery use 
case is the point; the
   sensor and hook are the building blocks.
   
   Scope is intentionally small to open the discussion. Out of scope here: 
vendor-specific provider
   adapters (those belong to each vendor or the user's own code), named-client 
multi-provider setups, and
   any core change.
   
   ## Tests
   
   `providers/openfeature/tests/unit` — 11 unit tests: the fractional provider 
(determinism, ramp
   distribution, weighted variants), the hook (global-provider fallback, 
provider registration from a
   connection, register-once), and the sensor (enabled, disabled, expected). 
Green on Airflow 3.2.2 with
   openfeature-sdk 0.10.0.
   
   ## Risk
   
   Additive and opt-in: a new provider, nothing existing changes. 
`openfeature-sdk` is the only new
   dependency and is pulled only when the provider is installed. 
`FractionalProvider` is a convenience for
   testing and simple rollouts; production points OpenFeature at a real backend.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: GitHub Copilot CLI following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to