elastic / elastic/package-spec

Make validation error messages more meaningful

Open
#75 0 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
20
Forks
93
Avg merge
15h 10m
Merged PRs (30d)
12

Description

We just had a validation failure in this PR: https://github.com/elastic/integrations/pull/272. The failure looks like this to the package author:

```

[2020-11-02T09:28:35.769Z] packages/azure:

[2020-11-02T09:28:35.769Z] elastic-package lint

[2020-11-02T09:28:35.769Z] Lint the package

[2020-11-02T09:28:35.769Z] Error: linting package failed: found 3 validation errors:

[2020-11-02T09:28:35.769Z] 1. item [0f559cc0-f0d5-11e9-90ec-112a988266d5.json] is not allowed in folder [/var/lib/jenkins/workspace/Beats_integrations_PR-272/src/github.com/elastic/integrations/packages/azure/kibana/dashboard]

[2020-11-02T09:28:35.769Z] 2. item [41e84340-ec20-11e9-90ec-112a988266d5.json] is not allowed in folder [/var/lib/jenkins/workspace/Beats_integrations_PR-272/src/github.com/elastic/integrations/packages/azure/kibana/dashboard]

[2020-11-02T09:28:35.769Z] 3. item [87095750-f05a-11e9-90ec-112a988266d5.json] is not allowed in folder [/var/lib/jenkins/workspace/Beats_integrations_PR-272/src/github.com/elastic/integrations/packages/azure/kibana/dashboard]
```

This error message is not super helpful as it doesn't give the package author any idea of how to make it go away. In this case I believe the fix is to prefix the package name. We need to make our error messages more actionable. In general, here are some guidelines on writing good error messages:
- https://www.nngroup.com/articles/error-message-guidelines/
- https://uxplanet.org/how-to-write-good-error-messages-858e4551cd4
- https://spotify.design/article/the-art-of-the-error-message
- https://hackernoon.com/what-makes-a-good-error-710d02682a68

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.