Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion e2e-version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ inputs:
required: false
description: 'Optionally, you can skip the Grafana dev image'
type: boolean
skip-grafana-react-19-preview-image:
required: false
description: 'Skip the Grafana React 19 preview image (e.g., grafana/grafana:dev-preview-react19). Defaults to false (include) for Grafana org repositories, true (skip) for others. Can be explicitly overridden.'
type: boolean
version-resolver-type:
required: true
type: choice
Expand All @@ -32,5 +36,5 @@ output:
description: 'Versions to test against'

runs:
using: node20
using: node24
main: ./dist/index.js
2 changes: 1 addition & 1 deletion e2e-version/dist/index.js

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions e2e-version/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const fs = require('fs/promises');
const path = require('path');

const SkipGrafanaDevImageInput = 'skip-grafana-dev-image';
const SkipGrafanaReact19PreviewImageInput = 'skip-grafana-react-19-preview-image';
const VersionResolverTypeInput = 'version-resolver-type';
const GrafanaDependencyInput = 'grafana-dependency';
const LimitInput = 'limit';
Expand All @@ -18,6 +19,30 @@ const VersionResolverTypes = {
async function run() {
try {
const skipGrafanaDevImage = core.getBooleanInput(SkipGrafanaDevImageInput);

// Determine default for React image based on repository owner
// Include by default for Grafana org repositories, skip for others
// GITHUB_REPOSITORY is in format "owner/repo", GITHUB_REPOSITORY_OWNER might not be available
const githubRepository = process.env.GITHUB_REPOSITORY || '';
const repositoryOwner = process.env.GITHUB_REPOSITORY_OWNER || githubRepository.split('/')[0] || '';
const isGrafanaOrg = repositoryOwner.toLowerCase() === 'grafana';

// Check if input was explicitly provided by checking if getInput returns non-empty string
// core.getInput() returns empty string when input is not provided
const reactImageInputValue = core.getInput(SkipGrafanaReact19PreviewImageInput);
const isExplicitlyProvided = reactImageInputValue !== '';

// If input is not explicitly provided, use org-based defaults
// If input is explicitly provided, always honor it using getBooleanInput
let skipGrafanaReact19PreviewImage;
if (!isExplicitlyProvided) {
// Input not provided: use defaults based on org
skipGrafanaReact19PreviewImage = !isGrafanaOrg; // false for Grafana org (include), true for external (skip)
} else {
// Input explicitly provided: always honor it
skipGrafanaReact19PreviewImage = core.getBooleanInput(SkipGrafanaReact19PreviewImageInput);
}

const grafanaDependency = core.getInput(GrafanaDependencyInput);
const versionResolverType = core.getInput(VersionResolverTypeInput) || VersionResolverTypes.PluginGrafanaDependency;
const limit = parseInt(core.getInput(LimitInput));
Expand Down Expand Up @@ -75,6 +100,11 @@ async function run() {
}
}

if (!skipGrafanaReact19PreviewImage) {
// Add hardcoded Grafana React 19 preview image
images.push({ name: 'grafana', version: 'dev-preview-react19' });
}

console.log('Resolved images: ', images);
core.setOutput(MatrixOutput, JSON.stringify(images));
return images;
Expand Down