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

Adding maxPerRow for all panels and repeatDirection for row panel #140

Closed
wants to merge 1 commit into from

Conversation

vishnuchalla
Copy link

@vishnuchalla vishnuchalla commented Oct 11, 2023

These two attributes are required for below reasons.

  • maxPerRow: To limit on the max repeating panels in a row.
  • repeatDirection: To allow repeat direction either "h" or "v" for a row panel.

@CLAassistant
Copy link

CLAassistant commented Oct 11, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Vishnu Challa seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@vishnuchalla
Copy link
Author

@K-Phoen @iainlane @Duologic Requesting a review.

@Duologic
Copy link
Member

The files in gen/ are generated, please do not edit them by hand. Have a look at https://github.com/grafana/grafonnet/blob/main/DEVELOPMENT.md to see how the generate process works.

It looks like the schema for the row panel is missing these fields. These functions can be added in this file: https://github.com/grafana/grafonnet/blob/main/custom/row.libsonnet

@malcolmholmes
Copy link
Contributor

Better would be an issue or PR against grafana/grafana to update the underlying schema. Then Grafonnet would automatically pick it up.

@vishnuchalla
Copy link
Author

Better would be an issue or PR against grafana/grafana to update the underlying schema. Then Grafonnet would automatically pick it up.

Grafana upstream already seems to be having these elements in their schema, as we can see them in the UI dashboard.

@vishnuchalla
Copy link
Author

The files in gen/ are generated, please do not edit them by hand. Have a look at https://github.com/grafana/grafonnet/blob/main/DEVELOPMENT.md to see how the generate process works.

It looks like the schema for the row panel is missing these fields. These functions can be added in this file: https://github.com/grafana/grafonnet/blob/main/custom/row.libsonnet

Made these changes in schema as suggested instead of generated files. I am not sure why make generate is not working in my local and running into below error.

+ cp -r /home/vchalla/myforks/grafonnet/custom /home/vchalla/myforks/grafonnet/gen/grafonnet-v10.1.0
+ mapfile -t FILES
++ jsonnet -J vendor -S -c -m /home/vchalla/myforks/grafonnet/gen --tla-str version=v10.1.0 --tla-code-file schemas=github.com/grafana/grok/jsonnet/v10.1.0/imports.libsonnet --tla-code-file openapiSpec=github.com/grafana/grafana/public/openapi3.json -e '(import '\''generator/main.libsonnet'\'')'
RUNTIME ERROR: vendor/github.com/crdsonnet/crdsonnet/crdsonnet/renderEngines/ast.libsonnet:46:15-18 Unknown variable: xtd
	vendor/github.com/crdsonnet/crdsonnet/crdsonnet/renderEngines/main.libsonnet:4:8-32	object <anonymous>
	vendor/github.com/crdsonnet/crdsonnet/crdsonnet/render.libsonnet:24:13-32	object <anonymous>
	vendor/github.com/crdsonnet/crdsonnet/crdsonnet/render.libsonnet:26:15-26	object <anonymous>
	vendor/github.com/crdsonnet/crdsonnet/crdsonnet/render.libsonnet:38:7-8	
	vendor/github.com/crdsonnet/crdsonnet/crdsonnet/processor.libsonnet:31:7-51	function <anonymous>
	vendor/github.com/crdsonnet/crdsonnet/crdsonnet/main.libsonnet:146:12-48	function <anonymous>
	generator/alerting.libsonnet:(93:9)-(99:10)	thunk from <thunk <ast> from <function <anonymous>>>
	generator/utils.libsonnet:33:7-16	
	vendor/github.com/Duologic/jsonnet-libsonnet/utils.libsonnet:37:26-35	thunk from <function <anonymous>>
	vendor/github.com/Duologic/jsonnet-libsonnet/utils.libsonnet:27:28-31	thunk from <function <anonymous>>
	...
	vendor/github.com/Duologic/jsonnet-libsonnet/main.libsonnet:(33:5)-(44:6)	
	vendor/github.com/Duologic/jsonnet-libsonnet/main.libsonnet:(51:26)-(57:8)	object <anonymous>
	vendor/github.com/Duologic/jsonnet-libsonnet/main.libsonnet:59:20-30	thunk from <object <anonymous>>
	vendor/github.com/Duologic/jsonnet-libsonnet/main.libsonnet:59:9-31	object <anonymous>
	generator/alerting.libsonnet:(116:5)-(120:15)	function <anonymous>
	generator/alerting.libsonnet:63:25-85	object <anonymous>
	generator/alerting.libsonnet:15:20-32	object <anonymous>
	generator/main.libsonnet:21:9-20	object <anonymous>
	Field "grafonnet-v10.1.0/clean/alerting/contactPoint.libsonnet"	
	During manifestation	

+ jsonnet -S -c -m /home/vchalla/myforks/grafonnet/gen/grafonnet-v10.1.0 vendor/generator/dependencies.libsonnet
/home/vchalla/myforks/grafonnet/gen/grafonnet-v10.1.0/jsonnetfile.json
+ jrsonnet -J vendor -S -c -m /home/vchalla/myforks/grafonnet/gen/grafonnet-v10.1.0/docs/ --exec '(import '\''doc-util/main.libsonnet'\'').render(import '\''/home/vchalla/myforks/grafonnet/gen/grafonnet-v10.1.0/main.libsonnet'\'')'
./scripts/generate.sh: line 49: jrsonnet: command not found
+ finish
+ rm -rf /tmp/tmp.81Tat8DGoI
make: *** [Makefile:8: gen/grafonnet-latest] Error 127

@isarns
Copy link
Contributor

isarns commented Feb 28, 2024

./scripts/generate.sh: line 49: jrsonnet: command not found

@vishnuchalla You are missing jrsonnet

@Duologic
Copy link
Member

Hey, sorry for letting this hang for so long.

I've just been looking into this, trying to figure out why those fields aren't there. AFAICT these values don't make sense on a row panel, the direction is always vertical, regardless of the value in the json, that's just how rows work. The maxPerRow doesn't mean anything as nested rows don't exist.

repeatDirection is available on panels: example

maxPerRow fixed in #207 along with a few other fields.

@Duologic Duologic closed this May 28, 2024
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.

None yet

5 participants