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 automatic addition of protocol in discovery endpoint #11612

Merged
merged 4 commits into from
Dec 18, 2023

Conversation

heyanlong
Copy link
Contributor

Description

Fix #11609

Related Issues

Resolves #11609

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.

Signed-off-by: Yanlong He <[email protected]>
Copy link
Contributor

github-actions bot commented Dec 14, 2023

Compatibility status:

Checks if related components are compatible with change 1b277ab

Incompatible components

Skipped components

Compatible components

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

Copy link
Contributor

✅ Gradle check result for 7263a02: SUCCESS

Copy link

codecov bot commented Dec 14, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (074bc6a) 71.31% compared to head (62866a8) 71.34%.
Report is 4 commits behind head on main.

❗ Current head 62866a8 differs from pull request most recent head 1b277ab. Consider uploading reports for the commit 1b277ab to get more accurate results

Files Patch % Lines
...rg/opensearch/discovery/ec2/AwsEc2ServiceImpl.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11612      +/-   ##
============================================
+ Coverage     71.31%   71.34%   +0.03%     
- Complexity    59155    59162       +7     
============================================
  Files          4906     4906              
  Lines        278178   278178              
  Branches      40421    40421              
============================================
+ Hits         198388   198475      +87     
+ Misses        63260    63152     -108     
- Partials      16530    16551      +21     

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

@github-actions github-actions bot added the Other label Dec 15, 2023
Copy link
Contributor

✅ Gradle check result for 62866a8: SUCCESS

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.

Before we merge this, any reason to hand-roll our own implementation vs. using something like HttpHost.create(endpoint).getHostName()?

@peternied peternied changed the title Fix #11609 Fix automatic addition of protocol in discovery endpoint Dec 15, 2023
@heyanlong
Copy link
Contributor Author

Before we merge this, any reason to hand-roll our own implementation vs. using something like HttpHost.create(endpoint).getHostName()?

Yes, we can use HttpHost.create(endpoint).getScheme() to check if it has scheme, but I don't think this simple validation requires using a third party implementation

Copy link
Contributor

❌ Gradle check result for b3b210a: 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: heyanlong <[email protected]>
Copy link
Contributor

❕ Gradle check result for 1b277ab: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.search.SearchWeightedRoutingIT.testShardRoutingWithNetworkDisruption_FailOpenEnabled

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

@dblock
Copy link
Member

dblock commented Dec 18, 2023

Before we merge this, any reason to hand-roll our own implementation vs. using something like HttpHost.create(endpoint).getHostName()?

Yes, we can use HttpHost.create(endpoint).getScheme() to check if it has scheme, but I don't think this simple validation requires using a third party implementation

That's fine here. Generally I prefer well tested libraries that implement an RFC because, I think, you'll agree that this exact PR is a demonstration of the fact that validation may not be totally trivial. This fixes a bug introduced by rolling out custom validation.

@dblock dblock added the backport 2.x Backport to 2.x branch label Dec 18, 2023
@dblock dblock merged commit 2b1c9ae into opensearch-project:main Dec 18, 2023
30 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 18, 2023
* Fix #11609

Signed-off-by: Yanlong He <[email protected]>

* Fix #11609

Signed-off-by: heyanlong <[email protected]>

* Update AwsEc2ServiceImplTests.java

Signed-off-by: 何延龙 <[email protected]>

* spotless

Signed-off-by: heyanlong <[email protected]>

---------

Signed-off-by: Yanlong He <[email protected]>
Signed-off-by: heyanlong <[email protected]>
Signed-off-by: 何延龙 <[email protected]>
(cherry picked from commit 2b1c9ae)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
peternied pushed a commit that referenced this pull request Dec 18, 2023
…1634)

Signed-off-by: Yanlong He <[email protected]>
Signed-off-by: heyanlong <[email protected]>
Signed-off-by: 何延龙 <[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>
@heyanlong
Copy link
Contributor Author

Before we merge this, any reason to hand-roll our own implementation vs. using something like HttpHost.create(endpoint).getHostName()?

Yes, we can use HttpHost.create(endpoint).getScheme() to check if it has scheme, but I don't think this simple validation requires using a third party implementation

That's fine here. Generally I prefer well tested libraries that implement an RFC because, I think, you'll agree that this exact PR is a demonstration of the fact that validation may not be totally trivial. This fixes a bug introduced by rolling out custom validation.

It is like this, for stricter validation, libraries are a better choice.

@dblock
Copy link
Member

dblock commented Dec 21, 2023

It is like this, for stricter validation, libraries are a better choice.

@heyanlong feel free to PR a change that uses the library! we can compare looking at the code

rayshrey pushed a commit to rayshrey/OpenSearch that referenced this pull request Mar 18, 2024
…project#11612)

* Fix opensearch-project#11609

Signed-off-by: Yanlong He <[email protected]>

* Fix opensearch-project#11609

Signed-off-by: heyanlong <[email protected]>

* Update AwsEc2ServiceImplTests.java

Signed-off-by: 何延龙 <[email protected]>

* spotless

Signed-off-by: heyanlong <[email protected]>

---------

Signed-off-by: Yanlong He <[email protected]>
Signed-off-by: heyanlong <[email protected]>
Signed-off-by: 何延龙 <[email protected]>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…project#11612)

* Fix opensearch-project#11609

Signed-off-by: Yanlong He <[email protected]>

* Fix opensearch-project#11609

Signed-off-by: heyanlong <[email protected]>

* Update AwsEc2ServiceImplTests.java

Signed-off-by: 何延龙 <[email protected]>

* spotless

Signed-off-by: heyanlong <[email protected]>

---------

Signed-off-by: Yanlong He <[email protected]>
Signed-off-by: heyanlong <[email protected]>
Signed-off-by: 何延龙 <[email protected]>
Signed-off-by: Shivansh Arora <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch bug Something isn't working Other
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Automatic addition of protocol broken in #11512
3 participants