Skip to content

Support Range Indexes as GA. #1465

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

Merged
merged 16 commits into from
Aug 19, 2024
Merged

Support Range Indexes as GA. #1465

merged 16 commits into from
Aug 19, 2024

Conversation

vbabanin
Copy link
Member

@vbabanin vbabanin commented Jul 31, 2024

vbabanin added 4 commits July 30, 2024 19:33
- Add prose tests.
- Update specification tests.
- Move duplicated code to EncryptionFixture.

JAVA-5537
JAVA-5537
@vbabanin vbabanin requested review from a team and stIncMale and removed request for a team August 2, 2024 00:45
Copy link
Member Author

Choose a reason for hiding this comment

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

I've consolidated the common initialization logic, previously repeated across encryption tests, into a new EncryptionFixture.

@vbabanin vbabanin marked this pull request as ready for review August 3, 2024 00:46
@@ -305,11 +305,10 @@ BsonDocument getRunCommandResult(final BsonDocument collectionOptions, final Bso
response = database.runCommand(clientSession, command, readPreference, BsonDocument.class);
}
}
response.remove("ok");
Copy link
Member Author

Choose a reason for hiding this comment

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

According to the legacy test format specification:

If the operation returns a raw command response, e.g., from runCommand, then compare only the fields present in the expected result document.

Therefore, we should not remove any fields from the response. Instead, we should only compare the fields that are explicitly expected and ignore any additional fields that are not specified in the expected results.

@vbabanin vbabanin changed the title Make trimFactor and sparsity optional. Support Range Indexes as GA. Aug 9, 2024
Comment on lines +80 to 81
@Nullable
public Integer getTrimFactor() {
Copy link
Member

Choose a reason for hiding this comment

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

It's weird that this method was not @Nullable previously, as there was nothing that prevented it from returning null.

Comment on lines -96 to -102
kmsProviders = new HashMap<>();
Map<String, Object> localProviderMap = new HashMap<>();
localProviderMap.put("key",
Base64.getDecoder().decode(
"Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZ"
+ "GJkTXVyZG9uSjFk"));
kmsProviders.put("local", localProviderMap);
Copy link
Member

Choose a reason for hiding this comment

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

👍 Thank you for removing all this code duplication, and making tests clearer.

vbabanin and others added 2 commits August 13, 2024 20:41
…entSideEncryptionRangeDefaultExplicitEncryptionTest.java

Co-authored-by: Valentin Kovalenko <valentin.male.kovalenko@gmail.com>
Add JavaDoc.

JAVA-5537
@vbabanin vbabanin requested a review from stIncMale August 14, 2024 16:49
* @param trimFactor the trim factor
* @return this
* @since 5.2
*/
public RangeOptions setTrimFactor(final Integer trimFactor) {
public RangeOptions setTrimFactor(@Nullable final Integer trimFactor) {
Copy link
Member

@rozza rozza Aug 15, 2024

Choose a reason for hiding this comment

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

Nit: Can we rename this to trimFactor. Using the API having the set prefix really sticks out.

Copy link
Member Author

Choose a reason for hiding this comment

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

Absolutely, good catch! I've renamed it to trimFactor().

@vbabanin vbabanin requested a review from rozza August 15, 2024 18:03
Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

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

LGTM!

@vbabanin vbabanin merged commit f2cfac7 into mongodb:master Aug 19, 2024
57 of 59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants