Skip to content

Add read and write optional enum sets methods to stream input and output #17556

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 9 commits into from
Mar 13, 2025

Conversation

q-andy
Copy link
Contributor

@q-andy q-andy commented Mar 7, 2025

Description

In some plugins there are use cases to read and write optional EnumSets to and from StreamOutput/StreamInput, similar to existing readOptionalStringCollection/writeOptionalStringList methods.

Currently this is done with plugin specific private helper methods, but since this functionality is common to multiple plugins and we are planning on building similar systems for geospatial and search relevance lab plugins, it may be more elegant to consolidate them in core. Examples:

Related Issues

n/a

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

@q-andy q-andy force-pushed the stream-optional-enumset branch from b386dbb to 2087291 Compare March 7, 2025 23:55
Signed-off-by: Andy Qin <[email protected]>
@q-andy q-andy force-pushed the stream-optional-enumset branch from 8df906d to ad0c5ce Compare March 7, 2025 23:57
Copy link
Contributor

github-actions bot commented Mar 8, 2025

❌ Gradle check result for ad0c5ce: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Mar 9, 2025

❌ Gradle check result for 52f24d4: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Signed-off-by: Andy Qin <[email protected]>
@q-andy q-andy force-pushed the stream-optional-enumset branch from bf3a8f5 to f65cfc8 Compare March 9, 2025 23:43
@q-andy
Copy link
Contributor Author

q-andy commented Mar 9, 2025

@dbwiddis thanks for the review, I added unit tests to the BaseStreamTests in core so all the StreamInput implementations should inherit tests as well

Copy link
Contributor

github-actions bot commented Mar 9, 2025

❌ Gradle check result for f65cfc8: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Signed-off-by: Andy Qin <[email protected]>
@q-andy q-andy force-pushed the stream-optional-enumset branch from f65cfc8 to 9ff9553 Compare March 9, 2025 23:59
Copy link
Contributor

❌ Gradle check result for 9ff9553: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

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

LGTM pending changelog

@dbwiddis
Copy link
Member

DCO failing, looks like no email address:

Commit sha: 78de87a, Author: Andy Qin, Committer: Andy Qin; The sign-off is missing.

Copy link
Contributor

❕ Gradle check result for 78de87a: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.snapshots.DedicatedClusterSnapshotRestoreIT.testSnapshotWithStuckNode

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link

codecov bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.38%. Comparing base (2ee8660) to head (221f397).
Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #17556      +/-   ##
============================================
- Coverage     72.43%   72.38%   -0.05%     
- Complexity    65694    65719      +25     
============================================
  Files          5311     5311              
  Lines        304937   304945       +8     
  Branches      44226    44226              
============================================
- Hits         220872   220745     -127     
- Misses        65912    66061     +149     
+ Partials      18153    18139      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Andy Qin <[email protected]>
@q-andy q-andy force-pushed the stream-optional-enumset branch from 78de87a to 221f397 Compare March 11, 2025 21:12
Copy link
Contributor

❌ Gradle check result for 221f397: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❕ Gradle check result for 221f397: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.snapshots.DedicatedClusterSnapshotRestoreIT.testSnapshotWithStuckNode

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@dbwiddis dbwiddis merged commit e306d51 into opensearch-project:main Mar 13, 2025
32 checks passed
vinaykpud pushed a commit to vinaykpud/OpenSearch that referenced this pull request Mar 18, 2025
…put (opensearch-project#17556)

* Add read and write optional enum sets to stream

Signed-off-by: Andy Qin <[email protected]>

* Only write set if it is non-empty

Signed-off-by: Andy Qin <[email protected]>

* Update javadoc

Signed-off-by: Andy Qin <[email protected]>

* Read false presence flag as empty set

Co-authored-by: Daniel Widdis <[email protected]>
Signed-off-by: Andy <[email protected]>

* Update javadoc

Signed-off-by: Andy Qin <[email protected]>

* Add unit tests

Signed-off-by: Andy Qin <[email protected]>

* Fix typos

Signed-off-by: Andy Qin <[email protected]>

* Update changelog

Signed-off-by: Andy Qin <[email protected]>

---------

Signed-off-by: Andy Qin <[email protected]>
Signed-off-by: Andy <[email protected]>
Co-authored-by: Daniel Widdis <[email protected]>
Signed-off-by: Vinay Krishna Pudyodu <[email protected]>
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.

2 participants