elasticsearch/x-pack/plugin/ml/qa/ml-with-security
Benjamin Trent cc25792390
[ML] fixing datafeed preview after allowing datafeed_config in job_config (#75625)
Since PR: https://github.com/elastic/elasticsearch/pull/74265

It is valid to supply a `datafeed_config` inside of a job config. But, the `_preview` API allows BOTH
a `datafeed_config` and `job_config` to be top-level objects. This can cause confusion and allowing
both a top level `datafeed_config` and an internal `job_config.datafeed_config` is unsupported 
behavior.

This commit protects against these weird scenarios and also strictly allows only a `job_config` with
a nested `datafeed_config` to be provided.

Consequently, on preview, the valid combinations are:

- Datafeed config ID only
- top level datafeed_config and top level job_config (without a nested datafeed_config)
- top level job_config with a nested datafeed_config

everything else is considered invalid
2021-07-26 08:11:35 -04:00
..
src/yamlRestTest/java/org/elasticsearch/smoketest
build.gradle [ML] fixing datafeed preview after allowing datafeed_config in job_config (#75625) 2021-07-26 08:11:35 -04:00
roles.yml