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

@azure/communication-identity Azure Core 2.0 Migration #20375

Merged
merged 45 commits into from
Mar 17, 2022
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
4979a30
migrated clientArguments, removed circular deps
petrsvihlik Feb 11, 2022
7a31931
remove the dependency on @azure/core-http
petrsvihlik Feb 11, 2022
65cb82a
removing dependencies on core-http
petrsvihlik Feb 11, 2022
3d37b4f
policy converted to core rest pipeline
petrsvihlik Feb 11, 2022
14de0eb
added a changelog entry
petrsvihlik Feb 11, 2022
3931bb6
added test
petrsvihlik Feb 11, 2022
c460344
remove comments
petrsvihlik Feb 11, 2022
5eff894
maintain backwards compatibility
petrsvihlik Feb 14, 2022
4856108
linting - removed errors & most of the warnings
petrsvihlik Feb 14, 2022
b665d3c
linting - ordered imports
petrsvihlik Feb 14, 2022
a245ab3
changelog adjustment + formatting
petrsvihlik Feb 14, 2022
a283344
export function
petrsvihlik Feb 14, 2022
b682008
extracted fresh api
petrsvihlik Feb 14, 2022
eb0cf7f
migrated the client to core-v2
petrsvihlik Feb 15, 2022
5639ee2
removed url shims
petrsvihlik Feb 16, 2022
7041fd1
Merge branch 'petrsvihlik/feature/core-v2-migration' into petrsvihlik…
petrsvihlik Feb 16, 2022
569add0
removed the old policy, bumped major version
petrsvihlik Feb 18, 2022
761d5b8
update pnpm file
petrsvihlik Feb 18, 2022
404d5e3
Merge branch 'petrsvihlik/feature/core-v2-migration' into petrsvihlik…
petrsvihlik Feb 18, 2022
e024613
Merge branch 'main' into petrsvihlik/feature/core-v2-migration
petrsvihlik Feb 21, 2022
e6dd89f
removed duplicity
petrsvihlik Feb 21, 2022
e653c7a
Merge branch 'petrsvihlik/feature/core-v2-migration' into petrsvihlik…
petrsvihlik Feb 21, 2022
53a6f30
updated to common v2
petrsvihlik Feb 21, 2022
f94fb08
re-recorded tests
petrsvihlik Feb 23, 2022
7f19f86
adjusted test recorder
petrsvihlik Feb 23, 2022
54935de
adjusted test recorder
petrsvihlik Feb 23, 2022
784f999
inject xhr client to fix browser tests
petrsvihlik Feb 24, 2022
a7bae0d
updated changelog
petrsvihlik Feb 24, 2022
60882e3
Migrate to new recorder
joheredi Feb 24, 2022
2752a2d
Merge branch 'main' into petrsvihlik/feature/core-v2-identity
petrsvihlik Feb 25, 2022
dd6322e
Merge branch 'main' into petrsvihlik/feature/core-v2-identity
petrsvihlik Feb 25, 2022
64d7dab
Merge pull request #1 from joheredi/comms-identity-recorder
petrsvihlik Feb 25, 2022
78e4faa
Merge branch 'petrsvihlik/feature/core-v2-migration' into petrsvihlik…
petrsvihlik Mar 3, 2022
b8b3c36
fixed most of the tests
petrsvihlik Mar 9, 2022
0a55c71
Merge branch 'main' into petrsvihlik/feature/core-v2-identity
petrsvihlik Mar 9, 2022
a8d185c
exclude headers from comparison
petrsvihlik Mar 9, 2022
482dc50
fixed linting issues
petrsvihlik Mar 9, 2022
6ec494b
formatting
petrsvihlik Mar 9, 2022
a49e1f0
Merge branch 'main' into petrsvihlik/feature/core-v2-identity
petrsvihlik Mar 9, 2022
85028f8
removed redundant sanitizers
petrsvihlik Mar 9, 2022
d587617
consistent package name
petrsvihlik Mar 14, 2022
262b4b4
updated recordings - user agent, removed sanitizer
petrsvihlik Mar 14, 2022
dd92fc8
Merge branch 'main' into petrsvihlik/feature/core-v2-identity
petrsvihlik Mar 14, 2022
2c3762a
removed outdated comments
petrsvihlik Mar 16, 2022
eb34a59
Merge branch 'main' into petrsvihlik/feature/core-v2-identity
petrsvihlik Mar 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,742 changes: 1,994 additions & 1,748 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions sdk/communication/communication-identity/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Features Added

- Migrated from using `@azure/core-http` to `@azure/core-rest-pipeline` for the handling of HTTP requests. See [Azure Core v1 vs v2](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-rest-pipeline/documentation/core2.md) for more on the difference and benefits of the move.

### Breaking Changes

### Bugs Fixed
Expand Down
27 changes: 6 additions & 21 deletions sdk/communication/communication-identity/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// https://github.com/karma-runner/karma-chrome-launcher
process.env.CHROME_BIN = require("puppeteer").executablePath();
require("dotenv").config();
const {
jsonRecordingFilterFunction,
isPlaybackMode,
isSoftRecordMode,
isRecordMode,
} = require("@azure-tools/test-recorder");
const { relativeRecordingsPath } = require("@azure-tools/test-recorder");

process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath();

module.exports = function (config) {
config.set({
Expand All @@ -28,14 +25,10 @@ module.exports = function (config) {
"karma-coverage",
"karma-sourcemap-loader",
"karma-junit-reporter",
"karma-json-to-file-reporter",
"karma-json-preprocessor",
],

// list of files / patterns to load in the browser
files: ["dist-test/index.browser.js"].concat(
isPlaybackMode() || isSoftRecordMode() ? ["recordings/browsers/**/*.json"] : []
),
files: ["dist-test/index.browser.js"],

// list of files / patterns to exclude
exclude: [],
Expand All @@ -44,7 +37,6 @@ module.exports = function (config) {
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"**/*.js": ["sourcemap", "env"],
"recordings/browsers/**/*.json": ["json"],
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
//"dist-test/index.browser.js": ["coverage"]
Expand All @@ -61,12 +53,13 @@ module.exports = function (config) {
"AZURE_CLIENT_ID",
"AZURE_CLIENT_SECRET",
"AZURE_TENANT_ID",
"RECORDINGS_RELATIVE_PATH",
],

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ["mocha", "coverage", "junit", "json-to-file"],
reporters: ["mocha", "coverage", "junit"],

coverageReporter: {
// specify a common output directory
Expand All @@ -89,11 +82,6 @@ module.exports = function (config) {
properties: {}, // key value pair of properties to add to the <properties> section of the report
},

jsonToFileReporter: {
filter: jsonRecordingFilterFunction,
outputPath: ".",
},

// web server port
port: 9876,

Expand Down Expand Up @@ -130,9 +118,6 @@ module.exports = function (config) {
browserNoActivityTimeout: 600000,
browserDisconnectTimeout: 10000,
browserDisconnectTolerance: 3,
browserConsoleLogOptions: {
terminal: !isRecordMode(),
},

client: {
mocha: {
Expand Down
35 changes: 26 additions & 9 deletions sdk/communication/communication-identity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"generate:client": "autorest --typescript ./swagger/README.md && rushx format",
"integration-test:browser": "karma start --single-run",
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000 dist-esm/test/public/*.spec.js dist-esm/test/public/node/*.spec.js",
"integration-test:browser": "dev-tool run test:browser",
"integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 --exclude 'dist-esm/test/**/browser/*.spec.js' 'dist-esm/test/**/*.spec.js'",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
"lint": "eslint package.json api-extractor.json src test --ext .ts",
Expand All @@ -32,10 +32,26 @@
"test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
"test:watch": "npm run test -- --watch --reporter min",
"unit-test:browser": "karma start --single-run",
"unit-test:node": "mocha -r esm -r ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace --exclude \"test/**/browser/*.spec.ts\" \"test/**/*.spec.ts\"",
"unit-test:browser": "dev-tool run test:browser",
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
"//metadata": {
"constantPaths": [
{
"path": "src/generated/identityRestClientContext.ts",
"prefix": "packageDetails"
},
{
"path": "src/constants.ts",
"prefix": "SDK_VERSION"
},
{
"path": "swagger/README.md",
"prefix": "package-version"
}
]
},
"//sampleConfiguration": {
"productName": "Azure Communication Services - Identity",
"productSlugs": [
Expand Down Expand Up @@ -72,9 +88,10 @@
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/communication-common": "^1.1.0",
"@azure/communication-common": "^2.0.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-http": "^2.0.0",
"@azure/core-client": "^1.3.0",
"@azure/core-rest-pipeline": "^1.3.0",
"@azure/core-lro": "^2.2.0",
"@azure/core-paging": "^1.1.1",
"@azure/core-tracing": "1.0.0-preview.13",
Expand All @@ -83,11 +100,13 @@
"tslib": "^2.2.0"
},
"devDependencies": {
"@azure/core-util": "^1.0.0-beta.1",
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/test-utils": "^1.0.0",
"@azure-tools/test-recorder": "^1.0.0",
"@azure-tools/test-recorder": "^2.0.0",
"@azure/identity": "^2.0.1",
"@azure-tools/test-credential": "^1.0.0",
"@microsoft/api-extractor": "^7.18.11",
"@types/chai": "^4.1.6",
"@types/mocha": "^7.0.2",
Expand All @@ -104,8 +123,6 @@
"karma-env-preprocessor": "^0.1.1",
"karma-firefox-launcher": "^1.1.0",
"karma-ie-launcher": "^1.0.0",
"karma-json-preprocessor": "^0.3.3",
"karma-json-to-file-reporter": "^1.0.1",
"karma-junit-reporter": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-mocha": "^2.0.1",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading