Skip to content

Add Unwrapfunction to all the fieldType instaceof check #17951

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 1 commit into from
Apr 21, 2025

Conversation

chloewqg
Copy link
Contributor

@chloewqg chloewqg commented Apr 15, 2025

Description

Unwrap the fieldType before checking the instance of the fileld Type Object

Related Issues

Resolves #17802

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.

Copy link
Contributor

❌ Gradle check result for 123f25b: 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?

@msfroh
Copy link
Contributor

msfroh commented Apr 15, 2025

Build failure:

Step 'removeUnusedImports' found problem in 'src/internalClusterTest/java/org/opensearch/index/mapper/StarTreeMapperIT.java':
727:45: error: ';' expected
com.google.googlejavaformat.java.FormatterException: 727:45: error: ';' expected
	at com.google.googlejavaformat.java.FormatterException.fromJavacDiagnostics(FormatterException.java:51)
	at com.google.googlejavaformat.java.RemoveUnusedImports.parse(RemoveUnusedImports.java:264)
	at com.google.googlejavaformat.java.RemoveUnusedImports.removeUnusedImports(RemoveUnusedImports.java:218)
	at com.diffplug.spotless.glue.java.GoogleJavaFormatRemoveUnusedImporterFormatterFunc.apply(GoogleJavaFormatRemoveUnusedImporterFormatterFunc.java:38)
	at com.diffplug.spotless.FormatterFunc.apply(FormatterFunc.java:32)
	at com.diffplug.spotless.FormatterStepImpl$Standard.format(FormatterStepImpl.java:82)
	at com.diffplug.spotless.FormatterStep$Strict.format(FormatterStep.java:103)

There's a missing ; after the assertFalse statement here:

                    assertFalse(ft == null)
                    assertTrue(ft.unwrap() instanceof StarTreeMapper.StarTreeFieldType);

If you run ./gradlew precommit, it runs a lightweight build that checks for these and some other failures.

@chloewqg
Copy link
Contributor Author

Thank you! @msfroh I have pushed the fix. Btw, I recently tried to build the main branch of open search. But it failed with the below error message

* What went wrong:
Execution failed for task ':server:compileJava'.
> java.lang.NullPointerException: Cannot invoke "javax.lang.model.element.Element.getKind()" because "elem" is null

Do you might know what cause this issue?

Copy link
Contributor

❌ Gradle check result for c3ff971: 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!

@chloewqg
Copy link
Contributor Author

LGTM!

Thank you Dan! I am rebasing on to the main branch now. When you get a chance, could you please help me merge this approved PR? Thanks!

Copy link
Contributor

❌ Gradle check result for 5b61b6d: 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 5b61b6d: 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?

@jainankitk
Copy link
Contributor

jainankitk commented Apr 21, 2025

Unrelated failures:

[Test Result](https://build.ci.opensearch.org/job/gradle-check/56783/testReport/) (2 failures / -2)

    [org.opensearch.cluster.MinimumClusterManagerNodesIT.testThreeNodesNoClusterManagerBlock](https://build.ci.opensearch.org/job/gradle-check/56783/testReport/junit/org.opensearch.cluster/MinimumClusterManagerNodesIT/testThreeNodesNoClusterManagerBlock/)
    [org.opensearch.cluster.allocation.SearchReplicaAllocationIT.testSearchReplicaDedicatedIncludes_DoNotAssignToOtherNodes](https://build.ci.opensearch.org/job/gradle-check/56783/testReport/junit/org.opensearch.cluster.allocation/SearchReplicaAllocationIT/testSearchReplicaDedicatedIncludes_DoNotAssignToOtherNodes/)

Retrying gradle check

Copy link
Contributor

❌ Gradle check result for 5b61b6d: 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?

@jainankitk
Copy link
Contributor

Unrelated failures:

[Test Result](https://build.ci.opensearch.org/job/gradle-check/56789/testReport/) (2 failures / -1)

    [org.opensearch.search.simple.SimpleSearchIT.testSimpleTerminateAfterTrackTotalHitsUpToSize {p0={"search.concurrent_segment_search.enabled":"true"}}](https://build.ci.opensearch.org/job/gradle-check/56789/testReport/junit/org.opensearch.search.simple/SimpleSearchIT/testSimpleTerminateAfterTrackTotalHitsUpToSize__p0___search_concurrent_segment_search_enabled___true___/)
    [org.opensearch.search.simple.SimpleSearchIT.testSimpleTerminateAfterTrackTotalHitsUpToSize {p0={"search.concurrent_segment_search.enabled":"false"}}](https://build.ci.opensearch.org/job/gradle-check/56789/testReport/junit/org.opensearch.search.simple/SimpleSearchIT/testSimpleTerminateAfterTrackTotalHitsUpToSize__p0___search_concurrent_segment_search_enabled___false___/)

Retrying gradle check

Copy link
Contributor

❌ Gradle check result for 5b61b6d: 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?

@jainankitk
Copy link
Contributor

Another flaky test:

[Test Result](https://build.ci.opensearch.org/job/gradle-check/56795/testReport/) (1 failure / -14)

    [org.opensearch.rest.ReactorNetty4StreamingStressIT.testCloseClientStreamingRequest](https://build.ci.opensearch.org/job/gradle-check/56795/testReport/junit/org.opensearch.rest/ReactorNetty4StreamingStressIT/testCloseClientStreamingRequest/)

Copy link
Contributor

✅ Gradle check result for 5b61b6d: SUCCESS

@jainankitk jainankitk merged commit 52b8b05 into opensearch-project:main Apr 21, 2025
30 of 31 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 23, 2025
Signed-off-by: Chloe Gao <[email protected]>
(cherry picked from commit 52b8b05)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
x-INFiN1TY-x pushed a commit to x-INFiN1TY-x/OpenSearch_Local that referenced this pull request Apr 24, 2025
jainankitk pushed a commit that referenced this pull request Apr 24, 2025
)

(cherry picked from commit 52b8b05)

Signed-off-by: Chloe Gao <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
prudhvigodithi pushed a commit to prudhvigodithi/OpenSearch that referenced this pull request May 6, 2025
…roject#17951) (opensearch-project#18062)

(cherry picked from commit 52b8b05)

Signed-off-by: Chloe Gao <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: Prudhvi Godithi <[email protected]>
Harsh-87 pushed a commit to Harsh-87/OpenSearch that referenced this pull request May 7, 2025
Harsh-87 pushed a commit to Harsh-87/OpenSearch that referenced this pull request May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 3.0 enhancement Enhancement or improvement to existing feature or request _No response_
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unwrap FieldType Before instanceof chck
5 participants