File tree Expand file tree Collapse file tree 5 files changed +29
-19
lines changed
Expand file tree Collapse file tree 5 files changed +29
-19
lines changed Original file line number Diff line number Diff line change 183183 "default" : false ,
184184 "description" : " Suppress notifications about new QDK updates. If true, you will not be prompted about new features after updates."
185185 },
186- "Q#.azure.experimental. uploadSupplementalData" : {
186+ "Q#.azure.uploadSupplementalData" : {
187187 "type" : " boolean" ,
188- "default" : false ,
188+ "default" : true ,
189189 "tags" : [
190- " experimental "
190+ " hidden "
191191 ],
192192 "description" : " Upload supplemental input data (circuit diagram) to the storage container when submitting jobs to Azure Quantum."
193193 }
Original file line number Diff line number Diff line change @@ -672,17 +672,22 @@ async function uploadSupplementalData(
672672 token : string ,
673673 associationId : string ,
674674) {
675- const circuitDiagram = await getCircuitJson ( program ) ;
676-
677- await uploadBlob (
678- storageUris ,
679- quantumUris ,
680- token ,
681- "circuitDiagram" ,
682- circuitDiagram ,
683- "application/json" ,
684- associationId ,
685- ) ;
675+ const endpointMatch = quantumUris . endpoint . match ( QuantumUris . endpointRegExp ) ;
676+ const isV2Workspace = endpointMatch ?. groups ?. versionSuffix === "-v2" ;
677+
678+ if ( isV2Workspace ) {
679+ const circuitDiagram = await getCircuitJson ( program ) ;
680+
681+ await uploadBlob (
682+ storageUris ,
683+ quantumUris ,
684+ token ,
685+ "circuitDiagram" ,
686+ circuitDiagram ,
687+ "application/json" ,
688+ associationId ,
689+ ) ;
690+ }
686691}
687692
688693/**
Original file line number Diff line number Diff line change @@ -217,6 +217,14 @@ export class AzureUris {
217217export class QuantumUris {
218218 readonly apiVersion = "2022-09-12-preview" ;
219219
220+ // Regular expression to extract the first part of the endpointUri
221+ // - Captures only an exact "-v2" suffix (as versionSuffix) if present
222+ // - Otherwise, keeps any other suffix as part of the location
223+ // e.g. "https://westus.quantum.azure.com" -> location="westus", versionSuffix=undefined
224+ // e.g. "https://eastus2-v2.quantum.azure.com" -> location="eastus2", versionSuffix="-v2"
225+ public static readonly endpointRegExp =
226+ / h t t p s : \/ \/ (?< location > [ ^ . ] + ?) (?< versionSuffix > - v 2 ) ? \. / ;
227+
220228 constructor (
221229 public endpoint : string , // e.g. "https://westus.quantum.azure.com"
222230 public id : string , // e.g. "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/quantumResourcegroup/providers/Microsoft.Quantum/Workspaces/quantumworkspace1"
Original file line number Diff line number Diff line change @@ -91,11 +91,8 @@ export function getPythonCodeForWorkspace(
9191 const idRegex =
9292 / \/ s u b s c r i p t i o n s \/ (?< subscriptionId > [ ^ / ] + ) \/ r e s o u r c e G r o u p s \/ (?< resourceGroup > [ ^ / ] + ) / ;
9393
94- // Regular expression to extract the first part of the endpointUri
95- const endpointRegex = / h t t p s : \/ \/ (?< location > [ ^ . ] + ) \. / ;
96-
9794 const idMatch = id . match ( idRegex ) ;
98- const endpointMatch = endpointUri . match ( endpointRegex ) ;
95+ const endpointMatch = endpointUri . match ( QuantumUris . endpointRegExp ) ;
9996
10097 const subscriptionId = idMatch ?. groups ?. subscriptionId ;
10198 const resourceGroup = idMatch ?. groups ?. resourceGroup ;
Original file line number Diff line number Diff line change @@ -48,5 +48,5 @@ export function getShowDevDiagnostics(): boolean {
4848export function getUploadSupplementalData ( ) : boolean {
4949 return vscode . workspace
5050 . getConfiguration ( "Q#" )
51- . get < boolean > ( "azure.experimental. uploadSupplementalData" , false ) ;
51+ . get < boolean > ( "azure.uploadSupplementalData" , true ) ;
5252}
You can’t perform that action at this time.
0 commit comments