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

[Docs] Fix Java Api index administration usage (#28133) #28260

Merged
merged 1 commit into from
Mar 14, 2018

Conversation

cbuescher
Copy link
Member

The Java API documentation for index administration currenty is wrong because
the PutMappingRequestBuilder#setSource(Object... source) an
CreateIndexRequestBuilder#addMapping(String type, Object... source) methods
delegate to methods that check that the input arguments are valid key/value
pairs:

https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-admin-indices.html

This changes the docs so the java api code examples are included from
documentation integration tests so we detect compile and runtime issues earlier.

Closes #28131

@cbuescher
Copy link
Member Author

This previously broke the docs build when merged in #28133 because the included tests were not correctly checked out by the docs build script. I moved the test with the included code to a news package under "o.e.client.documentation" in the "server" module now because it doesn't really fit into the high-level client project. This will need a change similar to something like https://github.com/elastic/docs/blob/master/conf.yaml#L204 I think which I will need to add first.

@cbuescher
Copy link
Member Author

cbuescher commented Jan 17, 2018

Just created the necessary extension of the docs conf.yaml: elastic/docs#300

@martijnvg
Copy link
Member

@cbuescher Maybe move the test to ./clien/transport/src/test/java/o.e.client.documentation/ instead of where it is now? Other than that this is looks good.

@cbuescher cbuescher force-pushed the fix-28131 branch 2 times, most recently from 8561fde to a11c0cc Compare March 14, 2018 17:27
@cbuescher
Copy link
Member Author

@martijnvg thanks, good point. In the meantime, #28814 already introduced a documentation test class in server/src/test/java/org/elasticsearch/client/documentation which I'd like to extend instead. I wouldn't like moving it elsewhere at this point since the docs build also needs to be aware of this (elastic/docs#316) and it seems to work at least on master already.
I pushed an update which merges the two test classes, would you mind taking another quick look and leave a formal approvement if you think this looks good now?

The Java API documentation for index administration currenty is wrong because
the PutMappingRequestBuilder#setSource(Object... source) an
CreateIndexRequestBuilder#addMapping(String type, Object... source) methods
delegate to methods that check that the input arguments are valid key/value
pairs:

https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-admin-indices.html

This changes the docs so the java api code examples are included from
documentation integration tests so we detect compile and runtime issues earlier.

Closes elastic#28131
@cbuescher cbuescher requested a review from martijnvg March 14, 2018 17:45
@cbuescher cbuescher self-assigned this Mar 14, 2018
Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks @cbuescher!

@cbuescher cbuescher merged commit ae912cb into elastic:master Mar 14, 2018
cbuescher pushed a commit that referenced this pull request Mar 15, 2018
The Java API documentation for index administration currenty is wrong because
the PutMappingRequestBuilder#setSource(Object... source) an
CreateIndexRequestBuilder#addMapping(String type, Object... source) methods
delegate to methods that check that the input arguments are valid key/value
pairs. This changes the docs so the java api code examples are included from
documentation integration tests so we detect compile and runtime issues earlier.

Closes #28131
cbuescher pushed a commit that referenced this pull request Mar 15, 2018
The Java API documentation for index administration currenty is wrong because
the PutMappingRequestBuilder#setSource(Object... source) an
CreateIndexRequestBuilder#addMapping(String type, Object... source) methods
delegate to methods that check that the input arguments are valid key/value
pairs. This changes the docs so the java api code examples are included from
documentation integration tests so we detect compile and runtime issues earlier.

Closes #28131
cbuescher pushed a commit that referenced this pull request Mar 15, 2018
The Java API documentation for index administration currenty is wrong because
the PutMappingRequestBuilder#setSource(Object... source) an
CreateIndexRequestBuilder#addMapping(String type, Object... source) methods
delegate to methods that check that the input arguments are valid key/value
pairs. This changes the docs so the java api code examples are included from
documentation integration tests so we detect compile and runtime issues earlier.

Closes #28131
cbuescher pushed a commit that referenced this pull request Mar 15, 2018
The Java API documentation for index administration currenty is wrong because
the PutMappingRequestBuilder#setSource(Object... source) an
CreateIndexRequestBuilder#addMapping(String type, Object... source) methods
delegate to methods that check that the input arguments are valid key/value
pairs. This changes the docs so the java api code examples are included from
documentation integration tests so we detect compile and runtime issues earlier.

Closes #28131
martijnvg added a commit that referenced this pull request Mar 16, 2018
* es/6.x: (89 commits)
  Clarify requirements of strict date formats. (#29090)
  Clarify that dates are always rendered as strings. (#29093)
  [Docs] Fix link to Grok patterns (#29088)
  Fix starting on Windows from another drive (#29086)
  Use removeTask instead of finishTask in PersistentTasksClusterService (#29055)
  Added minimal docs for reindex api in java-api docs
  Allow overriding JVM options in Windows service (#29044)
  Clarify how to set compiler and runtime JDKs (#29101)
  Fix Parsing Bug with Update By Query for Stored Scripts (#29039)
  TEST: write ops should execute under shard permit (#28966)
  [DOCS] Add X-Pack upgrade details (#29038)
  Revert "Improve error message for installing plugin (#28298)"
  Docs: HighLevelRestClient#exists (#29073)
  Validate regular expressions in dynamic templates. (#29013)
  [Tests] Fix GetResultTests and DocumentFieldTests failures (#29083)
  Reenable LiveVersionMapTests.testRamBytesUsed on Java 9. (#29063)
  Mute failing GetResultTests and DocumentFieldTests
  [Docs] Fix Java Api index administration usage (#28260)
  Improve error message for installing plugin (#28298)
  Decouple XContentBuilder from BytesReference (#28972)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants