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

[Rest Api Compatibility] Clean up x-pack/plugin rest compat tests #74701

Merged
merged 26 commits into from
Jul 8, 2021

Conversation

pgomulka
Copy link
Contributor

@pgomulka pgomulka commented Jun 29, 2021

this PR removes tests which are not meant to be fixed (ml/, vectors/) to a separate "not to be fixed list" so that we can see which compatible changes are meant to be implemented.

relates #51816

@joegallo
Copy link
Contributor

joegallo commented Jul 1, 2021

#74843 took care of rollup/put_job/Test put_job in non-rollup index

@elastic elastic deleted a comment from pgomulka Jul 1, 2021
@pgomulka
Copy link
Contributor Author

pgomulka commented Jul 5, 2021

@elasticmachine update branch

@pgomulka
Copy link
Contributor Author

pgomulka commented Jul 5, 2021

@elasticmachine update branch

@elasticmachine
Copy link
Collaborator

merge conflict between base and head

@pgomulka pgomulka changed the title xpack enable all [Rest Api Compatibility] Clean up x-pack/plugin rest compat tests Jul 6, 2021
@pgomulka pgomulka self-assigned this Jul 6, 2021
@pgomulka pgomulka added the :Core/Infra/REST API REST infrastructure and utilities label Jul 6, 2021
@pgomulka pgomulka marked this pull request as ready for review July 6, 2021 13:20
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Jul 6, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

// the test uses sparse vector - not supported
'vectors/50_vector_stats/Usage stats on vector fields',

// ML - not needing compatible api
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give some more background to why ML doesn't need a compatible API? Surely users will expect all the Elasticsearch APIs to be subject to the same policies irrespective of the internal org structure of Elastic.


// ML - not needing compatible api
// some are failing due to cat api being called with JSON accept header
'ml*/*/*',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't the list of ML tests that don't work just stay as it was before instead of being expanded to include all ML tests? If not then it must be that this PR has introduced new problems for ML.

Even though the list of ML tests before was quite big, it was only a small fraction of all ML tests. Adding a total wildcard will mean others that should work are accidentally broken between now and 8.0 release.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good suggestion. I will remove the wildcard. I mistakenly assumed that all ML endpoints are not available to end users - which obviously not true.
I will remove the wildcard and see which exactly fail now

// ML - not needing compatible api
// some are failing due to cat api being called with JSON accept header
'ml*/*/*',
'_apis/Test cat trained models',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a truncation of 'ml/trained_model_cat_apis/Test cat trained models'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, good spot. it was a mistake

@@ -39,6 +40,10 @@ public InjectHeaders(Map<String, String> headers) {
@Override
public void transformTest(ObjectNode doNodeParent) {
ObjectNode doNodeValue = (ObjectNode) doNodeParent.get(getKeyToFind());
if(isCatOperation(doNodeValue)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than making this class aware of "cat." names, can you introduce conditional headers to inject ?

So something like :

public InjectHeaders(Map<String, String> headers, Map<Function<ObjectNode, Boolean>, Map<String, String>> conditionalHeaders)

Then if the function key evaluates to true, then insert the associated headers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakelandis good idea, but I think this should be just set of functions and when they all evaluate to true, then we would insert the headers.
implemented this here 7ad7093 - let me know what you think

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a separate PR for this change
#75001

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️ over at #75001 , thanks for the iterations.

Copy link
Contributor

@jakelandis jakelandis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (alot of the changes showing up in the diff here will be merged as #75001)

Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reducing the excluded ML tests to the minimum

@pgomulka
Copy link
Contributor Author

pgomulka commented Jul 8, 2021

@elasticmachine update branch

@pgomulka
Copy link
Contributor Author

pgomulka commented Jul 8, 2021

@elasticmachine update branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/REST API REST infrastructure and utilities >enhancement Team:Core/Infra Meta label for core/infra team v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants