
from benchmark_runner.common.grafana.update_grafana_latest_value_mappings import UpdateGrafanaLatestValueMappings
from benchmark_runner.main.environment_variables import environment_variables

# Update perf main.libsonnet with last versions
environment_variables_dict = environment_variables.environment_variables_dict
update_grafana_mappings_value = UpdateGrafanaLatestValueMappings(main_libsonnet_path=environment_variables_dict.get('main_libsonnet_path', ''))
last_versions = update_grafana_mappings_value.get_last_elasticsearch_versions()
update_grafana_mappings_value.update_value_mappings_last_versions(last_versions=last_versions)
update_grafana_mappings_value.update_main_libsonnet()
