Skip to content

Commit 1dd63a0

Browse files
Merge branch 'main' into ir-top-level-anchors
2 parents 5516be1 + 42f2ccd commit 1dd63a0

79 files changed

Lines changed: 6481 additions & 1891 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/release-please/release-please-config.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
".github/release-please",
4343
"cmd/wasm",
4444
"website"
45-
]
45+
],
46+
"release-as":"1.53.0"
4647
},
4748
"modules/core": {
4849
"release-type": "go",
@@ -80,7 +81,8 @@
8081
"extra-files": [
8182
"pyproject.toml",
8283
"README.md"
83-
]
84+
],
85+
"prerelease": true
8486
}
8587
}
8688
}

.github/workflows/ci.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ jobs:
191191
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
192192
with:
193193
fetch-depth: 100
194+
submodules: recursive
194195
- name: Get changed files in the docs folder
195196
id: changed-files-specific
196197
uses: marceloprado/has-changed-path@df1b7a3161b8fb9fd8c90403c66a9e66dfde50cb # v1.0.1
@@ -199,21 +200,21 @@ jobs:
199200
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
200201
with:
201202
python-version: 3.9
202-
- name: Setup Poetry
203+
- name: Install uv
203204
if: steps.changed-files-specific.outputs.changed == 'true'
204-
uses: abatilo/actions-poetry@3765cf608f2d4a72178a9fc5b918668e542b89b1 # v4.0.0
205-
- name: Poetry install
205+
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
206+
- name: uv sync
206207
if: steps.changed-files-specific.outputs.changed == 'true'
207208
working-directory: ./openfeature/providers/python-provider
208-
run: poetry install
209+
run: uv sync
209210
- name: lint black
210211
if: steps.changed-files-specific.outputs.changed == 'true'
211212
working-directory: ./openfeature/providers/python-provider
212-
run: poetry run black . --check
213+
run: uv run black . --check
213214
- name: Pytest
214215
if: steps.changed-files-specific.outputs.changed == 'true'
215216
working-directory: ./openfeature/providers/python-provider
216-
run: poetry run pytest
217+
run: uv run pytest
217218
GraddleWrapperValidation:
218219
runs-on: ubuntu-latest
219220
permissions:

.github/workflows/release-python-provider.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16-
- name: Build and publish to PyPi
17-
uses: JRubics/poetry-publish@4b3306307f536bbfcb559603629b3b4f6aef5ab8 # v2.1
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@bd01f18f5d15746b30239de8373e6f36c5be2f19 # v6.3.0
1818
with:
19-
package_directory: ./openfeature/providers/python-provider
20-
pypi_token: ${{ secrets.pypi_token }}
19+
version: "latest"
20+
- name: Build package
21+
working-directory: ./openfeature/providers/python-provider
22+
run: uv build
23+
- name: Publish to PyPi
24+
working-directory: ./openfeature/providers/python-provider
25+
run: uv publish --token ${{ secrets.pypi_token }}

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "openfeature/providers/python-provider/wasm-releases"]
2+
path = openfeature/providers/python-provider/wasm-releases
3+
url = https://github.com/go-feature-flag/wasm-releases.git

AGENTS.md

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ make help # Show all available commands
2121

2222
**Key Features:**
2323
- Feature flag implementation with OpenFeature standard support
24-
- Multiple storage backends (S3, HTTP, Kubernetes, MongoDB, Redis, etc.)
24+
- Multiple storage backends (S3, HTTP, Kubernetes, MongoDB, Redis, GCS, Azure, PostgreSQL, etc.)
2525
- Complex rollout strategies (A/B testing, progressive, scheduled)
26-
- Data export and notification systems
26+
- Data export, notification, and tracking systems
2727

2828
## 🏗️ Architecture
2929

@@ -36,28 +36,37 @@ OpenFeature SDKs → Relay Proxy (cmd/relayproxy/) → GO Module (ffclient)
3636
**Data Flow:** Retrievers fetch configs → Cache stores flags → Change detection triggers Notifiers → Evaluation generates Events → Exporters send data
3737

3838
**Key Components:**
39-
- **`ffclient`**: Core Go module for direct integration
39+
- **`ffclient` (root package)**: Core Go module for direct integration (root `.go` files are `package ffclient`)
4040
- **`cmd/relayproxy/`**: HTTP API server (uses Echo + Zap logging)
41-
- **`retriever/`**: Flag configuration sources (file, HTTP, S3, K8s, MongoDB, Redis, GitHub, GitLab, Bitbucket, PostgreSQL, Azure)
42-
- **`exporter/`**: Data export destinations (S3, File, Kafka, Kinesis, Webhook, GCS, Pub/Sub, SQS, Azure)
43-
- **`notifier/`**: Change notifications (Slack, Webhook, Discord, Teams, Logs)
44-
- **`modules/core`**: Core logic modules used by OpenFeature providers and WASM
41+
- **`retriever/`**: Flag configuration sources (File, HTTP, S3, K8s, MongoDB, Redis, GitHub, GitLab, Bitbucket, PostgreSQL, Azure Blob Storage, GCS)
42+
- **`exporter/`**: Data export destinations (S3, File, Kafka, Kinesis, Webhook, GCS, Pub/Sub, SQS, Azure, Logs, OpenTelemetry)
43+
- **`notifier/`**: Change notifications (Slack, Webhook, Discord, Microsoft Teams, Logs)
44+
- **`modules/core`**: Core logic module used by OpenFeature providers and WASM
4545

4646
## 📁 Directory Structure
4747

4848
**Root Level:**
49-
- `ffclient/`: Core client package
50-
- `cmd/`: Applications (relayproxy, cli, lint, editor, wasm)
49+
- Root `.go` files: Core `ffclient` package (`variation.go`, `feature_flag.go`, `config.go`, `tracking.go`, `variation_all_flags.go`, `config_exporter.go`)
50+
- `cmd/`: Applications (relayproxy, cli, lint, editor, jsonschema-generator, wasm)
5151
- `retriever/`, `exporter/`, `notifier/`: Integration packages
52-
- `modules/`: Separate Go modules (core, evaluation)
52+
- `modules/`: Separate Go modules (`core` only)
5353
- `internal/`: Internal packages (cache, flagstate, notification, signer)
54-
- `openfeature/providers/`: Some providers (Kotlin, Python) - most are in OpenFeature contrib repos
54+
- `ffcontext/`: Evaluation context package
55+
- `ffuser/`: User context (legacy)
56+
- `model/`: DTO models
57+
- `cmdhelpers/`: Shared CLI helpers (errors, retriever config)
58+
- `utils/`: Utilities (fflog, string helpers, constants)
59+
- `openfeature/providers/`: In-repo providers (Kotlin, Python, PHP, Ruby, Swift)
60+
- `openfeature/provider_tests/`: Integration tests for providers (Go, JS, Java, .NET)
5561
- `testutils/`, `testdata/`, `examples/`, `website/`
5662

5763
**Key Files:**
5864
- `variation.go`: Flag evaluation methods
59-
- `feature_flag.go`: Core logic
65+
- `variation_all_flags.go`: Bulk evaluation of all flags
66+
- `feature_flag.go`: Core logic and initialization
6067
- `config.go`: Configuration structure
68+
- `config_exporter.go`: Exporter configuration
69+
- `tracking.go`: Tracking/experimentation support
6170
- `Makefile`: Primary interface (use `make help`)
6271

6372
## 🔑 Key Concepts
@@ -72,7 +81,7 @@ OpenFeature SDKs → Relay Proxy (cmd/relayproxy/) → GO Module (ffclient)
7281

7382
**Interfaces:**
7483
- `Retriever`: `Retrieve(ctx context.Context) ([]byte, error)`
75-
- `Exporter`: `Export(ctx context.Context, events []FeatureEvent) error`, `IsBulk() bool`
84+
- `Exporter`: `Export(context.Context, *fflog.FFLogger, []ExportableEvent) error` + `IsBulk() bool`
7685
- `Notifier`: `Notify(cache DiffCache) error`
7786

7887
## 🛠️ Common Tasks
@@ -86,11 +95,11 @@ OpenFeature SDKs → Relay Proxy (cmd/relayproxy/) → GO Module (ffclient)
8695
6. Update docs
8796

8897
**OpenFeature Providers:**
89-
- Most providers in OpenFeature contrib repos (Go, JS, Java, .NET, Ruby, Swift, PHP)
90-
- Some in this repo: Kotlin (`kotlin-provider/`), Python (`python-provider/`)
91-
- Providers use `modules/core` for evaluation logic
98+
- Most providers in OpenFeature contrib repos (Go, JS, Java, .NET)
99+
- In this repo: Kotlin (`kotlin-provider/`), Python (`python-provider/`), PHP (`php-provider/`), Ruby (`ruby-provider/`), Swift (`swift-provider/`)
100+
- Providers use `modules/core` for evaluation logic
92101

93-
**Modules (`modules/core`:**
102+
**Modules (`modules/core`):**
94103
- Core logic separated for reuse by OpenFeature providers and WASM module
95104
- `modules/core`: Flag structures, context, models, utilities
96105
- Allows independent versioning and smaller dependency trees
@@ -117,7 +126,7 @@ func TestFunction(t *testing.T) {
117126
}
118127
```
119128

120-
**Commands:** `make test`, `make coverage`, `make bench`
129+
**Commands:** `make test`, `make coverage`, `make bench`, `make provider-tests`
121130
**Coverage:** Aim for 90%+, use `testify/assert`, mock external deps
122131

123132
## 📝 Code Patterns
@@ -155,11 +164,11 @@ pre-commit install # Install pre-commit hooks
155164
```
156165

157166
**Common Commands:**
158-
- **Build:** `make build`, `make build-relayproxy`, `make build-cli`, `make build-wasm`
159-
- **Dev:** `make watch-relayproxy`, `make watch-doc`
160-
- **Test:** `make test`, `make coverage`, `make bench`
167+
- **Build:** `make build`, `make build-relayproxy`, `make build-cli`, `make build-wasm`, `make build-wasi`, `make build-editor-api`, `make build-jsonschema-generator`, `make build-modules`
168+
- **Dev:** `make watch-relayproxy`, `make watch-doc`, `make serve-doc`
169+
- **Test:** `make test`, `make coverage`, `make bench`, `make provider-tests`
161170
- **Quality:** `make lint`, `make tidy`, `make vendor`
162-
- **Utils:** `make clean`, `make swagger`, `make generate-helm-docs`
171+
- **Utils:** `make clean`, `make swagger`, `make generate-helm-docs`, `make bump-helm-chart-version`, `make bump-wasm-contrib`
163172

164173
**Code Quality:**
165174
- Use `make lint` (golangci-lint)
@@ -168,9 +177,9 @@ pre-commit install # Install pre-commit hooks
168177

169178
## 🔍 Code Navigation
170179

171-
**Flag Evaluation:** `variation.go``feature_flag.go``internal/cache/``internal/flagstate/`
172-
**API Endpoints:** `cmd/relayproxy/api/routes_*.go``controller/``model/`
173-
**Configuration:** `config.go` (ffclient), `cmd/relayproxy/config/config.go` (relay proxy)
180+
**Flag Evaluation:** `variation.go``feature_flag.go``internal/cache/``internal/flagstate/`
181+
**API Endpoints:** `cmd/relayproxy/api/routes_*.go``controller/``model/`
182+
**Configuration:** `config.go` (ffclient), `cmd/relayproxy/config/config.go` (relay proxy)
174183
**Flag Format:** `.schema/flag-schema.json`, `testdata/flag-config.*`, https://gofeatureflag.org/docs
175184

176185
## 🔗 Important Files
@@ -185,11 +194,10 @@ pre-commit install # Install pre-commit hooks
185194

186195
**Key Libraries:** Echo (HTTP), Koanf (config), OpenTelemetry (observability), Prometheus (metrics), Testcontainers (integration tests)
187196

188-
**Monorepo Modules:**
189-
- Main module (root): Core library
197+
**Monorepo Modules (Go workspace):**
198+
- Main module (root): Core `ffclient` library
190199
- `modules/core`: Core data structures (used by providers/WASM/relayproxy)
191-
- `cmd/wasm`: WebAssembly evaluation
192-
- `openfeature/providers/`: Some providers (most in contrib repos)
200+
- `cmd/wasm`: WebAssembly/WASI evaluation
193201

194202
## 📚 Resources
195203

@@ -200,8 +208,8 @@ pre-commit install # Install pre-commit hooks
200208

201209
## 🎯 Quick Reference
202210

203-
**Entry Points:** `ffclient.Init()`, `cmd/relayproxy/main.go`, `cmd/cli/main.go`
204-
**Interfaces:** `Retriever`, `Exporter`, `Notifier`, `Cache`
211+
**Entry Points:** `ffclient.Init()`, `cmd/relayproxy/main.go`, `cmd/cli/main.go`
212+
**Interfaces:** `Retriever`, `Exporter`, `Notifier`, `Cache`
205213
**Config:** YAML/JSON/TOML flags, `ffclient.Config`, `cmd/relayproxy/config/config.go`
206214

207215
## ⚠️ What Agents Must NEVER Do

openfeature/providers/python-provider/.gitignore

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,10 @@ ipython_config.py
9494
# install all needed dependencies.
9595
#Pipfile.lock
9696

97-
# poetry
98-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99-
# This is especially recommended for binary packages to ensure reproducibility, and is more
100-
# commonly ignored for libraries.
101-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102-
#poetry.lock
97+
# uv
98+
# uv.lock is recommended to be included in version control for reproducibility.
99+
# https://docs.astral.sh/uv/concepts/projects/layout/#the-lockfile
100+
#uv.lock
103101

104102
# pdm
105103
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
@@ -158,3 +156,6 @@ cython_debug/
158156
# and can be added to the global gitignore or merged into this file. For a more nuclear
159157
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160158
.idea/
159+
160+
./gofeatureflag_python_provider/wasm/_wasi_version.txt
161+
./gofeatureflag_python_provider/wasm/gofeatureflag-evaluation_*.wasi

0 commit comments

Comments
 (0)