You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a result, this needs manual updating if the role definitions are changed upstream, which can be easy to miss. It would be good to have a mechanism in place to ensure we're not missing such role updates.
The text was updated successfully, but these errors were encountered:
While working on #169017 I figures out some pros and cons and would like to share some ideas here.
It's definitely much easier to use JSON files in Kibana than yaml files because
JSON files are already supported by Kibana
TS supports type inference, parsing yaml produces any so it's possible to type it to something we expect but it doesn't guarantee there is an expected type in runtime. An imported JSON file is safer here.
Yaml parsing libs require a string to parse yaml and this string can be read by reading a yaml file via node.js fs but it's not supported currently in Cypress files (maybe it's possible to tweak configs to make it working but some code works in a web browser). On top of this it's hard to guarantee the path is stable as roles should be in one common place and if moved to some other place it requires modifying all usages. It's much easier to do with imports than with strings in the code. I'd say Webpack yaml loader is preferable here.
It's impossible to skip yaml to JSON transformation as endpoints expect JSON data.
ES serverless role definitions for local dev and test environments are currently stored as a copy from the project controller: https://github.com/elastic/kibana/blob/main/packages/kbn-es/src/serverless_resources/roles.yml.
As a result, this needs manual updating if the role definitions are changed upstream, which can be easy to miss. It would be good to have a mechanism in place to ensure we're not missing such role updates.
The text was updated successfully, but these errors were encountered: