Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.

Commit a59f51a

Browse files
authored
Fix quantum status readonly bug (Azure#32494)
* Fix quantum status readonly bug * Fix format * Use built-in tags feature
1 parent cdd0874 commit a59f51a

File tree

5 files changed

+25
-63
lines changed

5 files changed

+25
-63
lines changed

specification/quantum/Microsoft.Quantum.Management/QuantumWorkspace.tsp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ interface Workspaces {
4444
/**
4545
* Updates an existing Workspace's tags.
4646
*/
47-
@parameterVisibility
48-
updateTags is ArmCustomPatchSync<QuantumWorkspace, PatchModel = TagsObject>;
47+
updateTags is ArmTagsPatchSync<QuantumWorkspace>;
4948

5049
/**
5150
* Deletes a Workspace resource.

specification/quantum/Microsoft.Quantum.Management/models.tsp

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -437,47 +437,6 @@ model Provider {
437437
resourceUsageId?: string;
438438
}
439439

440-
/**
441-
* Common fields that are returned in the response for all Azure Resource Manager resources
442-
*/
443-
model Resource {
444-
/**
445-
* Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
446-
*/
447-
@visibility("read")
448-
id?: Azure.Core.armResourceIdentifier;
449-
450-
/**
451-
* The name of the resource
452-
*/
453-
@visibility("read")
454-
name?: string;
455-
456-
/**
457-
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
458-
*/
459-
@visibility("read")
460-
type?: string;
461-
462-
/**
463-
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
464-
*/
465-
@visibility("read")
466-
systemData?: SystemData;
467-
}
468-
469-
/**
470-
* Tags object for patch operations.
471-
*/
472-
#suppress "@azure-tools/typespec-azure-resource-manager/patch-envelope" ""
473-
model TagsObject {
474-
/**
475-
* Resource tags.
476-
*/
477-
#suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" ""
478-
tags?: Record<string>;
479-
}
480-
481440
/**
482441
* Result of list Api keys and connection strings.
483442
*/

specification/quantum/Microsoft.Quantum.Management/tspconfig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ emit:
22
- "@azure-tools/typespec-autorest"
33
options:
44
"@azure-tools/typespec-autorest":
5-
use-read-only-status-schema: true
5+
use-read-only-status-schema: false
66
omit-unreachable-types: true
77
emitter-output-dir: "{project-root}/.."
88
azure-resource-provider-folder: "resource-manager"

specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/quantum.json

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@
412412
"description": "Parameters supplied to update tags.",
413413
"required": true,
414414
"schema": {
415-
"$ref": "#/definitions/TagsObject"
415+
"$ref": "#/definitions/QuantumWorkspaceTagsUpdate"
416416
}
417417
}
418418
],
@@ -918,8 +918,7 @@
918918
"description": "The provider is failed."
919919
}
920920
]
921-
},
922-
"readOnly": true
921+
}
923922
},
924923
"QuantumWorkspace": {
925924
"type": "object",
@@ -961,6 +960,19 @@
961960
"value"
962961
]
963962
},
963+
"QuantumWorkspaceTagsUpdate": {
964+
"type": "object",
965+
"description": "The type used for updating tags in QuantumWorkspace resources.",
966+
"properties": {
967+
"tags": {
968+
"type": "object",
969+
"description": "Resource tags.",
970+
"additionalProperties": {
971+
"type": "string"
972+
}
973+
}
974+
}
975+
},
964976
"QuotaDimension": {
965977
"type": "object",
966978
"description": "Information about a specific quota dimension.",
@@ -1051,19 +1063,6 @@
10511063
}
10521064
}
10531065
},
1054-
"TagsObject": {
1055-
"type": "object",
1056-
"description": "Tags object for patch operations.",
1057-
"properties": {
1058-
"tags": {
1059-
"type": "object",
1060-
"description": "Resource tags.",
1061-
"additionalProperties": {
1062-
"type": "string"
1063-
}
1064-
}
1065-
}
1066-
},
10671066
"TargetDescription": {
10681067
"type": "object",
10691068
"description": "Information about a Target. A target is the component that can process a specific type of Job.",
@@ -1178,8 +1177,7 @@
11781177
"description": "The Workspace is currently provisioning a provider."
11791178
}
11801179
]
1181-
},
1182-
"readOnly": true
1180+
}
11831181
},
11841182
"WorkspaceResourceProperties": {
11851183
"type": "object",

specification/quantum/resource-manager/readme.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ See configuration in [readme.typescript.md](./readme.typescript.md)
9595

9696
See configuration in [readme.csharp.md](./readme.csharp.md)
9797

98-
## Suppression
98+
## Suppressions
9999

100100
``` yaml
101101
directive:
@@ -108,3 +108,9 @@ directive:
108108
from: quantum.json
109109
reason: We don't have end customers making direct API calls and this is a breaking change for our existing clients.
110110
```
111+
112+
```yaml
113+
suppressions:
114+
- code: ProvisioningStateMustBeReadOnly
115+
reason: The provisioningState being flagged is not the ARM resource provisioningState, but the field for our ProviderStatus. Currently, this cannot be readOnly, or it will cause livesite issue and workspace does not behave correctly. We have on our roadmap to fix this issue, but this needs to be settable for control plane to work properly.
116+
```

0 commit comments

Comments
 (0)