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

[Console] Update "Copy as cURL" to interpolate variables and strip request-body comments #140262

Merged

Conversation

mibragimov
Copy link
Contributor

Fixes #136786

Summary

Fixes "Copy as cURL" command for requests with variables and comments.

Things updated for "Copy as cURL"

  • Replace any variables that exist in the URL and body of a request
  • Remove any comments that exist in the URL and body of a request
  • Catch any syntax errors and show a toast with an error message
  • Add unit tests

Testing

  1. Issue any request in Console with variables and comments. For example:
GET ${exampleVariable1} // _search
{
  "query": {
    "${exampleVariable2}": {} // match_all
  }
}
  1. Click 'Copy as cURL"
  2. Paste it into the terminal and click enter

The output should result in a successful request

@mibragimov mibragimov added Feature:Console Dev Tools Console Feature Feature:Dev Tools release_note:fix Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v8.5.0 labels Sep 8, 2022
@mibragimov mibragimov self-assigned this Sep 8, 2022
@mibragimov mibragimov marked this pull request as ready for review September 9, 2022 15:25
@mibragimov mibragimov requested a review from a team as a code owner September 9, 2022 15:25
@elasticmachine
Copy link
Contributor

Pinging @elastic/platform-deployment-management (Team:Deployment Management)

@mibragimov
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Member

@sabarasaba sabarasaba left a comment

Choose a reason for hiding this comment

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

tested locally, changes lgtm

@mibragimov mibragimov force-pushed the console/fix_copy_cURL_with_variables branch from c2d5f16 to 40a0ac1 Compare September 13, 2022 08:02
@mibragimov
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
console 200 208 +8

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
console 398.0KB 414.6KB +16.6KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
console 26.4KB 26.5KB +114.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @mibragimov

@mibragimov mibragimov merged commit dfafa26 into elastic:main Sep 13, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Sep 13, 2022
@mibragimov mibragimov deleted the console/fix_copy_cURL_with_variables branch September 13, 2022 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Console Dev Tools Console Feature Feature:Dev Tools release_note:fix Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update "Copy as cURL" to interpolate variables and strip request-body comments
5 participants