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

[kbn-es] Ensure serverless roles are up to date #169952

Open
pheyos opened this issue Oct 26, 2023 · 2 comments
Open

[kbn-es] Ensure serverless roles are up to date #169952

pheyos opened this issue Oct 26, 2023 · 2 comments
Labels
Team:Operations Team label for Operations Team

Comments

@pheyos
Copy link
Member

pheyos commented Oct 26, 2023

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.

@pheyos pheyos added the Team:Operations Team label for Operations Team label Oct 26, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@maximpn
Copy link
Contributor

maximpn commented Oct 30, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Operations Team label for Operations Team
Projects
None yet
Development

No branches or pull requests

3 participants