Skip to content

Update RestClientDocumentation.java#34727

Closed
wangzhenhui1992 wants to merge 4 commits intoelastic:masterfrom
wangzhenhui1992:patch-2
Closed

Update RestClientDocumentation.java#34727
wangzhenhui1992 wants to merge 4 commits intoelastic:masterfrom
wangzhenhui1992:patch-2

Conversation

@wangzhenhui1992
Copy link
Copy Markdown
Contributor

@wangzhenhui1992 wangzhenhui1992 commented Oct 23, 2018

Refer to an inner class as an inner class in the documentation so it is easier to read.

Issue: #34700

@javanna
Copy link
Copy Markdown
Contributor

javanna commented Oct 23, 2018

test this please

@wangzhenhui1992
Copy link
Copy Markdown
Contributor Author

wangzhenhui1992 commented Oct 23, 2018

test this please

@javanna
Thank you for reminding.
But this class is just used to show the snippets in document and I could not find a test class of it.
Did you mean that I need add one?

@wangzhenhui1992
Copy link
Copy Markdown
Contributor Author

wangzhenhui1992 commented Oct 23, 2018

17:44:50 [ant:checkstyle] [ERROR] /var/lib/jenkins/workspace/elastic+elasticsearch+pull-request/client/rest/src/test/java/org/elasticsearch/client/documentation/RestClientDocumentation.java:81: Code snippets longer than 76 characters get cut off when rendered in the docs [SnippetLength]
17:44:50 > Task :client:rest:checkstyleTest FAILED
17:44:50
17:44:50 FAILURE: Build failed with an exception.

It seems that something wrong with the Code snippet length in RestClientDocumentation.java,
Java class format is according to java-language-formatting-guidelines.
I'm thinking of submiting an issue to add a rule of Java class for code snippet .
Or someone fixes the CI scripts.
Can someone tell me what I should do.

@javanna
Copy link
Copy Markdown
Contributor

javanna commented Oct 23, 2018

hi @wangzhenhui1992 sorry about the confusion, "test this please" is a comment to trigger a build through our jenkins bot :)

The build failed because of a style check, as the line is now too long and would not be nicely displayed in our docs. The problem is that HttpAsyncResponseConsumerFactory.HeapBufferedResponseConsumerFactory is too long alone to fit nicely in our docs. I wonder if we should not make this change then. Thoughts @nik9000 ?

@wangzhenhui1992
Copy link
Copy Markdown
Contributor Author

wangzhenhui1992 commented Oct 24, 2018

@javanna @nik9000
What about defining 30 * 1024 * 1024 * 1024 as an variable named size and it will go like this?

private static final RequestOptions COMMON_OPTIONS;
static {
    RequestOptions.Builder builder = RequestOptions.DEFAULT.toBuilder();
    builder.addHeader("Authorization", "Bearer " + TOKEN); 
    int size = 30 * 1024 * 1024 * 1024;
    builder.setHttpAsyncResponseConsumerFactory(           
        new HttpAsyncResponseConsumerFactory.HeapBufferedResponseConsumerFactory(size));
    COMMON_OPTIONS = builder.build();
}

And another one : Adding a return code before 30 * 1024 * 1024 * 1024 like below

private static final RequestOptions COMMON_OPTIONS;
static {
    RequestOptions.Builder builder = RequestOptions.DEFAULT.toBuilder();
    builder.addHeader("Authorization", "Bearer " + TOKEN); 
    builder.setHttpAsyncResponseConsumerFactory(           
        new HttpAsyncResponseConsumerFactory.HeapBufferedResponseConsumerFactory(
            30 * 1024 * 1024 * 1024));
    COMMON_OPTIONS = builder.build();
}

Fix RestClientDocumentation.java Style for code snippet
@javanna
Copy link
Copy Markdown
Contributor

javanna commented Oct 24, 2018

retest this please

Fix the code style  for limit of 76 characters
@wangzhenhui1992
Copy link
Copy Markdown
Contributor Author

retest this please

@wangzhenhui1992
Copy link
Copy Markdown
Contributor Author

wangzhenhui1992 commented Oct 24, 2018

@javanna Can I trigger it ?

Fix code style
@javanna
Copy link
Copy Markdown
Contributor

javanna commented Oct 24, 2018

retest this please

@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra

@hub-cap
Copy link
Copy Markdown
Contributor

hub-cap commented Oct 24, 2018

@wangzhenhui1992 only people in the elastic organization can trigger a test build. We are happy to do it for you :)

@javanna
Copy link
Copy Markdown
Contributor

javanna commented Oct 24, 2018

hi @wangzhenhui1992 would you mind merging master in? Sorry for the trouble, I think some of the failures we are getting here are due to problems that have now been solved on master.

@nik9000
Copy link
Copy Markdown
Member

nik9000 commented Oct 24, 2018

Sorry about not commenting earlier. The change is fine with me so long as the line length checker likes it. We really don't have much room on those snippets.

@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-docs

@nik9000 nik9000 added >docs General docs changes and removed :Docs labels Oct 24, 2018
@wangzhenhui1992
Copy link
Copy Markdown
Contributor Author

wangzhenhui1992 commented Oct 25, 2018

@wangzhenhui1992 only people in the elastic organization can trigger a test build. We are happy to do it for you :)

@hub-cap Thank you

@wangzhenhui1992
Copy link
Copy Markdown
Contributor Author

wangzhenhui1992 commented Oct 25, 2018

Sorry about not commenting earlier. The change is fine with me so long as the line length checker likes it. We really don't have much room on those snippets.

@nik9000 Thank you

@wangzhenhui1992
Copy link
Copy Markdown
Contributor Author

hi @wangzhenhui1992 would you mind merging master in? Sorry for the trouble, I think some of the failures we are getting here are due to problems that have now been solved on master.

@javanna Of course OK. Let me have a try and then I will mention you with the PR.

@javanna
Copy link
Copy Markdown
Contributor

javanna commented Oct 25, 2018

Closed in favour of #34834

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants