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

[Bug]: Misleading/incorrect errors #449

Closed
howardjohn opened this issue May 31, 2024 · 4 comments
Closed

[Bug]: Misleading/incorrect errors #449

howardjohn opened this issue May 31, 2024 · 4 comments
Assignees
Labels
bug Something isn't working triage

Comments

@howardjohn
Copy link

Grizzly Version

v0.4.2

Expected Behavior

Should be able to watch with spec-only OR have a valid error

Actual Behavior

$ grr watch . main.libsonnet
Providers: Grafana - active, Mimir - inactive (mimir address is not set), Synthetic Monitoring - inactive (stack id is not set)
INFO[0000] Watching for changes
INFO[0001] Changes detected. Parsing
INFO[0001] Changes detected. Applying ./main.libsonnet
ERRO[0001] Error: parse error in './main.libsonnet': folder (-f) required with --onlyspec
$ grr watch --help
Providers: Grafana - active, Mimir - inactive (mimir address is not set), Synthetic Monitoring - inactive (stack id is not set)
2024/05/30 18:53:20 Usage:
  grr watch <dir-to-watch> <resource-path> [flags]

Flags:
  -h, --help               help for watch
  -J, --jpath strings      Specify an additional library search dir (right-most wins) (default [vendor,lib,.])
  -l, --log-level string   info, debug, warning, error (default "info")
  -o, --output string      Output format
  -t, --target strings     resources to target

-f and --onlyspec are not valid flags. Also, the --onlyspec is --only-spec on the commands it is on?

Steps to Reproduce

No response

@malcolmholmes
Copy link
Collaborator

Thanks for pointing this out. The reason you are seeing this is because your jsonnet contains a dashboard, but you have not specified a folder for that dashboard. You can either do so using the metadata/folder attribute in the JSON envelope that wraps the dashboard JSON itself, or you can set a single folder for all dashboards with -f, if your dashboard is raw JSON (no envelope), in which case, you'll also need to set --only-spec. Immediate fix: use envelopes and specify the folder.

#450 should fix this for the future.

@howardjohn
Copy link
Author

@malcolmholmes the issue here is many of the commands, even ones that say to use --only-spec, do not accept this flag. Like watch

@malcolmholmes
Copy link
Collaborator

@howardjohn #450 added these flags to watch, didn't it? Am I missing something?

@howardjohn
Copy link
Author

Looks like it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants