-
Notifications
You must be signed in to change notification settings - Fork 87
feat: Add validators for pipeline on_failure handler #1038
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
feat: Add validators for pipeline on_failure handler #1038
Conversation
- Add validation rule SVR00007 to verify all ingest pipelines set event.kind to pipeline_error in the global on_failure handler. - Add validation rule SVR00008 to verify all ingest pipelines set error.message in the global on_failure handler and that the failing processor type, tag, message, and pipeline are included in the error message.
|
/test |
teresaromero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
code/go/internal/validator/semantic/validate_pipeline_on_failure.go
Outdated
Show resolved
Hide resolved
mrodm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the support to validate ingest pipelines defined in the package root. Added a couple of minor comments.
| pipelineFileMetadatas = append(pipelineFileMetadatas, pipelineFileMetadata{ | ||
| filePath: file, | ||
| fullFilePath: fsys.Path(file), | ||
| dataStream: d.dataStream, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this dataStream field form pipelineFileMetadata struct used ?
Taking a look at #1010 and this PR, it looks like it is not. Could you check it? If not, should it be kept or used somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I haven't used the dataStream field yet, I've added it to keep it consistent with listFieldsFiles and fieldFileMetadata, which is what this function and struct were based on.
| return nil, fmt.Errorf("cannot read pipeline files from integration package: %w", err) | ||
| type pipelineDirMetadata struct { | ||
| dir string | ||
| dataStream string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe if dataStream field from pipelineFileMetadata can be removed, this one too could be removed.
|
@taylor-swanson i merged #1042 and used some codes as yours. please update the pr to resolve conflict. thnks! |
Not a problem, will get that fixed up! |
💚 Build Succeeded
History
|
teresaromero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, i guess this comment https://github.com/elastic/package-spec/pull/1038/changes#r2626165855 is already resolved by this one too https://github.com/elastic/package-spec/pull/1038/changes#r2627155051 ?? cc @mrodm
What does this PR do?
Checklist
test/packagesthat prove my change is effective.spec/changelog.yml.Related issues