Skip to content

feat(e2e-version): replace React 19 preview image with version + feature toggles#239

Open
mckn wants to merge 2 commits into
mainfrom
mckn/react19-feature-toggles
Open

feat(e2e-version): replace React 19 preview image with version + feature toggles#239
mckn wants to merge 2 commits into
mainfrom
mckn/react19-feature-toggles

Conversation

@mckn
Copy link
Copy Markdown

@mckn mckn commented Jun 4, 2026

Why

React 19 testing previously relied on a dedicated dev-preview-react19 image tag — a bespoke, separately-published image. This created a hard coupling to an image that exists outside the normal Grafana release process.

Instead, React 19 should be tested against a real Grafana release with the react19 feature toggle enabled via GF_FEATURE_TOGGLES_ENABLE.

What changed

New enabledToggles field on every matrix item — a comma-separated string of Grafana feature toggles to enable for that run (empty string when none). Pass it to Grafana via the GF_FEATURE_TOGGLES_ENABLE environment variable.

Feature-toggle variants are fetched remotely. The list of variants (which Grafana minor + which toggles) is not baked into the action. It is fetched at runtime from feature-toggle-variants.json on the main branch:

https://raw.githubusercontent.com/grafana/plugin-actions/main/e2e-version/feature-toggle-variants.json

The file is a JSON object keyed by Grafana minor version (major.minor):

{
  "13.1": { "name": "grafana-enterprise", "enabledToggles": "react19" }
}

To add or remove a variant, merge a PR that edits this file on main. The change takes effect for all consumers immediately — regardless of which action version they have pinned — without cutting a new action release or asking consumers to bump their pinned ref. (The GitHub raw CDN means changes can take a few minutes to propagate.)

If the file cannot be fetched (network error, non-2xx, or malformed JSON), the action logs a warning and skips the feature-toggle variants; the rest of the matrix is unaffected.

React 19 resolution. Each variant resolves to the latest stable patch of its configured minor (e.g. the latest 13.1.x) from the versions API. If no matching stable release exists yet, that variant is silently omitted (the action does not fail).

Output example

Before:

[
  { "name": "grafana-enterprise", "version": "13.1.5" },
  { "name": "grafana-enterprise", "version": "dev-preview-react19" }
]

After:

[
  { "name": "grafana-enterprise", "version": "13.1.5", "enabledToggles": "" },
  { "name": "grafana-enterprise", "version": "13.1.5", "enabledToggles": "react19" }
]

The same Grafana release is tested twice — once as a baseline and once with the React 19 toggle enabled. No deduplication is applied; this is intentional.

Workflow update

Consumers should pass the new field to the container:

- name: Start Grafana
  run: |
    GRAFANA_VERSION=${{ matrix.GRAFANA_IMAGE.version }} \
    GRAFANA_IMAGE=${{ matrix.GRAFANA_IMAGE.name }} \
    GF_FEATURE_TOGGLES_ENABLE=${{ matrix.GRAFANA_IMAGE.enabledToggles }} \
    docker-compose up -d

…ure toggles

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mckn mckn requested a review from a team as a code owner June 4, 2026 16:14
@mckn mckn requested review from andresmgot, sunker and wbrowne June 4, 2026 16:14
@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented Jun 4, 2026

CLA assistant check
All committers have signed the CLA.

@mckn mckn moved this from 📬 Triage to 🔬 In review in Grafana Catalog Team Jun 5, 2026
@mckn mckn self-assigned this Jun 5, 2026
Source the feature-toggle variant list from a JSON file on main, fetched
at runtime, so variants can be added/removed by merging a PR without
requiring consumers to bump the pinned action version. Falls back to
skipping variants (with a warning) if the fetch fails.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔬 In review

Development

Successfully merging this pull request may close these issues.

1 participant