Skip to content
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

Row panel error after refactor of determining panel type. #49

Closed
joshlreese opened this issue May 17, 2023 · 4 comments · Fixed by #51 or #53
Closed

Row panel error after refactor of determining panel type. #49

joshlreese opened this issue May 17, 2023 · 4 comments · Fixed by #51 or #53

Comments

@joshlreese
Copy link

It appears that a few days ago when #43 was introduced, calling the panel.row.new function results in a missing argument error. I've included an example to reproduce this and the output below.

Code

local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet';

g.panel.row.new('Test')

Result

RUNTIME ERROR: Missing argument: value
	vendor/github.com/grafana/grafonnet/grafonnet-base/veneer/panel.libsonnet:10:7-22	function <anonymous>
	dashboard.jsonnet:3:1-27	$
	During evaluation

Expected result

{
   "datasource": {
      "type": "datasource",
      "uid": "-- Mixed --"
   },
   "title": "Test",
   "type": "row"
}

I've found that the following patch addresses the issue, though I'm not quite up to speed on what's best for grafonnet or jsonnet in general, and it's my understanding that #43 intended to derive this information automatically:

diff --git a/grafonnet-base/main.libsonnet b/grafonnet-base/main.libsonnet
index d797051..7db400a 100644
--- a/grafonnet-base/main.libsonnet
+++ b/grafonnet-base/main.libsonnet
@@ -104,6 +104,11 @@ local veneer = import './veneer/main.libsonnet';
       panel+: {
         row:
           root.coreLib.new(rowPanel)
+          + {
+              withType(): {
+                type: 'row',
+              }
+            }
           + root.packageDocMixin(version, 'row', 'panel.')
           + veneer.panel('row'),
       },

I'm aware that this is an experimental library, and look forward to leveraging it and contributing where we can. Thanks for working on it!

@MartinRoman7
Copy link

Hi team!

I'm running into the same issue.

@Duologic
Copy link
Member

Sorry for introducing this regression, I've fixed it in #51 .

@MartinRoman7
Copy link

Hi Grafonnet team!

Today we tested the grafonnet-latest package with the fix #51, and the issue still appears to be happening.

RUNTIME ERROR: Missing argument: value
	lib/dependencies/github.com/grafana/grafonnet/grafonnet-base/veneer/panel.libsonnet:10:7-22

@MartinRoman7
Copy link

Thanks! Now it's working. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants