Fix/meta fields bad request#117229
Conversation
|
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
|
Hi @drempapis, I've created a changelog YAML for you. |
rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/520_fetch_fields.yml
Show resolved
Hide resolved
rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/520_fetch_fields.yml
Show resolved
Hide resolved
| @@ -130,16 +130,71 @@ fetch _seq_no via stored_fields: | |||
| fetch _seq_no via fields: | |||
There was a problem hiding this comment.
I think some of these tests require proper skip due to bwc and the fact that the error has changed.
There was a problem hiding this comment.
That's true. I tried to skip or requires based on this documentation, but I was not able to make it work. Do you have any idea how to "skip" this test? Maybe by using capabilities?
There was a problem hiding this comment.
You can look for instance at MapperFeatures and how we use NodeFeature to mark introduction of changes (i.e. "mapper.logsdb_default_ignore_dynamic_beyond_limit"). Make sure you only use those for testing using them in getTestFeatures.
For instance this test rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/logsdb/10_settings.yml uses one of the features included in MapperFeature.
Basically that provides you a way to gate test execution based on when some feature/change has been introduced. There has been some discussion around using node features for such gates but I don't see a better way to do it. In your case it would be something like "Change fields api response from 500 to 400" or something.
| --- | ||
| fetch _seq_no via fields: | ||
| - requires: | ||
| cluster_features: ["error_code_changed"] |
There was a problem hiding this comment.
I added a NodeFeature in MapperFeatures:: getTestFeatures to flag this method for execution. The naming is generic and can be used in other cases if needed.
javanna
left a comment
There was a problem hiding this comment.
Left a small comment, LGTM otherwise
| MapperService.LOGSDB_DEFAULT_IGNORE_DYNAMIC_BEYOND_LIMIT, | ||
| CONSTANT_KEYWORD_SYNTHETIC_SOURCE_WRITE_FIX | ||
| CONSTANT_KEYWORD_SYNTHETIC_SOURCE_WRITE_FIX, | ||
| ERROR_CODE_CHANGED |
There was a problem hiding this comment.
I wonder if we should include some more details about the change in the constant name, like META_FETCH_FIELDS_ERROR_CODE_CHANGED
There was a problem hiding this comment.
Thank you, @javanna; the name you proposed looks better.
|
Hi @drempapis, I've updated the changelog YAML for you. |
400 rather a 5xx error is returned when _source / _seq_no / _feature / _nested_path / _field_names is requested, via fields
In this pr, a
400error is returned when_source / _seq_no / _feature / _nested_path / _field_namesis requested, rather a5xxSolves #107136