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

feat: adding validation for common recommended fields in sample #866

Closed

Conversation

harshilgajera-crest
Copy link
Contributor

@harshilgajera-crest harshilgajera-crest commented Jul 11, 2024

Added validation for same field present in cim_fields and missing_recommended_fields for sample and raise warning.

@harshilgajera-crest harshilgajera-crest changed the base branch from main to develop July 11, 2024 10:12
@harshilgajera-crest harshilgajera-crest changed the title Feat/updating recommended fields parsing feat: adding validation for common recommended fields in sample Jul 12, 2024
@harshilgajera-crest harshilgajera-crest marked this pull request as ready for review July 16, 2024 14:05
@harshilgajera-crest harshilgajera-crest requested a review from a team as a code owner July 16, 2024 14:05
Comment on lines +277 to +280
if common_fields:
LOGGER.warning(
f"Common fields found in both cim_fields and missing_recommended_fields for {event.sample_name} sample = {common_fields}"
)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we log an error and stop the execution if we something like this?

This would be technically a breaking change but I think we are fine with it - this would need to be documented properly in the PSA documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So if it is preset in both, then the tests would work as expected as it is appending both missing_recommended_fields and cim_fields at the end, so nothing would change from execution perspective.

Copy link
Contributor

Choose a reason for hiding this comment

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

So actually functionally it doesn't change anything, beside suggestion that there are fields defined as both missing_recommended_fields and cim_fields right?
If so, then if we aim for "clean" samples, then I'd break tests execution, as I think nobody will really pay an attention to warning somewhere in the middle of PSA tests execution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So actually functionally it doesn't change anything, beside suggestion that there are fields defined as both missing_recommended_fields and cim_fields right?

Yes

If so, then if we aim for "clean" samples, then I'd break tests execution, as I think nobody will really pay an attention to warning somewhere in the middle of PSA tests execution.

Breaking test execution for something like this feels a bit unnecessary, but I do agree with part that warning would be hard to find between so many logs of PSA.

@harshilgajera-crest
Copy link
Contributor Author

Closing this as this is implemented as a part of xml migration repo

@github-actions github-actions bot locked and limited conversation to collaborators Sep 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants