-
Notifications
You must be signed in to change notification settings - Fork 892
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
[Refactor] Replace url parse format resolve with whatwg url #2910
[Refactor] Replace url parse format resolve with whatwg url #2910
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #2910 +/- ##
==========================================
- Coverage 66.45% 66.38% -0.07%
==========================================
Files 3208 3208
Lines 61593 61616 +23
Branches 9502 9504 +2
==========================================
- Hits 40932 40906 -26
- Misses 18384 18425 +41
- Partials 2277 2285 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 7 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
…matUrl Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
…s/docker_servers_service.ts Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
…dler.ts Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
…app_links.ts Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
1eaf259
to
9e8818c
Compare
32c4581
to
a2d7108
Compare
Signed-off-by: Lin Wang <wonglam@amazon.com>
…context_page.ts Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
@joshuarrrr @AMoo-Miki I have pushed all the file changes. Feel free to help me review again. Thanks. |
Thanks! We'll try to see if we can find the capacity to review this week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wanglam Looking good?
A couple minor questions. The only major request I have left is to centralize the .toString().slice(0, -1)
manipulation so that it's not peppered throughout the code.
opensearchDashboardsUrl = config | ||
.get('servers.opensearchDashboards') | ||
.fullURL.toString() | ||
.slice(0, -1) as string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still need the as string
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. The config.get('servers.opensearchDashboards')
will return an any
object. The TS complier won't know its type. So I add the as string
.
Signed-off-by: Lin Wang <wonglam@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wanglam Thanks for the perseverance! LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some leftovers of the legacy URL APIs but we could deal with them incrementally after merging this since these changes are slated for v3.0.0.
Yeah, here's the scope of this PR: #1561 (comment) After merging, I'll create a follow-up issue for the trickier bits. |
…ch-project#2910) Replace the url.parse/url.format/url.resolve function in the code base with whatwg-url. The main change is to change the url.parse to new URL(), and change url.format to [URL object].toString and change the url.resolve to new URL() toString(). Another major change is to replace the url parts in test config with URL object for transmission. Partially completes opensearch-project#1561 Signed-off-by: Lin Wang <wonglam@amazon.com> Co-authored-by: Josh Romero <rmerqg@amazon.com>
…ch-project#2910) Replace the url.parse/url.format/url.resolve function in the code base with whatwg-url. The main change is to change the url.parse to new URL(), and change url.format to [URL object].toString and change the url.resolve to new URL() toString(). Another major change is to replace the url parts in test config with URL object for transmission. Partially completes opensearch-project#1561 Signed-off-by: Lin Wang <wonglam@amazon.com> Co-authored-by: Josh Romero <rmerqg@amazon.com> Signed-off-by: David Sinclair <david@sinclair.tech>
Description
This PR mainly replaces the url.parse/url.format/url.resolve function in the code base with whatwg-url. The main change is to change the url.parse to new URL(), and change url.format to [URL object].toString and change the url.resolve to new URL() toString(). According to the discussion in #1561 , this PR only deals with the parts that can be replaced quickly. Therefore, most of the modifications only involve simple function replacement. Another major change is to replace the url parts in test config with URL object for transmission. Most files are modified with a file based commit, so we could just delete this commit if this change isn't necessary.
Issues Resolved
#1561
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr