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

Support watching jsonnet via server #464

Merged
merged 4 commits into from
Jul 12, 2024
Merged

Conversation

malcolmholmes
Copy link
Contributor

@malcolmholmes malcolmholmes commented Jul 12, 2024

Currently, the grr serve command will only watch its resourcePath for changes. This works fine for a directory full of resources, such as JSON or YAML files. But for Jsonnet, it doesn't.

This PR adds a simple change to allow a user to provide an additional argument, that is, a "watchDir" path, so this command:

grr serve -w examples/grr.jsonnet examples

will allow a user to edit examples/test-dashboard.json, which is included in grr.jsonnet, and see that change show immediately in Grafana.

This PR also updates the docs for the Grizzly server, including this change in them.

@malcolmholmes malcolmholmes requested a review from a team as a code owner July 12, 2024 12:14
Copy link
Member

@Duologic Duologic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The additional path is a good quick fix to support jsonnet initially. If it can support multiple directories/files, we could do something like this:

grr serve -w examples/grr.jsonnet $(tk tool imports examples/grr.jsonnet)

@malcolmholmes malcolmholmes merged commit ca90aaa into main Jul 12, 2024
8 checks passed
@malcolmholmes malcolmholmes deleted the malcolmholmes/watch-jsonnet branch July 12, 2024 15:00
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.

2 participants