Skip to content

Conversation

@mrodm
Copy link
Contributor

@mrodm mrodm commented Sep 22, 2023

Relates elastic/package-spec#558

This PR adds the required support to filter errors based on the errors configuration (errors.yml validation.yml) for both directories and zip packages.

This PR depends on a new package-spec version including the structured errors.

@mrodm mrodm force-pushed the add_filter_errors_packages branch from 3bd1eeb to 246577f Compare September 26, 2023 09:00
@mrodm mrodm changed the title Add filter errors packages Add support to filter errors in packages based on codes Sep 26, 2023
@mrodm mrodm self-assigned this Sep 26, 2023
@mrodm mrodm requested a review from a team September 26, 2023 17:32
@mrodm mrodm marked this pull request as ready for review September 26, 2023 17:32
@mrodm
Copy link
Contributor Author

mrodm commented Sep 26, 2023

buildkite test this

1 similar comment
@mrodm
Copy link
Contributor Author

mrodm commented Sep 27, 2023

buildkite test this

cmd/lint.go Outdated
return fmt.Errorf("linting package failed: %w", err)
errs, skipped := validation.ValidateAndFilterFromPath(packageRootPath)
if skipped != nil {
logger.Infof("skipped errors: %v", skipped)
Copy link
Member

Choose a reason for hiding this comment

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

Should we log these at the warning level instead?

return allErrors, nil, nil
}

config, err := processors.LoadConfigFilter(fsys, configPath)
Copy link
Member

Choose a reason for hiding this comment

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

I still see this "processors" name as a too generic name, specially when used externally, but lets continue with it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just changed all the code in processors to be in the same specerrors.

mrodm and others added 3 commits September 27, 2023 18:57
Co-authored-by: Jaime Soriano Pastor <jaime.soriano@elastic.co>
Co-authored-by: Jaime Soriano Pastor <jaime.soriano@elastic.co>
Copy link
Contributor

@jlind23 jlind23 left a comment

Choose a reason for hiding this comment

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

LGTM

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @mrodm

@@ -0,0 +1,45 @@
# HOWTO: Filter errors based on Validation Codes
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added doc about how filtering errors should be set up.

@mrodm
Copy link
Contributor Author

mrodm commented Sep 29, 2023

Updated with the latest package-spec version and added a new doc about how to filter errors based on the codes.

@mrodm mrodm requested review from jlind23 and jsoriano September 29, 2023 15:57
Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

Ship it! ⛵

@mrodm mrodm merged commit 9d8ce35 into elastic:main Oct 2, 2023
@mrodm mrodm deleted the add_filter_errors_packages branch October 2, 2023 08:26
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.

4 participants