-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[communication-short-codes] Migrate to Core v2 #19043
Conversation
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: What if I am onboarding a new service?Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment: |
/azp run js - shortcodes - ci |
No pipelines are associated with this pull request. |
/azp run js - communication-short-codes - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run js - communication-short-codes - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run js - communication-short-codes - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
API changes have been detected in |
sdk/communication/communication-short-codes/src/shortCodesClient.ts
Outdated
Show resolved
Hide resolved
/azp run js - communication-short-codes - tests |
Pull request contains merge conflicts. |
/azp run js - communication-short-codes - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run js - communication-short-codes - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
Hello @ramya-rao-a ! With the changes made up to now the node tests are passing with v2 http client, but all browser tests fail. Main message from error: I see that communication-common uses 2 cryptoUtils files, one called cryptoUtils.browser.ts, which in my mind would fix this issue, but how can I tell the browser tests to use this other cryptoUtils? I have also tried debugging the browser tests but it seems it never goes through the actual cryptoUtils nor communicationAccessKeyCredentialPolicy ... |
@AlonsoMondal, usually this node->browser mapping is set in the package.json, something like this under "browser" {
"name": "@azure/communication-sms",
"version": "1.1.0",
"description": "SDK for Azure Communication SMS service which facilitates the sending of SMS messages.",
"sdk-type": "client",
"main": "dist/index.js",
"module": "dist-esm/src/index.js",
"browser": {
"stream": "./node_modules/stream-browserify/index.js",
"./dist-esm/src/credentials/cryptoUtils.js": "./dist-esm/src/credentials/cryptoUtils.browser.js"
},
...
} Where the key is the transpiled node/default version (see that it is pointing to the Browser bundlers would read this mapping and whenever they would use This should help you with the browser tests. When setting the mappings make sure the file paths match the actual files in your |
/azp run js - communication-short-codes - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
prepared for second beta release.
Fix package-name property in autorest configuration
b4fbfbd
to
e9ec64c
Compare
Inject XHR client to fix browser tests
@petrsvihlik this PR is now updated to address your comments. Can you please review again? CC: @rtrevino89 |
sdk/communication/communication-short-codes/test/internal/headers.spec.ts
Outdated
Show resolved
Hide resolved
sdk/communication/communication-short-codes/review/communication-short-codes.api.md
Show resolved
Hide resolved
sdk/communication/communication-short-codes/test/public/utils/recordedClient.ts
Outdated
Show resolved
Hide resolved
- Add versioning metadata to package.json - Update changelog wording - Import `isNode` from `@azure/test-utils` - Restore tokenCredential explicit typing
@petrsvihlik just pushed some changes addressing your comments. Thanks for the thorough review! |
isPlaybackMode, | ||
record, |
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.
Would you mind filing an issue to track migrating tests to the new recorder?
https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/recorder/MIGRATION.md
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.
Changes look good! Please file an issue for migrating tests to the new recorder
Thanks for the reviews! I created the issue to track the test recorder migration, you can see it here: #20871. |
* changes to migrate http client * shortcodes-http * formatting changes * fixing from pulling * formatting * credential changes for http client v2 migration * adding browser specific utils for auth * adding linter fixes * fixing mocked client * updating policy and sdk version constant * formatting.... * re-recording node tests * fixes needed for browser tests * re-recording tests * fixing unsupported ES2020 'OptionalChain' syntax * formatting * fixing unsupported ES2020 'OptionalChain' syntax on pending sample * fixing unsupported ES2020 'OptionalChain' syntax * fixed typo for shortcodes description * retaking http migration work * removing unnecessary file * removing http-core library * resolving comments * adding re recorded tests * resolving comments and re-recording tests * removing unsupported chainings in samples * fixing samples for ES2020 unsupported syntax * formatting * fixing samples and rerecording tests * fixing tests to include azure on user agent. prepared for second beta release. * fixing error from sms. formatting. * Update communication-common dependency to 2.0.0 Fix package-name property in autorest configuration * Reuse auth pipelines from communication-common Inject XHR client to fix browser tests * Cleanup no longer needed dependencies * Lint and format * Expect `preferredVanityNumbers` in program briefs * Address PR comments - Add versioning metadata to package.json - Update changelog wording - Import `isNode` from `@azure/test-utils` - Restore tokenCredential explicit typing Co-authored-by: Daniel Ortega <[email protected]>
* changes to migrate http client * shortcodes-http * formatting changes * fixing from pulling * formatting * credential changes for http client v2 migration * adding browser specific utils for auth * adding linter fixes * fixing mocked client * updating policy and sdk version constant * formatting.... * re-recording node tests * fixes needed for browser tests * re-recording tests * fixing unsupported ES2020 'OptionalChain' syntax * formatting * fixing unsupported ES2020 'OptionalChain' syntax on pending sample * fixing unsupported ES2020 'OptionalChain' syntax * fixed typo for shortcodes description * retaking http migration work * removing unnecessary file * removing http-core library * resolving comments * adding re recorded tests * resolving comments and re-recording tests * removing unsupported chainings in samples * fixing samples for ES2020 unsupported syntax * formatting * fixing samples and rerecording tests * fixing tests to include azure on user agent. prepared for second beta release. * fixing error from sms. formatting. * Update communication-common dependency to 2.0.0 Fix package-name property in autorest configuration * Reuse auth pipelines from communication-common Inject XHR client to fix browser tests * Cleanup no longer needed dependencies * Lint and format * Expect `preferredVanityNumbers` in program briefs * Address PR comments - Add versioning metadata to package.json - Update changelog wording - Import `isNode` from `@azure/test-utils` - Restore tokenCredential explicit typing Co-authored-by: Daniel Ortega <[email protected]>
Updating the version of the autorest.typescript extension to the code generator to 6.0.0-beta.15
Main change is updating the dependencies from @azure/core-http to @azure/core-client/@azure/core-rest-pipeline packages, the client for rest http calls
Issue: #18688
Mainly following this wiki guide: https://github.com/Azure/autorest.typescript/wiki/%60core-http%60-dependency-migration-to-%60core-client%60-%60core-rest-pipeline%60
Also aiding myself with other PRs in communication that have done this, e.g. #17045