Skip to content

Commit 8b79ef0

Browse files
committed
Merge remote-tracking branch 'origin/main' into use-tsconfig-src-build
2 parents 9736cab + 51cb4a5 commit 8b79ef0

560 files changed

Lines changed: 25814 additions & 23712 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,9 @@
491491
# PRLabel: %Mgmt
492492
/sdk/databox/arm-databox/ @qiaozha @MaryGao
493493

494+
# PRLabel: %Mgmt
495+
/sdk/dell/arm-dell-storage/ @qiaozha @MaryGao
496+
494497
# PRLabel: %Mgmt
495498
/sdk/dashboard/arm-dashboard/ @qiaozha @MaryGao
496499

common/config/rush/pnpm-lock.yaml

Lines changed: 148 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/ignore-links.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ https://learn.microsoft.com/javascript/api/@azure/arm-portalservicescopilot?view
3232
https://learn.microsoft.com/javascript/api/@azure/arm-onlineexperimentation?view=azure-node-preview
3333
https://learn.microsoft.com/javascript/api/@azure-rest/analytics-onlineexperimentation?view=azure-node-preview
3434
https://learn.microsoft.com/javascript/api/@azure/arm-carbonoptimization?view=azure-node-preview
35+
https://learn.microsoft.com/javascript/api/@azure/arm-dell-storage?view=azure-node-preview
3536
https://learn.microsoft.com/javascript/api/@azure/arm-mongodbatlas?view=azure-node-preview
3637
https://learn.microsoft.com/javascript/api/@azure/arm-purestorageblock?view=azure-node-preview
3738
https://learn.microsoft.com/javascript/api/@azure/arm-kubernetesconfiguration-extensiontypes?view=azure-node-preview
@@ -44,3 +45,4 @@ https://learn.microsoft.com/javascript/api/@azure/arm-playwright?view=azure-node
4445
https://learn.microsoft.com/javascript/api/@azure/arm-cloudhealth?view=azure-node-preview
4546
https://learn.microsoft.com/javascript/api/@azure/arm-resourcesbicep?view=azure-node-preview
4647
https://learn.microsoft.com/javascript/api/@azure/arm-resourcesdeployments?view=azure-node-preview
48+

rush.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* This is the main configuration file for Rush.
33
* For full documentation, please see https://rushjs.io
4-
*/ {
4+
*/{
55
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json",
66
/**
77
* (Required) This specifies the version of the Rush engine to be used in this repo.
@@ -2380,6 +2380,11 @@
23802380
"projectFolder": "sdk/carbonoptimization/arm-carbonoptimization",
23812381
"versionPolicyName": "management"
23822382
},
2383+
{
2384+
"packageName": "@azure/arm-dell-storage",
2385+
"projectFolder": "sdk/dell/arm-dell-storage",
2386+
"versionPolicyName": "management"
2387+
},
23832388
{
23842389
"packageName": "@azure/arm-mongodbatlas",
23852390
"projectFolder": "sdk/mongodbatlas/arm-mongodbatlas",
@@ -2446,4 +2451,4 @@
24462451
"versionPolicyName": "management"
24472452
}
24482453
]
2449-
}
2454+
}

sdk/cosmosdb/cosmos/src/CosmosClient.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ export class CosmosClient {
161161
optionsOrConnectionString.connectionPolicy.enablePartitionLevelFailover ||
162162
optionsOrConnectionString.connectionPolicy.enablePartitionLevelCircuitBreaker
163163
) {
164+
if (!optionsOrConnectionString.connectionPolicy.enableEndpointDiscovery) {
165+
throw new Error(
166+
"enableEndpointDiscovery must be set to true to use partition level failover or circuit breaker.",
167+
);
168+
}
164169
this.globalPartitionEndpointManager = new GlobalPartitionEndpointManager(
165170
optionsOrConnectionString,
166171
globalEndpointManager,

sdk/cosmosdb/cosmos/src/client/ChangeFeed/ChangeFeedForPartitionKey.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { DiagnosticNodeInternal } from "../../diagnostics/DiagnosticNodeInternal
1313
import { getEmptyCosmosDiagnostics, withDiagnostics } from "../../utils/diagnostics.js";
1414
import { ChangeFeedMode } from "./ChangeFeedMode.js";
1515
import { decryptChangeFeedResponse } from "./changeFeedUtils.js";
16+
import { computePartitionKeyRangeId } from "../ClientUtils.js";
1617
/**
1718
* @hidden
1819
* Provides iterator for change feed for one partition key.
@@ -187,6 +188,14 @@ export class ChangeFeedForPartitionKey<T> implements ChangeFeedPullModelIterator
187188
feedOptions.containerRid = this.container._rid;
188189
}
189190
try {
191+
const isPartitionLevelFailOverEnabled = this.clientContext.isPartitionLevelFailOverEnabled();
192+
const partitionKeyRangeId = await computePartitionKeyRangeId(
193+
diagnosticNode,
194+
convertToInternalPartitionKey(this.partitionKey),
195+
this.clientContext.partitionKeyRangeCache,
196+
isPartitionLevelFailOverEnabled,
197+
this.container,
198+
);
190199
const response: Response<Array<T & Resource>> = await (this.clientContext.queryFeed<T>({
191200
path: this.resourceLink,
192201
resourceType: ResourceType.item,
@@ -196,6 +205,7 @@ export class ChangeFeedForPartitionKey<T> implements ChangeFeedPullModelIterator
196205
query: undefined,
197206
options: feedOptions,
198207
partitionKey: this.partitionKey,
208+
partitionKeyRangeId,
199209
}) as Promise<any>);
200210
return new ChangeFeedIteratorResponse(
201211
response.result,

sdk/cosmosdb/cosmos/src/client/Item/Items.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,16 @@ export class Items {
233233
): Promise<QueryIterator<ItemDefinition>> {
234234
const encryptionSqlQuerySpec = queryBuilder.toEncryptionSqlQuerySpec();
235235
const sqlQuerySpec = await this.buildSqlQuerySpec(encryptionSqlQuerySpec);
236+
if (this.clientContext.enableEncryption && options.partitionKey) {
237+
await this.container.checkAndInitializeEncryption();
238+
const { partitionKeyList, encryptedCount } =
239+
await this.container.encryptionProcessor.getEncryptedPartitionKeyValue([
240+
options.partitionKey,
241+
] as PartitionKeyInternal);
242+
if (encryptedCount > 0) {
243+
options.partitionKey = partitionKeyList[0];
244+
}
245+
}
236246
const iterator = this.query<ItemDefinition>(sqlQuerySpec, options);
237247
return iterator;
238248
}

sdk/cosmosdb/cosmos/src/encryption/Cache/ProtectedDataEncryptionKeyCache.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { randomBytes } from "node:crypto";
55
import { ProtectedDataEncryptionKey } from "../EncryptionKey/ProtectedDataEncryptionKey.js";
66
import type { KeyEncryptionKey } from "../KeyEncryptionKey.js";
77
import { Constants } from "../../common/index.js";
8+
import { startBackgroundTask } from "../../utils/time.js";
89

910
/**
1011
* The cache used to store the protected data encryption key.
@@ -37,7 +38,7 @@ export class ProtectedDataEncryptionKeyCache {
3738
}
3839

3940
private async clearCacheOnTtlExpiry(): Promise<void> {
40-
this.cacheRefresher = setInterval(() => {
41+
this.cacheRefresher = startBackgroundTask(async () => {
4142
const now = new Date();
4243
for (const key of this.cache.keys()) {
4344
if (now.getTime() - this.cache.get(key)[0].getTime() > this.cacheTimeToLive) {

0 commit comments

Comments
 (0)