-
Notifications
You must be signed in to change notification settings - Fork 72
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
Validate that Kibana asset IDs start with lowercase package names #65
Comments
I'm going with this feature. |
In #66 we added validation for the Kibana object filenames. However, we still need two more validations that are related:
I have adjusted the checklist in this issue's description to reflect this. |
@ycombinator It might be hard to implement this just with the spec. It might be possible to reach the goal with FormatCheckers (similarly to #83).
I wonder if it's not an edge case and this way we may introduce too much complexity in validation. I don't remember that dashboards refer to each other between packages. Are we sure we want to proceed with this requirement? It may happen that one dashboard will be adjusted (renamed), so tests for a referencing one will start failing. I would vote for excluding this requirement from the task scope. |
Let me take a step back and explain my original vision for semantic validations (#47). I'm okay going a different direction than what I was originally planning for but I think it might be worth explaining what I have in mind so we can discuss it. The package spec serves multiple purposes, one of which is validation. In my mind there are two types of validation: syntactic and semantic.
If we follow this model we can implement all the necessary validation, even for edge cases, which would only make packages more robust. And we can do it in a way that is somewhat easy to replicate in other language validators as well. Obviously there's a lot to do here and I don't expect us to do it all in a matter of days or even a couple of weeks. This is more of the long-term vision I had in mind when I originally created the WDYT? |
I admit I wasn't aware that this is a part of a bigger plan you had in mind. I thought it's rather a quick mitigation of an issue. I understand the idea of having syntactic and semantic validation, although wouldn't like to implement AST-like solution, considering the fact that we don't know schema of all files, e.g. Kibana schema files are not defined anywhere. I have two questions:
|
Yeah, I'm hoping to avoid building a series of quick mitigations, some of which might start to become hacky, and I'm also hoping to come up with a design that would allow us to handle any validation scenario, even if it's tricky or an edge case. I think we are starting to see such scenarios now so I thought it was the right time now to lay out a proper design for discussion.
Yes, the main goal here is to have a way to do syntactic validations (which we already have) and a way to do semantic validations (which we have in a couple places but nothing generic that can cover any semantic validations). Beyond that, I'm not married to any specific data structures we need to make these two phases happen. I will say that we could still have an AST approach even with partial schemas. Essentially what happens is the bytes that don't have a schema are preserved as raw in the AST. Obviously it implies that no semantic validations can be done on those bytes but it still lets us define semantic validations on the rest of the AST.
I'm generally ++ to this idea, but I'd do a bit of clean up / preparation first. Specifically, I'm thinking that we should tackle the language-agnostic test cases I mentioned in my previous comment first. This effort would benefit the existing Golang and planned TS validators, regardless of whether we implement semantic validation later or not. After that, we should definitely work on a POC for a semantic validator.
Personally, I would prefer at this point to build out the semantic validator. The more temporary quick fixes we introduce, the less we're going to be motivated to build the semantic validator (there will always be other priorities IMHO) and then we might find ourselves staring at a tech debt situation. I don't think the specific validation mentioned in this issue is super urgent so I think now is a good time to POC a more long-term, well-designed solution. Of course, one of the first rules we'd try to implement with this solution would be the one that addresses the validation mentioned in this issue! We could also try and time box the POC (1 week?) if the concern is that we might go down a rabbit hole with it. If we don't have a satisfactory POC by the end of the time box, we can go with the temporary quick fix and then return to the POC or something like that. But this is just my personal opinion. I'm happy to be challenged on any of the above and discuss it further! |
I agree with all your arguments :) One week time box sounds like a reasonable period, we can try it. Thank you for responding! |
Now that 7.9.0 is out, it should be used for the cluster.
Resolving in favor of #160 |
For packages that install Kibana assets (saved searches, visualizations, dashboards, etc.) we should ensure that the asset IDs start with the package name, all lowercased. This will help avoid conflicts with the same assets being installed by corresponding Beats modules (for users not using Agent).
This issue will be resolved via multiple PRs (please keep the list below updated with links to the various PRs)
id
fields inside Kibana object files have the same value as the object filename (minus the.json
extension, of course): Semantic validations #160P
references another Kibana object with IDi
, then there must exist a Kibana object file for idi
in packageP
:The text was updated successfully, but these errors were encountered: