Skip to content

Add semantic validation for required variable groups#856

Merged
jsoriano merged 6 commits intoelastic:mainfrom
jsoriano:required-var-groups-semantic-validation
Jan 23, 2025
Merged

Add semantic validation for required variable groups#856
jsoriano merged 6 commits intoelastic:mainfrom
jsoriano:required-var-groups-semantic-validation

Conversation

@jsoriano
Copy link
Copy Markdown
Member

What does this PR do?

Add semantic validation for required variable groups added in #855.

Why is it important?

Adds some checks that can be useful to prevent mistakes when configuring required variable groups.

Related issues

Comment on lines +18 to +21
d, err := fs.ReadFile(fsys, "manifest.yml")
if err != nil {
return specerrors.ValidationErrors{specerrors.NewStructuredErrorf("failed to read manifest: %w", err)}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could these groups be defined in data stream manifests too?

If so, it would be needed to check for the required_vars there too

And another doubt, vars defined in the package manifest should also be merged in the vars defined in the data stream manifest for this validation?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Umm, yeah, not sure. Let's wait for the related discussion in the spec change. I remember some complexities merging these configurations in Fleet, we'd have to mimic the behavior here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added support for data streams, not sure if it handles all the places where variables can be defined, but we can add more cases later if there is any. Let me know if you can think about some additional case.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Added support for data streams, not sure if it handles all the places where variables can be defined, but we can add more cases later if there is any. Let me know if you can think about some additional case.

I don't recall any other additional case now, thanks for adding this support!

seanrathier
seanrathier previously approved these changes Jan 20, 2025
Copy link
Copy Markdown
Contributor

@seanrathier seanrathier left a comment

Choose a reason for hiding this comment

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

Thanks for the follow up! Much appreciated

@elasticmachine
Copy link
Copy Markdown

💚 Build Succeeded

History

cc @jsoriano

Copy link
Copy Markdown
Contributor

@mrodm mrodm left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines 609 to 612
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@mrodm mrodm self-requested a review January 23, 2025 11:14
Copy link
Copy Markdown
Contributor

@seanrathier seanrathier left a comment

Choose a reason for hiding this comment

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

Wow! Thanks again.

@jsoriano jsoriano merged commit f4e1b8b into elastic:main Jan 23, 2025
@jsoriano jsoriano deleted the required-var-groups-semantic-validation branch January 23, 2025 19:09
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