Closed camerondurham closed 5 months ago
@Xtansia take a look?
Regarding a breaking change: if it can be avoided it's best. Then we don't need to do a major release and break users. You can deprecate the old method.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 79.85%. Comparing base (
41417d4
) to head (2dc360c
). Report is 2 commits behind head on main.:exclamation: Current head 2dc360c differs from pull request most recent head 56e0316. Consider uploading reports for the commit 56e0316 to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
It totally makes sense to avoid breaking change. And "making the Rust interface more consistent" doesn't seem to add enough value to warrant a version bump, imo. I'll revise to add new optional constructor from #241 in a non-breaking way.
Testing
And thanks for running test cases, I see I missed updating a bunch of tests will work on that.
I had some trouble running these tests locally so didn't catch this before opening the CR.
15 | ops.push(BulkOperation::index(json!({
| __________^^^^^^^^^^^^^^^^^^^^_-
16 | | "user": "kimchy",
17 | | "post_date": "2009-11-15T00:00:00Z",
18 | | "message": "Trying out OpenSearch, so far so good?"
19 | | }))
| |______- an argument of type `Option<_>` is missing
I also don't feel this warrants a breaking version bump just for this, however there is an opportunity where you could PR a non-breaking change directly into 2.x
and make the breaking change in main
. Then it'll be usable sooner via a minor version, and the "corrected" version can just wait for whenever we cut a 3.0.0
Thanks for the review @Xtansia, I accepted all suggestions and added an entry to the changelog.
The backport to 2.x
failed:
The process '/usr/bin/git' failed with exit code 1
To backport manually, run these commands in your terminal:
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-245-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 28e3d47a54c4fe1ce0a3647c872411602dc6b1e2
# Push it to GitHub
git push --set-upstream origin backport/backport-245-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x
Then, create a pull request where the base
branch is 2.x
and the compare
/head
branch is backport/backport-245-to-2.x
.
Change (latest - revision 2)
Added new
create_no_id
andnew_no_id
constructors/helpers to support bulk create operations where no _id field is required.Change (revision 1)
Changed types to
id: Option<S>
when_id
is optional in the bulk request, otherwise, keepid
parameter asString
.This change is making the Bulk operation constructor parameters more closely match the Bulk API, specifically when
_id
is required or not.Summarized from the docs: https://www.elastic.co/guide/en/elasticsearch/reference/7.10/docs-bulk.html#bulk-api-request-body
create
:_id
(optional, string)delete
:_id
(required, string)index
:_id
(optional, string)update
_id
(required, string)Issues Resolved
Related to, and may close issue #241 .
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.