Skip to content

Commit d76a008

Browse files
eng, use dev lib of spector and azure-http-specs for nightly build (#3054)
1 parent 3ea53dd commit d76a008

File tree

68 files changed

+1636
-2106
lines changed

Some content is hidden

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

68 files changed

+1636
-2106
lines changed

eng/sdk/sync_sdk.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717

1818
skip_artifacts: List[str] = [
1919
"azure-ai-anomalydetector", # deprecated
20-
"azure-health-insights-cancerprofiling", # deprecated
21-
"azure-health-insights-clinicalmatching", # no TypeSpec source file
22-
"azure-ai-vision-imageanalysis", # temporary disabled for modification on Javadoc
2320
"azure-ai-inference", # commit not on main branch
2421
"azure-developer-devcenter", # 2 breaks introduced into stable api-version
2522
"azure-compute-batch", # Large change in same api-verion
@@ -141,6 +138,10 @@ def update_sdks():
141138
logging.error(f"Failed to generate for module {artifact}")
142139
failed_modules.append(artifact)
143140

141+
if not arm_module:
142+
# run mvn package, as this is what's done in "TypeSpec-Compare-CurrentToCodegeneration.ps1" script
143+
subprocess.check_call(["mvn", "--no-transfer-progress", "codesnippet:update-codesnippet"], cwd=module_path)
144+
144145
if arm_module:
145146
# revert mock test code
146147
cmd = ["git", "checkout", "src/test"]

typespec-tests/Generate.ps1

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ $generateScript = {
6363
} elseif ($tspFile -match "arm.tsp") {
6464
# for mgmt, do not generate tests due to random mock values
6565
$tspOptions += " --option ""@azure-tools/typespec-java.generate-tests=false"""
66-
# also don't generate with stream-style-serialization as azure-core-management hasn't migrated to azure-json yet
67-
$tspOptions += " --option ""@azure-tools/typespec-java.stream-style-serialization=false"""
6866
# also test generating from specific api-version
6967
$tspOptions += " --option ""@azure-tools/typespec-java.api-version=2023-11-01"""
7068
# exclude preview from service versions

typespec-tests/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
},
1111
"dependencies": {
1212
"@typespec/spec-api": "0.1.0-alpha.3",
13-
"@typespec/spector": "0.1.0-alpha.10",
13+
"@typespec/spector": "0.1.0-alpha.11-dev.2",
1414
"@typespec/http-specs": "0.1.0-alpha.16",
15-
"@azure-tools/azure-http-specs": "0.1.0-alpha.12",
15+
"@azure-tools/azure-http-specs": "0.1.0-alpha.13-dev.2",
1616
"@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.28.0.tgz"
1717
},
1818
"devDependencies": {
@@ -30,8 +30,8 @@
3030
"@typespec/events": "~0.67.1",
3131
"@typespec/sse": "~0.67.1",
3232
"@typespec/streams": "~0.67.1",
33-
"@azure-tools/typespec-azure-core": "~0.53.0",
34-
"@azure-tools/typespec-client-generator-core": "~0.53.0",
33+
"@azure-tools/typespec-azure-core": "0.54.0-dev.5",
34+
"@azure-tools/typespec-client-generator-core": "0.54.0-dev.22",
3535
"@azure-tools/typespec-azure-resource-manager": "~0.53.0",
3636
"@azure-tools/typespec-autorest": "~0.53.0"
3737
},

typespec-tests/src/main/java/encode/bytes/ResponseBodyAsyncClient.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import com.azure.core.exception.ResourceNotFoundException;
1515
import com.azure.core.http.rest.RequestOptions;
1616
import com.azure.core.http.rest.Response;
17+
import com.azure.core.util.Base64Url;
1718
import com.azure.core.util.BinaryData;
1819
import com.azure.core.util.FluxUtil;
1920
import encode.bytes.implementation.ResponseBodiesImpl;
@@ -135,7 +136,7 @@ public Mono<Response<BinaryData>> base64WithResponse(RequestOptions requestOptio
135136
*
136137
* <pre>
137138
* {@code
138-
* byte[]
139+
* Base64Url
139140
* }
140141
* </pre>
141142
*
@@ -241,6 +242,6 @@ public Mono<byte[]> base64url() {
241242
// Generated convenience method for base64urlWithResponse
242243
RequestOptions requestOptions = new RequestOptions();
243244
return base64urlWithResponse(requestOptions).flatMap(FluxUtil::toMono)
244-
.map(protocolMethodData -> protocolMethodData.toObject(byte[].class));
245+
.map(protocolMethodData -> protocolMethodData.toObject(Base64Url.class).decodedBytes());
245246
}
246247
}

typespec-tests/src/main/java/encode/bytes/ResponseBodyClient.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import com.azure.core.exception.ResourceNotFoundException;
1515
import com.azure.core.http.rest.RequestOptions;
1616
import com.azure.core.http.rest.Response;
17+
import com.azure.core.util.Base64Url;
1718
import com.azure.core.util.BinaryData;
1819
import encode.bytes.implementation.ResponseBodiesImpl;
1920

@@ -133,7 +134,7 @@ public Response<BinaryData> base64WithResponse(RequestOptions requestOptions) {
133134
*
134135
* <pre>
135136
* {@code
136-
* byte[]
137+
* Base64Url
137138
* }
138139
* </pre>
139140
*
@@ -237,6 +238,6 @@ public byte[] base64() {
237238
public byte[] base64url() {
238239
// Generated convenience method for base64urlWithResponse
239240
RequestOptions requestOptions = new RequestOptions();
240-
return base64urlWithResponse(requestOptions).getValue().toObject(byte[].class);
241+
return base64urlWithResponse(requestOptions).getValue().toObject(Base64Url.class).decodedBytes();
241242
}
242243
}

typespec-tests/src/main/java/encode/bytes/implementation/ResponseBodiesImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public Response<BinaryData> base64WithResponse(RequestOptions requestOptions) {
342342
*
343343
* <pre>
344344
* {@code
345-
* byte[]
345+
* Base64Url
346346
* }
347347
* </pre>
348348
*
@@ -366,7 +366,7 @@ public Mono<Response<BinaryData>> base64urlWithResponseAsync(RequestOptions requ
366366
*
367367
* <pre>
368368
* {@code
369-
* byte[]
369+
* Base64Url
370370
* }
371371
* </pre>
372372
*

typespec-tests/src/main/java/tsptest/armresourceprovider/implementation/ArmResourceProviderClientImpl.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,12 @@
1515
import com.azure.core.management.exception.ManagementException;
1616
import com.azure.core.management.polling.PollResult;
1717
import com.azure.core.management.polling.PollerFactory;
18-
import com.azure.core.management.polling.SyncPollerFactory;
19-
import com.azure.core.util.BinaryData;
2018
import com.azure.core.util.Context;
2119
import com.azure.core.util.CoreUtils;
2220
import com.azure.core.util.logging.ClientLogger;
2321
import com.azure.core.util.polling.AsyncPollResponse;
2422
import com.azure.core.util.polling.LongRunningOperationStatus;
2523
import com.azure.core.util.polling.PollerFlux;
26-
import com.azure.core.util.polling.SyncPoller;
2724
import com.azure.core.util.serializer.SerializerAdapter;
2825
import com.azure.core.util.serializer.SerializerEncoding;
2926
import java.io.IOException;
@@ -294,23 +291,6 @@ public <T, U> PollerFlux<PollResult<T>, U> getLroResult(Mono<Response<Flux<ByteB
294291
defaultPollInterval, activationResponse, context);
295292
}
296293

297-
/**
298-
* Gets long running operation result.
299-
*
300-
* @param activationResponse the response of activation operation.
301-
* @param pollResultType type of poll result.
302-
* @param finalResultType type of final result.
303-
* @param context the context shared by all requests.
304-
* @param <T> type of poll result.
305-
* @param <U> type of final result.
306-
* @return SyncPoller for poll result and final result.
307-
*/
308-
public <T, U> SyncPoller<PollResult<T>, U> getLroResult(Response<BinaryData> activationResponse,
309-
Type pollResultType, Type finalResultType, Context context) {
310-
return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType,
311-
defaultPollInterval, () -> activationResponse, context);
312-
}
313-
314294
/**
315295
* Gets the final result, or an error, based on last async poll response.
316296
*

0 commit comments

Comments
 (0)