[Guide] Add document lifecycle guide#2017
Conversation
41f0b7d to
4e03048
Compare
Constraint: Issue opensearch-project#431 asks for a Java document lifecycle guide similar to the Ruby guide while matching existing Java guide conventions. Rejected: Guide-only snippets | A runnable sample keeps the documented examples compileable and Docker-verified. Rejected: Repository-order CI workaround in this PR | It fixed a transient upstream Maven 503 but widened the guide-focused review scope. Confidence: high Scope-risk: narrow Directive: Keep guide snippets aligned with DocumentLifecycle when changing lifecycle examples. Tested: git diff --check Tested: ./gradlew :samples:compileJava :samples:spotlessJavaCheck Tested: Docker Compose OpenSearch 3.2.0 health green; PASSWORD=0_aD^min_0 ./gradlew :samples:run -Dsamples.mainClass=DocumentLifecycle Not-tested: Full repository test suite Signed-off-by: sanghun <vitash1215@gmail.com>
4e03048 to
b4dcaf9
Compare
|
Thanks you @lsh1215 , a few minor comments, LGTM otherwise! |
Constraint: Maintainer review requested wording, heading, and setup-style adjustments in guides/document_lifecycle.md. Rejected: Changing the runnable sample | The review feedback targeted guide phrasing, and the sample still compiles unchanged. Confidence: high Scope-risk: narrow Directive: Keep the guide TOC anchors synchronized with section heading changes. Tested: git diff --check Tested: ./gradlew :samples:compileJava :samples:spotlessJavaCheck Not-tested: Full repository test suite Signed-off-by: sanghun <vitash1215@gmail.com>
|
Thanks for the review, @reta. I applied your suggestions in 9955e6d. I also updated the TOC anchors to stay in sync with the renamed sections. The current CI failures look unrelated to this docs change. The failing jobs are failing during Gradle dependency resolution because |
|
Separately, if this keeps recurring, it may be worth considering a follow-up build hardening change so public Maven artifacts resolve from Maven Central before the OpenSearch snapshot repository is queried. |
Constraint: Maintainer review requested DocumentLifecycle.java to match the setup snippet already applied in guides/document_lifecycle.md. Rejected: Reintroducing SampleClient.create | The review suggestion asks for the explicit HttpHost transport setup. Confidence: high Scope-risk: narrow Directive: Keep sample setup aligned with guide setup code. Tested: git diff --check Tested: ./gradlew :samples:compileJava :samples:spotlessJavaCheck Tested: OPENSEARCH_VERSION=3.2.0 SECURE_INTEGRATION=false docker compose --project-directory .ci/opensearch up -d --build; ./gradlew :samples:run -Dsamples.mainClass=DocumentLifecycle; docker compose down Not-tested: Full repository test suite Signed-off-by: sanghun <vitash1215@gmail.com>
|
The backport to |
@lsh1215 could you please backport it to |
|
@reta Sure, I’ll open a manual backport PR to the 3.x branch. Thank you. |
* [Guide] Add document lifecycle guide (#2017) * Make document lifecycle guidance verifiable for Java users Constraint: Issue #431 asks for a Java document lifecycle guide similar to the Ruby guide while matching existing Java guide conventions. Rejected: Guide-only snippets | A runnable sample keeps the documented examples compileable and Docker-verified. Rejected: Repository-order CI workaround in this PR | It fixed a transient upstream Maven 503 but widened the guide-focused review scope. Confidence: high Scope-risk: narrow Directive: Keep guide snippets aligned with DocumentLifecycle when changing lifecycle examples. Tested: git diff --check Tested: ./gradlew :samples:compileJava :samples:spotlessJavaCheck Tested: Docker Compose OpenSearch 3.2.0 health green; PASSWORD=0_aD^min_0 ./gradlew :samples:run -Dsamples.mainClass=DocumentLifecycle Not-tested: Full repository test suite Signed-off-by: sanghun <vitash1215@gmail.com> * Align document lifecycle guide with review wording Constraint: Maintainer review requested wording, heading, and setup-style adjustments in guides/document_lifecycle.md. Rejected: Changing the runnable sample | The review feedback targeted guide phrasing, and the sample still compiles unchanged. Confidence: high Scope-risk: narrow Directive: Keep the guide TOC anchors synchronized with section heading changes. Tested: git diff --check Tested: ./gradlew :samples:compileJava :samples:spotlessJavaCheck Not-tested: Full repository test suite Signed-off-by: sanghun <vitash1215@gmail.com> * Align document lifecycle sample setup with guide Constraint: Maintainer review requested DocumentLifecycle.java to match the setup snippet already applied in guides/document_lifecycle.md. Rejected: Reintroducing SampleClient.create | The review suggestion asks for the explicit HttpHost transport setup. Confidence: high Scope-risk: narrow Directive: Keep sample setup aligned with guide setup code. Tested: git diff --check Tested: ./gradlew :samples:compileJava :samples:spotlessJavaCheck Tested: OPENSEARCH_VERSION=3.2.0 SECURE_INTEGRATION=false docker compose --project-directory .ci/opensearch up -d --build; ./gradlew :samples:run -Dsamples.mainClass=DocumentLifecycle; docker compose down Not-tested: Full repository test suite Signed-off-by: sanghun <vitash1215@gmail.com> --------- Signed-off-by: sanghun <vitash1215@gmail.com> (cherry picked from commit 354ff2e) Signed-off-by: sanghun <vitash1215@gmail.com> * Switch to SampleClient.create() Signed-off-by: Andriy Redko <drreta@gmail.com> --------- Signed-off-by: sanghun <vitash1215@gmail.com> Signed-off-by: Andriy Redko <drreta@gmail.com> Co-authored-by: Andriy Redko <drreta@gmail.com>
Summary
guides/document_lifecycle.mdguide covering create, index, get, source filtering, mget, exists, update, script update, update by query, reindex, delete, delete by query, and cleanup.DocumentLifecyclesample that mirrors the guide and asserts each operation against OpenSearch.ResponseExceptionandOpenSearchExceptionpaths.CHANGELOG.mdentry for the new guide and sample.Closes #431.
Validation
git diff --check./gradlew :samples:compileJava :samples:spotlessJavaCheckPASSWORD=0_aD^min_0 ./gradlew :samples:run -Dsamples.mainClass=DocumentLifecycleNot run