Skip to content
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

Fix PluginInfo bwc for opensearch_version field #12537

Closed
wants to merge 1 commit into from

Conversation

abseth-amzn
Copy link
Contributor

Description

Updated opensearch_version field in PluginInfo json to represent a string of single version as opposed to a list of single version to ensure bwc in 2.x.

Without this fix

/_cluster/stats

"plugins" : [
        {
          "name" : "analysis-icu",
          "version" : "2.13.0-SNAPSHOT",
          "opensearch_version" : [
            "2.13.0"
          ],
          "java_version" : "11",
          "description" : "The ICU Analysis plugin integrates the Lucene ICU module into OpenSearch, adding ICU-related analysis components.",
          "classname" : "org.opensearch.plugin.analysis.icu.AnalysisICUPlugin",
          "custom_foldername" : "",
          "extended_plugins" : [ ],
          "has_native_controller" : false
        }
      ],

With fix:

"plugins" : [
      {
        "name" : "analysis-icu",
        "version" : "2.13.0-SNAPSHOT",
        "opensearch_version" : "2.13.0",
        "java_version" : "11",
        "description" : "The ICU Analysis plugin integrates the Lucene ICU module into OpenSearch, adding ICU-related analysis components.",
        "classname" : "org.opensearch.plugin.analysis.icu.AnalysisICUPlugin",
        "custom_foldername" : "",
        "extended_plugins" : [ ],
        "has_native_controller" : false
      }
    ],

Related Issues

Resolves #[12528]

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

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

github-actions bot commented Mar 5, 2024

Compatibility status:

Checks if related components are compatible with change 225de7b

Incompatible components

Skipped components

Compatible components

Compatible components: [https:/opensearch-project/custom-codecs.git, https:/opensearch-project/asynchronous-search.git, https:/opensearch-project/neural-search.git, https:/opensearch-project/flow-framework.git, https:/opensearch-project/security-analytics.git, https:/opensearch-project/cross-cluster-replication.git, https:/opensearch-project/job-scheduler.git, https:/opensearch-project/geospatial.git, https:/opensearch-project/notifications.git, https:/opensearch-project/observability.git, https:/opensearch-project/reporting.git, https:/opensearch-project/k-nn.git, https:/opensearch-project/common-utils.git, https:/opensearch-project/performance-analyzer-rca.git, https:/opensearch-project/ml-commons.git, https:/opensearch-project/anomaly-detection.git, https:/opensearch-project/security.git, https:/opensearch-project/index-management.git, https:/opensearch-project/sql.git, https:/opensearch-project/alerting.git, https:/opensearch-project/performance-analyzer.git]

@dblock
Copy link
Member

dblock commented Mar 5, 2024

What's the reason to keep the breaking change in main? Either way, lets add the same test in main regardless of what it's returning.

Copy link
Contributor

github-actions bot commented Mar 5, 2024

❕ Gradle check result for 225de7b: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.smoketest.SmokeTestMultiNodeClientYamlTestSuiteIT.test {yaml=search.aggregation/20_terms/string profiler via global ordinals}
      1 org.opensearch.backwards.MixedClusterClientYamlTestSuiteIT.test {p0=indices.get_field_mapping/20_missing_field/Return empty object if field doesn't exist, but index does}

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 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.18%. Comparing base (3f08520) to head (225de7b).
Report is 1 commits behind head on 2.x.

Additional details and impacted files
@@             Coverage Diff              @@
##                2.x   #12537      +/-   ##
============================================
+ Coverage     71.08%   71.18%   +0.09%     
- Complexity    59924    59970      +46     
============================================
  Files          4945     4945              
  Lines        282349   282349              
  Branches      41369    41369              
============================================
+ Hits         200718   200993     +275     
+ Misses        64577    64299     -278     
- Partials      17054    17057       +3     

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

builder.field("opensearch_version", opensearchVersionRanges);
builder.field("opensearch_version", getOpenSearchVersionRangesString());

Choose a reason for hiding this comment

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

Thanks for the super quick fix. Should we do an additional pass at all places of usage to confirm they are bwc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All callers that require a serialized form of PluginInfo will use one of the following:

  1. writeTo method - already updated to be bwc
  2. toXContent method - updated with this PR
  3. toString method - already updated to be bwc

@abseth-amzn
Copy link
Contributor Author

PR for main - #12543

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

Let's merge #12543 instead and backport it, and close this one?

@abseth-amzn
Copy link
Contributor Author

Let's merge #12543 instead and backport it, and close this one?

Right, missed closing this one.

@abseth-amzn abseth-amzn closed this Mar 7, 2024
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.

4 participants