Skip to content

Conversation

@spinillos
Copy link
Member

It depends on grafana/cog#880.

It adds missing configuration for PHP converters and it also fixes compiler errors.

@spinillos spinillos requested a review from a team as a code owner October 24, 2025 14:19
@spinillos spinillos self-assigned this Oct 24, 2025
@github-actions
Copy link

Note: the diff show code changes that would be introduced by this PR. Changes already on main are excluded.

🔎 Changes to grafana-foundation-sdk@next+cog-v0.0.x

diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/alerting/QueryDeserializer.java /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/alerting/QueryDeserializer.java
--- /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/alerting/QueryDeserializer.java	2025-10-24 14:21:48.180770407 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/alerting/QueryDeserializer.java	2025-10-24 14:21:18.753827869 +0000
@@ -12,12 +12,12 @@
 import com.grafana.foundation.cog.variants.UnknownDataquery;
 import com.grafana.foundation.cog.variants.Registry;
 
+import java.util.List;
 import com.grafana.foundation.cog.variants.Dataquery;
 import com.grafana.foundation.cog.variants.Registry;
 import com.grafana.foundation.cog.variants.PanelConfig;
 import com.grafana.foundation.common.DataSourceRef;
 import java.util.Map;
-import java.util.List;
 
 
 import java.io.IOException;
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/azuremonitor/BuilderQueryEditorOperatorTypeDeserializer.java /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/azuremonitor/BuilderQueryEditorOperatorTypeDeserializer.java
--- /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/azuremonitor/BuilderQueryEditorOperatorTypeDeserializer.java	2025-10-24 14:21:48.182770402 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/azuremonitor/BuilderQueryEditorOperatorTypeDeserializer.java	2025-10-24 14:21:18.755827864 +0000
@@ -10,6 +10,12 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 import java.io.IOException;
+import java.util.List;
+import com.grafana.foundation.cog.variants.Dataquery;
+import com.grafana.foundation.cog.variants.Registry;
+import com.grafana.foundation.cog.variants.PanelConfig;
+import com.grafana.foundation.common.DataSourceRef;
+import java.util.Map;
 
 public class BuilderQueryEditorOperatorTypeDeserializer extends JsonDeserializer<BuilderQueryEditorOperatorType> {
 
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/cloudwatch/QueryEditorOperatorTypeDeserializer.java /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/cloudwatch/QueryEditorOperatorTypeDeserializer.java
--- /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/cloudwatch/QueryEditorOperatorTypeDeserializer.java	2025-10-24 14:21:48.188770389 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/cloudwatch/QueryEditorOperatorTypeDeserializer.java	2025-10-24 14:21:18.761827848 +0000
@@ -10,12 +10,12 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 import java.io.IOException;
+import java.util.List;
 import com.grafana.foundation.cog.variants.Dataquery;
 import com.grafana.foundation.cog.variants.Registry;
 import com.grafana.foundation.cog.variants.PanelConfig;
 import com.grafana.foundation.common.DataSourceRef;
 import java.util.Map;
-import java.util.List;
 
 public class QueryEditorOperatorTypeDeserializer extends JsonDeserializer<QueryEditorOperatorType> {
 
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/cloudwatch/QueryEditorOperatorValueTypeDeserializer.java /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/cloudwatch/QueryEditorOperatorValueTypeDeserializer.java
--- /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/cloudwatch/QueryEditorOperatorValueTypeDeserializer.java	2025-10-24 14:21:48.188770389 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/cloudwatch/QueryEditorOperatorValueTypeDeserializer.java	2025-10-24 14:21:18.761827848 +0000
@@ -10,12 +10,12 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 import java.io.IOException;
+import java.util.List;
 import com.grafana.foundation.cog.variants.Dataquery;
 import com.grafana.foundation.cog.variants.Registry;
 import com.grafana.foundation.cog.variants.PanelConfig;
 import com.grafana.foundation.common.DataSourceRef;
 import java.util.Map;
-import java.util.List;
 
 public class QueryEditorOperatorValueTypeDeserializer extends JsonDeserializer<QueryEditorOperatorValueType> {
 
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/cloudwatch/StringOrArrayOfStringDeserializer.java /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/cloudwatch/StringOrArrayOfStringDeserializer.java
--- /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/cloudwatch/StringOrArrayOfStringDeserializer.java	2025-10-24 14:21:48.188770389 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/cloudwatch/StringOrArrayOfStringDeserializer.java	2025-10-24 14:21:18.761827848 +0000
@@ -10,12 +10,12 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 import java.io.IOException;
+import java.util.List;
 import com.grafana.foundation.cog.variants.Dataquery;
 import com.grafana.foundation.cog.variants.Registry;
 import com.grafana.foundation.cog.variants.PanelConfig;
 import com.grafana.foundation.common.DataSourceRef;
 import java.util.Map;
-import java.util.List;
 
 public class StringOrArrayOfStringDeserializer extends JsonDeserializer<StringOrArrayOfString> {
 
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboard/PanelDeserializer.java /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboard/PanelDeserializer.java
--- /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboard/PanelDeserializer.java	2025-10-24 14:21:48.196770372 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboard/PanelDeserializer.java	2025-10-24 14:21:18.768827829 +0000
@@ -12,6 +12,7 @@
 import com.grafana.foundation.cog.variants.UnknownDataquery;
 import com.grafana.foundation.cog.variants.Registry;
 
+import java.util.List;
 import com.grafana.foundation.cog.variants.Dataquery;
 import com.grafana.foundation.cog.variants.Registry;
 import com.grafana.foundation.cog.variants.PanelConfig;
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboard/StringOrArrayOfStringDeserializer.java /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboard/StringOrArrayOfStringDeserializer.java
--- /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboard/StringOrArrayOfStringDeserializer.java	2025-10-24 14:21:48.196770372 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboard/StringOrArrayOfStringDeserializer.java	2025-10-24 14:21:18.769827826 +0000
@@ -10,12 +10,12 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 import java.io.IOException;
+import java.util.List;
 import com.grafana.foundation.cog.variants.Dataquery;
 import com.grafana.foundation.cog.variants.Registry;
 import com.grafana.foundation.cog.variants.PanelConfig;
 import com.grafana.foundation.common.DataSourceRef;
 import java.util.Map;
-import java.util.List;
 
 public class StringOrArrayOfStringDeserializer extends JsonDeserializer<StringOrArrayOfString> {
 
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboard/StringOrMapDeserializer.java /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboard/StringOrMapDeserializer.java
--- /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboard/StringOrMapDeserializer.java	2025-10-24 14:21:48.196770372 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboard/StringOrMapDeserializer.java	2025-10-24 14:21:18.769827826 +0000
@@ -10,6 +10,7 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 import java.io.IOException;
+import java.util.List;
 import com.grafana.foundation.cog.variants.Dataquery;
 import com.grafana.foundation.cog.variants.Registry;
 import com.grafana.foundation.cog.variants.PanelConfig;
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboardv2beta1/StringOrArrayOfStringDeserializer.java /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboardv2beta1/StringOrArrayOfStringDeserializer.java
--- /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboardv2beta1/StringOrArrayOfStringDeserializer.java	2025-10-24 14:21:48.204770354 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboardv2beta1/StringOrArrayOfStringDeserializer.java	2025-10-24 14:21:18.776827807 +0000
@@ -10,11 +10,6 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 import java.io.IOException;
-import com.grafana.foundation.cog.variants.Dataquery;
-import com.grafana.foundation.cog.variants.Registry;
-import com.grafana.foundation.cog.variants.PanelConfig;
-import com.grafana.foundation.common.DataSourceRef;
-import java.util.Map;
 import java.util.List;
 
 public class StringOrArrayOfStringDeserializer extends JsonDeserializer<StringOrArrayOfString> {
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboardv2beta1/StringOrFloat64Deserializer.java /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboardv2beta1/StringOrFloat64Deserializer.java
--- /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboardv2beta1/StringOrFloat64Deserializer.java	2025-10-24 14:21:48.204770354 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboardv2beta1/StringOrFloat64Deserializer.java	2025-10-24 14:21:18.777827804 +0000
@@ -10,11 +10,6 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 import java.io.IOException;
-import com.grafana.foundation.cog.variants.Dataquery;
-import com.grafana.foundation.cog.variants.Registry;
-import com.grafana.foundation.cog.variants.PanelConfig;
-import com.grafana.foundation.common.DataSourceRef;
-import java.util.Map;
 import java.util.List;
 
 public class StringOrFloat64Deserializer extends JsonDeserializer<StringOrFloat64> {
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboardv2beta1/VariableValueDeserializer.java /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboardv2beta1/VariableValueDeserializer.java
--- /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboardv2beta1/VariableValueDeserializer.java	2025-10-24 14:21:48.206770350 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboardv2beta1/VariableValueDeserializer.java	2025-10-24 14:21:18.778827802 +0000
@@ -10,11 +10,6 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 import java.io.IOException;
-import com.grafana.foundation.cog.variants.Dataquery;
-import com.grafana.foundation.cog.variants.Registry;
-import com.grafana.foundation.cog.variants.PanelConfig;
-import com.grafana.foundation.common.DataSourceRef;
-import java.util.Map;
 import java.util.List;
 
 public class VariableValueDeserializer extends JsonDeserializer<VariableValue> {
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboardv2beta1/VariableValueSingleDeserializer.java /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboardv2beta1/VariableValueSingleDeserializer.java
--- /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboardv2beta1/VariableValueSingleDeserializer.java	2025-10-24 14:21:48.206770350 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/dashboardv2beta1/VariableValueSingleDeserializer.java	2025-10-24 14:21:18.779827799 +0000
@@ -10,11 +10,6 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 import java.io.IOException;
-import com.grafana.foundation.cog.variants.Dataquery;
-import com.grafana.foundation.cog.variants.Registry;
-import com.grafana.foundation.cog.variants.PanelConfig;
-import com.grafana.foundation.common.DataSourceRef;
-import java.util.Map;
 import java.util.List;
 
 public class VariableValueSingleDeserializer extends JsonDeserializer<VariableValueSingle> {
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/elasticsearch/InlineScriptDeserializer.java /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/elasticsearch/InlineScriptDeserializer.java
--- /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/elasticsearch/InlineScriptDeserializer.java	2025-10-24 14:21:48.210770341 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/elasticsearch/InlineScriptDeserializer.java	2025-10-24 14:21:18.783827788 +0000
@@ -10,12 +10,6 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 import java.io.IOException;
-import com.grafana.foundation.cog.variants.Dataquery;
-import com.grafana.foundation.cog.variants.Registry;
-import com.grafana.foundation.cog.variants.PanelConfig;
-import com.grafana.foundation.common.DataSourceRef;
-import java.util.Map;
-import java.util.List;
 
 public class InlineScriptDeserializer extends JsonDeserializer<InlineScript> {
 
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/librarypanel/PanelModelDeserializer.java /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/librarypanel/PanelModelDeserializer.java
--- /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/librarypanel/PanelModelDeserializer.java	2025-10-24 14:21:48.219770322 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/librarypanel/PanelModelDeserializer.java	2025-10-24 14:21:18.791827767 +0000
@@ -12,12 +12,12 @@
 import com.grafana.foundation.cog.variants.UnknownDataquery;
 import com.grafana.foundation.cog.variants.Registry;
 
+import java.util.List;
 import com.grafana.foundation.cog.variants.Dataquery;
 import com.grafana.foundation.cog.variants.Registry;
 import com.grafana.foundation.cog.variants.PanelConfig;
 import com.grafana.foundation.common.DataSourceRef;
 import java.util.Map;
-import java.util.List;
 
 
 import java.io.IOException;
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/tempo/StringOrArrayOfStringDeserializer.java /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/tempo/StringOrArrayOfStringDeserializer.java
--- /tmp/foundation-workspace-main/foundation-sdk/java/src/main/java/com/grafana/foundation/tempo/StringOrArrayOfStringDeserializer.java	2025-10-24 14:21:48.222770315 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/java/src/main/java/com/grafana/foundation/tempo/StringOrArrayOfStringDeserializer.java	2025-10-24 14:21:18.795827756 +0000
@@ -10,11 +10,6 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 import java.io.IOException;
-import com.grafana.foundation.cog.variants.Dataquery;
-import com.grafana.foundation.cog.variants.Registry;
-import com.grafana.foundation.cog.variants.PanelConfig;
-import com.grafana.foundation.common.DataSourceRef;
-import java.util.Map;
 import java.util.List;
 
 public class StringOrArrayOfStringDeserializer extends JsonDeserializer<StringOrArrayOfString> {
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Athena/VariantConfig.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Athena/VariantConfig.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Athena/VariantConfig.php	2025-10-24 14:21:48.021770536 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Athena/VariantConfig.php	2025-10-24 14:21:18.591828307 +0000
@@ -12,4 +12,5 @@
             convert: [DataqueryConverter::class, 'convert'],
         );
     }
+
 }
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Azuremonitor/VariantConfig.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Azuremonitor/VariantConfig.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Azuremonitor/VariantConfig.php	2025-10-24 14:21:48.024770535 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Azuremonitor/VariantConfig.php	2025-10-24 14:21:18.595828296 +0000
@@ -12,4 +12,5 @@
             convert: [AzureMonitorQueryConverter::class, 'convert'],
         );
     }
+
 }
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Bigquery/VariantConfig.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Bigquery/VariantConfig.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Bigquery/VariantConfig.php	2025-10-24 14:21:48.026770533 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Bigquery/VariantConfig.php	2025-10-24 14:21:18.597828291 +0000
@@ -12,4 +12,5 @@
             convert: [DataqueryConverter::class, 'convert'],
         );
     }
+
 }
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Cloudwatch/VariantConfig.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Cloudwatch/VariantConfig.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Cloudwatch/VariantConfig.php	2025-10-24 14:21:48.030770531 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Cloudwatch/VariantConfig.php	2025-10-24 14:21:18.601828280 +0000
@@ -37,4 +37,5 @@
 }),
         );
     }
+
 }
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Cog/DataqueryConfig.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Cog/DataqueryConfig.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Cog/DataqueryConfig.php	2025-10-24 14:21:48.030770531 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Cog/DataqueryConfig.php	2025-10-24 14:21:18.601828280 +0000
@@ -15,15 +15,22 @@
      * @var (callable(Dataquery): string)|null
      */
     public $convert;
+    
+    /**
+     * @var (callable(\Grafana\Foundation\Dashboardv2beta1\DataQueryKind): string)|null
+     */
+    public $convertv2;
 
     /**
      * @param callable(array<string, mixed>): Dataquery $fromArray
      * @param (callable(Dataquery): string)|null $convert
+     * @param (callable(\Grafana\Foundation\Dashboardv2beta1\DataQueryKind): string)|null $convertv2
      */
-    public function __construct(string $identifier, callable $fromArray, ?callable $convert = null)
+    public function __construct(string $identifier, callable $fromArray, ?callable $convert = null, ?callable $convertv2 = null)
     {
         $this->identifier = $identifier;
         $this->fromArray = $fromArray;
         $this->convert = $convert;
+        $this->convertv2 = $convertv2;
     }
 }
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Cog/PanelcfgConfig.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Cog/PanelcfgConfig.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Cog/PanelcfgConfig.php	2025-10-24 14:21:48.030770531 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Cog/PanelcfgConfig.php	2025-10-24 14:21:18.601828280 +0000
@@ -7,7 +7,7 @@
     public readonly string $identifier;
 
     /**
-     * @var (callable(\Grafana\Foundation\Dashboard\Panel): string)|null
+     * @var (callable(mixed): string)|null
      */
     public $convert;
 
@@ -22,7 +22,7 @@
     public $fieldConfigFromArray;
 
     /**
-     * @param (callable(\Grafana\Foundation\Dashboard\Panel): string)|null $convert
+     * @param (callable(mixed): string)|null $convert
      * @param (callable(array<string, mixed>): object)|null $optionsFromArray
      * @param (callable(array<string, mixed>): object)|null $fieldConfigFromArray
      */
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Cog/Runtime.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Cog/Runtime.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Cog/Runtime.php	2025-10-24 14:21:48.030770531 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Cog/Runtime.php	2025-10-24 14:21:18.601828280 +0000
@@ -126,7 +126,7 @@
         return $queries;
     }
 
-    public function convertPanelToCode(\Grafana\Foundation\Dashboard\Panel $panel, string $panelType): string
+    public function convertPanelToCode(mixed $panel, string $panelType): string
     {
         if (!$this->panelcfgVariantExists($panelType)) {
             return '/* could not convert panel to PHP */';
@@ -157,4 +157,18 @@
 
         return $convert($dataquery);
     }
+
+    public function convertDataQueryKindToCode(\Grafana\Foundation\Dashboardv2beta1\DataQueryKind $dataquery, string $group): string 
+    {
+    	if (!isset($this->dataqueryVariants[$group])) {
+            return '/* could not convert DataQueryKind to PHP */';
+        }
+    
+        $convert = $this->dataqueryVariants[$group]->convertv2;
+        if ($convert === null) {
+            return '/* could not convert DataQueryKind to PHP */';
+        }
+        
+        return $convert($dataquery);
+    }
 }
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Dashboardv2beta1/VizConfigKind.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Dashboardv2beta1/VizConfigKind.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Dashboardv2beta1/VizConfigKind.php	2025-10-24 14:21:48.050770520 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Dashboardv2beta1/VizConfigKind.php	2025-10-24 14:21:18.621828226 +0000
@@ -41,8 +41,8 @@
             group: $data["group"] ?? null,version: $data["version"] ?? null,spec: isset($data['spec']) ? (function($input) {
         /** @var array{options?: mixed, fieldConfig?: mixed} $spec */
         $spec = $input['spec'];
-        /** @var string $kind */
-        $kind = $input['kind'] ?? '';
+        /** @var string $group */
+        $group = $input['group'] ?? '';
         return new VizConfigSpec(
             options: isset($spec["options"]) ? (function(string $panelType, $panel) {
         /** @var array<string, mixed> $options */
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Datasource/VariantConfig.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Datasource/VariantConfig.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Datasource/VariantConfig.php	2025-10-24 14:21:48.051770519 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Datasource/VariantConfig.php	2025-10-24 14:21:18.622828223 +0000
@@ -12,4 +12,5 @@
             convert: [DataqueryConverter::class, 'convert'],
         );
     }
+
 }
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Elasticsearch/VariantConfig.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Elasticsearch/VariantConfig.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Elasticsearch/VariantConfig.php	2025-10-24 14:21:48.060770514 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Elasticsearch/VariantConfig.php	2025-10-24 14:21:18.631828199 +0000
@@ -12,4 +12,5 @@
             convert: [DataqueryConverter::class, 'convert'],
         );
     }
+
 }
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Expr/VariantConfig.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Expr/VariantConfig.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Expr/VariantConfig.php	2025-10-24 14:21:48.063770512 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Expr/VariantConfig.php	2025-10-24 14:21:18.634828191 +0000
@@ -49,4 +49,5 @@
 }),
         );
     }
+
 }
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Googlecloudmonitoring/VariantConfig.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Googlecloudmonitoring/VariantConfig.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Googlecloudmonitoring/VariantConfig.php	2025-10-24 14:21:48.066770510 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Googlecloudmonitoring/VariantConfig.php	2025-10-24 14:21:18.636828185 +0000
@@ -12,4 +12,5 @@
             convert: [CloudMonitoringQueryConverter::class, 'convert'],
         );
     }
+
 }
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Grafanapyroscope/VariantConfig.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Grafanapyroscope/VariantConfig.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Grafanapyroscope/VariantConfig.php	2025-10-24 14:21:48.066770510 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Grafanapyroscope/VariantConfig.php	2025-10-24 14:21:18.637828183 +0000
@@ -12,4 +12,5 @@
             convert: [DataqueryConverter::class, 'convert'],
         );
     }
+
 }
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Loki/VariantConfig.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Loki/VariantConfig.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Loki/VariantConfig.php	2025-10-24 14:21:48.069770509 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Loki/VariantConfig.php	2025-10-24 14:21:18.640828175 +0000
@@ -12,4 +12,5 @@
             convert: [DataqueryConverter::class, 'convert'],
         );
     }
+
 }
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Parca/VariantConfig.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Parca/VariantConfig.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Parca/VariantConfig.php	2025-10-24 14:21:48.070770508 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Parca/VariantConfig.php	2025-10-24 14:21:18.641828172 +0000
@@ -12,4 +12,5 @@
             convert: [DataqueryConverter::class, 'convert'],
         );
     }
+
 }
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Prometheus/VariantConfig.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Prometheus/VariantConfig.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Prometheus/VariantConfig.php	2025-10-24 14:21:48.071770508 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Prometheus/VariantConfig.php	2025-10-24 14:21:18.642828169 +0000
@@ -12,4 +12,5 @@
             convert: [DataqueryConverter::class, 'convert'],
         );
     }
+
 }
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Tempo/VariantConfig.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Tempo/VariantConfig.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Tempo/VariantConfig.php	2025-10-24 14:21:48.074770506 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Tempo/VariantConfig.php	2025-10-24 14:21:18.644828164 +0000
@@ -12,4 +12,5 @@
             convert: [TempoQueryConverter::class, 'convert'],
         );
     }
+
 }
diff --new-file --unidirectional-new-file '--color=never' --unified --recursive '--exclude=.git' '--exclude=gradle.properties' '--exclude=pyproject.toml' '--exclude=package.json' '--exclude=*.md' /tmp/foundation-workspace-main/foundation-sdk/php/src/Testdata/VariantConfig.php /tmp/foundation-workspace-current/foundation-sdk/php/src/Testdata/VariantConfig.php
--- /tmp/foundation-workspace-main/foundation-sdk/php/src/Testdata/VariantConfig.php	2025-10-24 14:21:48.075770505 +0000
+++ /tmp/foundation-workspace-current/foundation-sdk/php/src/Testdata/VariantConfig.php	2025-10-24 14:21:18.646828158 +0000
@@ -12,4 +12,5 @@
             convert: [DataqueryConverter::class, 'convert'],
         );
     }
+
 }

@spinillos spinillos merged commit 193e297 into main Oct 27, 2025
7 checks passed
@spinillos spinillos deleted the php/converters_v2 branch October 27, 2025 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants