Skip to content

Commit cc969de

Browse files
authored
[appconfiguration] Remove UUID (#28044)
### Packages impacted by this PR - @azure/app-configuration ### Issues associated with this PR ### Describe the problem that is addressed by this PR Removes the UUID module in favor of @azure/core-util. ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? ### Are there test cases added in this PR? _(If not, why?)_ ### Provide a list of related PRs _(if any)_ ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ ### Checklists - [x] Added impacted package name to the issue description - [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [ ] Added a changelog (if necessary)
1 parent 491603c commit cc969de

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

sdk/appconfiguration/app-configuration/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"@azure/core-rest-pipeline": "^1.6.0",
8888
"@azure/core-tracing": "^1.0.0",
8989
"@azure/core-auth": "^1.3.0",
90-
"@azure/core-util": "^1.1.0",
90+
"@azure/core-util": "^1.6.1",
9191
"@azure/logger": "^1.0.0",
9292
"tslib": "^2.2.0"
9393
},
@@ -105,7 +105,6 @@
105105
"@types/mocha": "^10.0.0",
106106
"@types/node": "^18.0.0",
107107
"@types/sinon": "^17.0.0",
108-
"@types/uuid": "^8.3.4",
109108
"chai": "^4.2.0",
110109
"dotenv": "^16.0.0",
111110
"eslint": "^8.0.0",
@@ -128,7 +127,6 @@
128127
"ts-node": "^10.0.0",
129128
"typescript": "~5.2.0",
130129
"uglify-js": "^3.4.9",
131-
"uuid": "^8.3.0",
132130
"cross-env": "^7.0.2"
133131
},
134132
"//sampleConfiguration": {

sdk/appconfiguration/app-configuration/test/internal/node/throttlingRetryPolicy.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { AbortController } from "@azure/abort-controller";
55
import { AppConfigurationClient } from "../../../src";
66
import { RestError } from "@azure/core-rest-pipeline";
77
import chai from "chai";
8-
import { v4 as generateUuid } from "uuid";
8+
import { randomUUID } from "@azure/core-util";
99
import nock from "nock";
1010

1111
describe("Should not retry forever", () => {
@@ -40,7 +40,7 @@ describe("Should not retry forever", () => {
4040

4141
it("simulate the service throttling - honors the abort signal passed", async () => {
4242
mockErrorResponse("123456");
43-
const key = generateUuid();
43+
const key = randomUUID();
4444
const numberOfSettings = 200;
4545
const promises = [];
4646
let errorWasThrown = false;
@@ -71,7 +71,7 @@ describe("Should not retry forever", () => {
7171
for (let index = 0; index < responseCount; index++) {
7272
mockErrorResponse("100", false);
7373
}
74-
const key = generateUuid();
74+
const key = randomUUID();
7575
let errorWasThrown = false;
7676

7777
chai.assert.equal(

sdk/appconfiguration/perf-tests/app-configuration/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@
99
"license": "ISC",
1010
"dependencies": {
1111
"@azure/app-configuration": "1.5.0-beta.2",
12+
"@azure/core-util": "^1.6.1",
1213
"@azure/test-utils-perf": "^1.0.0",
1314
"dotenv": "^16.0.0"
1415
},
1516
"devDependencies": {
16-
"@types/uuid": "^8.0.0",
1717
"@types/node": "^18.0.0",
1818
"eslint": "^8.0.0",
1919
"prettier": "^2.5.1",
2020
"rimraf": "^3.0.0",
21-
"uuid": "^8.3.0",
2221
"tslib": "^2.2.0",
2322
"ts-node": "^10.0.0",
2423
"typescript": "~5.2.0"

sdk/appconfiguration/perf-tests/app-configuration/test/listSettings.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT license.
33

4-
import { v4 as generateUuid } from "uuid";
4+
import { randomUUID } from "@azure/core-util";
55
import { PerfOptionDictionary, executeParallel } from "@azure/test-utils-perf";
66
import { AppConfigTest } from "./appConfigBase.spec";
77

@@ -13,7 +13,7 @@ interface ListTestOptions {
1313
}
1414

1515
export class ListSettingsTest extends AppConfigTest<ListTestOptions> {
16-
static prefix = generateUuid();
16+
static prefix = randomUUID();
1717
public options: PerfOptionDictionary<ListTestOptions> = {
1818
count: {
1919
required: true,
@@ -30,7 +30,7 @@ export class ListSettingsTest extends AppConfigTest<ListTestOptions> {
3030
await executeParallel(
3131
async () => {
3232
await this.client.addConfigurationSetting({
33-
key: ListSettingsTest.prefix + generateUuid(),
33+
key: ListSettingsTest.prefix + randomUUID(),
3434
value: "random",
3535
});
3636
},

0 commit comments

Comments
 (0)