-
Notifications
You must be signed in to change notification settings - Fork 46
fix: improve error messages #431
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
Conversation
02d0701 to
54be760
Compare
f51a759 to
919d50d
Compare
|
@sudo-suhas can you also add test cases for maintaining code coverage? The pipeline will break without that. |
- Include plugin name in the error message when it is not found.
- Include the validation failure message along with the line number in
the error message for plugin config.
- During lint, include the recipe name while printing errors that are
neither 'not found' nor 'invalid config' errors.
- During run, on run failure, include recipe name in the error log
context.
- Include details of the validation failures in the error message for
InvalidConfigError. This gets printed while trying to run the recipe.
BEFORE:
$ meteor run run ./_recipes/caramlstore-stg-wth-script-invalid.yaml
INFO[0000] running recipe recipe=caramlstore-stg-wth-script-invalid
ERRO[0000] error running recipe duration_ms=189 err="failed to setup processor: could not initiate processor \"script\": script processor init: invalid config" recipe=caramlstore-stg-wth-script-invalid records_count=0
ERRO[0000] failed to setup processor: could not initiate processor "script": script processor init: invalid config
...
$ meteor lint ./_recipes
caramlstore-stg-wth-script-invalid: invalid script processor config on line: 13
caramlstore-stg-wth-script-invalid: invalid script processor config: Key: 'Config.script' Error:Field validation for 'script' failed on the 'required' tag
recipe error: urn scope is required to generate unique urn
kafka-to-http: invalid labels processor config: Key: 'Config.labels' Error:Field validation for 'labels' failed on the 'required' tag
service_yaml-test: invalid extractor on line: 4
shield-integration: invalid shield extractor config: Key: 'Config.host' Error:Field validation for 'host' failed on the 'required' tag
...
AFTER:
$ meteor run run ./_recipes/caramlstore-stg-wth-script-invalid.yaml
INFO[0000] running recipe recipe=caramlstore-stg-wth-script-invalid
ERRO[0000] error running recipe duration_ms=205 err="failed to setup processor: could not initiate processor \"script\": script processor init: invalid config: * validation for field 'engine' failed on the 'oneof' tag\n\t * validation for field 'script' failed on the 'required' tag" recipe=caramlstore-stg-wth-script-invalid records_count=0
ERRO[0000] failed to setup processor: could not initiate processor "script": script processor init: invalid config:
* validation for field 'engine' failed on the 'oneof' tag
* validation for field 'script' failed on the 'required' tag recipe=caramlstore-stg-wth-script-invalid
...
$ meteor lint ./_recipes
caramlstore-stg-wth-script-invalid: invalid script processor config on line: 13: validation for field 'engine' failed on the 'oneof' tag
caramlstore-stg-wth-script-invalid: invalid script processor config: validation for field 'script' failed on the 'required' tag
kafka-to-http: recipe error: urn scope is required to generate unique urn
kafka-to-http: invalid labels processor config: validation for field 'labels' failed on the 'required' tag
service_yaml-test: invalid 'service_yaml' extractor on line: 4
shield-integration: invalid shield extractor config: validation for field 'host' failed on the 'required' tag
...
919d50d to
9171d7e
Compare
|
Have added tests where possible but haven't added any tests for the logging changes. W.r.t coverage, we aren't measuring the coverage for tests that have the |
the error message for plugin config.
neither 'not found' nor 'invalid config' errors.
context.
InvalidConfigError. This gets printed while trying to run the recipe.
BEFORE:
AFTER:
Closes #416