-
Notifications
You must be signed in to change notification settings - Fork 40
Plugin E2E: OpenFeature support #2408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds OpenFeature (OFREP) support to @grafana/plugin-e2e, enabling developers to override OpenFeature-based feature flags in Playwright tests. As Grafana transitions toward multi-tenancy with OpenFeature replacing the legacy feature toggle mechanism, this change allows testing plugins that depend on OpenFeature flags without restarting the Grafana backend.
Changes:
- Added
openFeatureconfiguration option supporting all OpenFeature value types (boolean, string, number, object) with optional latency simulation - Implemented OFREP API interception that merges custom flags with backend flags for both bulk and single flag evaluation endpoints
- Introduced internal
bootDatafixture to consolidate boot data fetching and addednamespacefixture for multi-tenancy support
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/plugin-e2e/src/types.ts | Added FeatureFlagValue type, openFeature option to PluginOptions, namespace fixture to PluginFixture, and InternalFixtures type with updated documentation |
| packages/plugin-e2e/src/fixtures/openFeature.ts | Implemented OFREP route interception handlers for bulk and single flag evaluation with latency simulation |
| packages/plugin-e2e/src/fixtures/bootData.ts | Created internal fixture to fetch Grafana version and namespace from boot data |
| packages/plugin-e2e/src/fixtures/grafanaVersion.ts | Refactored to use bootData fixture instead of directly creating a page |
| packages/plugin-e2e/src/fixtures/namespace.ts | Added new fixture to provide namespace value with 'default' fallback |
| packages/plugin-e2e/src/fixtures/page.ts | Integrated OpenFeature route setup before page navigation with version check |
| packages/plugin-e2e/src/selectors/versionedAPIs.ts | Added OpenFeature OFREP endpoint patterns and path generators |
| packages/plugin-e2e/src/options.ts | Added default configuration for openFeature option |
| packages/plugin-e2e/src/index.ts | Wired up internal and public fixtures, added namespace to window type declaration |
| packages/plugin-e2e/tests/as-admin-user/openfeature/openFeature.spec.ts | Test suite verifying OFREP interception and flag merging behavior |
| packages/plugin-e2e/tests/as-admin-user/openfeature/openFeature-single.spec.ts | Test verifying single flag evaluation endpoint interception |
| packages/plugin-e2e/tests/as-admin-user/openfeature/openFeature-multi-type.spec.ts | Test suite verifying all OpenFeature value types in both bulk and single evaluation |
| packages/plugin-e2e/tests/as-admin-user/openfeature/openFeature-latency.spec.ts | Test verifying artificial latency application to OFREP responses |
| packages/plugin-e2e/tests/as-admin-user/openfeature/openFeature-compatibility.spec.ts | Test verifying backward compatibility without OpenFeature configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/plugin-e2e/tests/as-admin-user/openfeature/openFeature.spec.ts
Outdated
Show resolved
Hide resolved
packages/plugin-e2e/tests/as-admin-user/openfeature/openFeature-latency.spec.ts
Outdated
Show resolved
Hide resolved
packages/plugin-e2e/tests/as-admin-user/openfeature/openFeature.spec.ts
Outdated
Show resolved
Hide resolved
hugohaggmark
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 🚀 left a comment.
…e-latency.spec.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…e.spec.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Playwright test results
Troubleshooting404 when clicking on
|
|
🚀 PR was released in |
What this PR does / why we need it:
As part of its move toward multi-tenancy, Grafana’s existing feature toggle mechanism will be superseded by OpenFeature. This PR adds support for overriding OpenFeature (OFREP) flags in
@grafana/plugin-e2e, enabling Grafana and plugin developers to reliably test plugins that depend on OpenFeature-based feature flags.Each Playwright test runs in a separate browser context, allowing different OpenFeature flag states to be tested within a single end-to-end run without restarting the Grafana backend.
Fore more details, please refer to the design doc OpenFeature support in plugin-e2e Playwright tests.
OpenFeature flags can be defined globally and selectively overridden at the project level or even per test file.
Example usage:
Which issue(s) this PR fixes:
Fixes #2384
Special notes for your reviewer:
📦 Published PR as canary version:
Canary Versions✨ Test out this PR locally via:
npm install @grafana/plugin-e2e@3.2.0-canary.2408.21361640222.0 # or yarn add @grafana/plugin-e2e@3.2.0-canary.2408.21361640222.0