Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade typespec compiler to v0.63 and cadl ranch spec to the latest #2942

Merged
merged 11 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
391 changes: 230 additions & 161 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions packages/typespec-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
"type": "module",
"dependencies": {
"@azure-tools/typespec-ts": "workspace:^0.35.0",
"@typespec/openapi": ">=0.62.0 <1.0.0",
"@azure-tools/typespec-autorest": ">=0.48.0 <1.0.0",
"@typespec/openapi3": ">=0.62.0 <1.0.0",
"@azure-tools/typespec-azure-core": ">=0.48.0 <1.0.0",
"@azure-tools/typespec-client-generator-core": ">=0.48.3 <1.0.0",
"@azure-tools/typespec-azure-resource-manager": ">=0.48.0 <1.0.0",
"@azure-tools/typespec-azure-rulesets": ">=0.48.0 <1.0.0",
"@typespec/compiler": ">=0.62.0 <1.0.0",
"@typespec/http": ">=0.62.0 <1.0.0",
"@typespec/rest": ">=0.62.0 <1.0.0",
"@typespec/versioning": ">=0.62.0 <1.0.0",
"@typespec/openapi": ">=0.63.0 <1.0.0",
"@azure-tools/typespec-autorest": ">=0.49.0 <1.0.0",
"@typespec/openapi3": ">=0.63.0 <1.0.0",
"@azure-tools/typespec-azure-core": ">=0.49.0 <1.0.0",
"@azure-tools/typespec-client-generator-core": ">=0.49.0 <1.0.0",
"@azure-tools/typespec-azure-resource-manager": ">=0.49.0 <1.0.0",
"@azure-tools/typespec-azure-rulesets": ">=0.49.0 <1.0.0",
"@typespec/compiler": ">=0.63.0 <1.0.0",
"@typespec/http": ">=0.63.0 <1.0.0",
"@typespec/rest": ">=0.63.0 <1.0.0",
"@typespec/versioning": ">=0.63.0 <1.0.0",
"prettier": "^3.1.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,8 @@ export interface NetworkAnalyticsClientOptionalParams extends ClientOptions {

// @public
export interface Operation {
actionType?: ActionType;
readonly display?: OperationDisplay;
readonly actionType?: ActionType;
MaryGao marked this conversation as resolved.
Show resolved Hide resolved
display?: OperationDisplay;
readonly isDataAction?: boolean;
readonly name?: string;
readonly origin?: Origin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1292,11 +1292,11 @@ export interface Operation {
/** Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. */
readonly isDataAction?: boolean;
/** Localized display information for this particular operation. */
readonly display?: OperationDisplay;
display?: OperationDisplay;
/** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */
readonly origin?: Origin;
/** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */
actionType?: ActionType;
readonly actionType?: ActionType;
}

export function operationDeserializer(item: any): Operation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ model ModelList {
maxCount: int32;

@doc("The link to fetch more models.")
@Azure.Core.nextLink
@TypeSpec.nextLink
nextLink?: string;
}

Expand Down
26 changes: 13 additions & 13 deletions packages/typespec-test/test/batch_modular/spec/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ model ApplicationListResult {

#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Property types must use camelCase"
@doc("The URL to get the next set of results.")
@Azure.Core.nextLink
@TypeSpec.nextLink
`odata.nextLink`?: string;
}

Expand Down Expand Up @@ -642,7 +642,7 @@ model PoolListUsageMetricsResult {

#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Property types must use camelCase"
@doc("The URL to get the next set of results.")
@Azure.Core.nextLink
@TypeSpec.nextLink
`odata.nextLink`?: string;
}

Expand Down Expand Up @@ -673,7 +673,7 @@ model AccountListSupportedImagesResult {

#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Property types must use camelCase"
@doc("The URL to get the next set of results.")
@Azure.Core.nextLink
@TypeSpec.nextLink
`odata.nextLink`?: string;
}

Expand Down Expand Up @@ -738,7 +738,7 @@ model PoolNodeCountsListResult {

#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Property types must use camelCase"
@doc("The URL to get the next set of results.")
@Azure.Core.nextLink
@TypeSpec.nextLink
`odata.nextLink`?: string;
}

Expand Down Expand Up @@ -1001,7 +1001,7 @@ model CertificateListResult {

#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Property types must use camelCase"
@doc("The URL to get the next set of results.")
@Azure.Core.nextLink
@TypeSpec.nextLink
`odata.nextLink`?: string;
}

Expand All @@ -1017,7 +1017,7 @@ model NodeFileListResult {

#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Property types must use camelCase"
@doc("The URL to get the next set of results.")
@Azure.Core.nextLink
@TypeSpec.nextLink
`odata.nextLink`?: string;
}

Expand Down Expand Up @@ -2228,7 +2228,7 @@ model BatchJobScheduleListResult {

#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Property types must use camelCase"
@doc("The URL to get the next set of results.")
@Azure.Core.nextLink
@TypeSpec.nextLink
`odata.nextLink`?: string;
}

Expand Down Expand Up @@ -2461,7 +2461,7 @@ model BatchJobListResult {

#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Property types must use camelCase"
@doc("The URL to get the next set of results.")
@Azure.Core.nextLink
@TypeSpec.nextLink
`odata.nextLink`?: string;
}

Expand All @@ -2477,7 +2477,7 @@ model BatchJobListPreparationAndReleaseTaskStatusResult {

#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Property types must use camelCase"
@doc("The URL to get the next set of results.")
@Azure.Core.nextLink
@TypeSpec.nextLink
`odata.nextLink`?: string;
}

Expand Down Expand Up @@ -2998,7 +2998,7 @@ model BatchPoolListResult {

#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Property types must use camelCase"
@doc("The URL to get the next set of results.")
@Azure.Core.nextLink
@TypeSpec.nextLink
`odata.nextLink`?: string;
}

Expand Down Expand Up @@ -3422,7 +3422,7 @@ model BatchTaskListResult {

#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Property types must use camelCase"
@doc("The URL to get the next set of results.")
@Azure.Core.nextLink
@TypeSpec.nextLink
`odata.nextLink`?: string;
}

Expand Down Expand Up @@ -3783,7 +3783,7 @@ model BatchNodeListResult {

#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Property types must use camelCase"
@doc("The URL to get the next set of results.")
@Azure.Core.nextLink
@TypeSpec.nextLink
`odata.nextLink`?: string;
}

Expand Down Expand Up @@ -3840,6 +3840,6 @@ model NodeVMExtensionList {
value?: NodeVMExtension[];

@doc("The URL to get the next set of results.")
@Azure.Core.nextLink
@TypeSpec.nextLink
`odata.nextLink`?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ model PagedLedgerEntries {
state: LedgerQueryState;

@doc("Path from which to retrieve the next page of results.")
@Azure.Core.nextLink
@TypeSpec.nextLink
nextLink?: ResourceLocation<LedgerEntry>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import { AbortSignalLike } from '@azure/abort-controller';
import { ClientOptions } from '@azure-rest/core-client';
import { ErrorModel } from '@azure-rest/core-client';
import { KeyCredential } from '@azure/core-auth';
import { OperationOptions } from '@azure-rest/core-client';
import { OperationState } from '@azure/core-lro';
Expand Down Expand Up @@ -183,16 +182,6 @@ export interface GenericProcedureRecommendation extends ProcedureRecommendation
kind: "genericProcedureRecommendation";
}

// @public
export interface HealthInsightsOperationStatusError {
readonly createdDateTime?: Date;
error?: ErrorModel;
readonly expirationDateTime?: Date;
readonly id: string;
readonly lastUpdateDateTime?: Date;
readonly status: JobStatus;
}

// @public
export interface Identifier extends Element {
assigner?: Reference;
Expand Down Expand Up @@ -227,9 +216,6 @@ export interface InferRadiologyInsightsOptionalParams extends OperationOptions {
updateIntervalInMs?: number;
}

// @public
export type JobStatus = "notStarted" | "running" | "succeeded" | "failed" | "canceled";

// @public
export enum KnownApiVersion {
// (undocumented)
Expand Down Expand Up @@ -457,17 +443,6 @@ export interface RadiologyInsightsPatientResult {
patientId: string;
}

// @public
export interface RadiologyInsightsResult {
readonly createdDateTime?: Date;
error?: ErrorModel;
readonly expirationDateTime?: Date;
readonly id: string;
readonly lastUpdateDateTime?: Date;
result?: RadiologyInsightsInferenceResult;
readonly status: JobStatus;
}

// @public
export interface RadiologyProcedureInference extends RadiologyInsightsInference {
imagingProcedures: ImagingProcedure[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ export {
RadiologyInsightsInferenceOptions,
FollowupRecommendationOptions,
FindingOptions,
HealthInsightsOperationStatusError,
JobStatus,
RadiologyInsightsInferenceResult,
RadiologyInsightsPatientResult,
RadiologyInsightsInference,
Expand Down Expand Up @@ -73,7 +71,6 @@ export {
DomainResource,
DomainResourceUnion,
Narrative,
RadiologyInsightsResult,
RepeatabilityResult,
KnownApiVersion,
} from "./models/index.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ export {
RadiologyInsightsInferenceOptions,
FollowupRecommendationOptions,
FindingOptions,
HealthInsightsOperationStatusError,
JobStatus,
RadiologyInsightsInferenceResult,
RadiologyInsightsPatientResult,
RadiologyInsightsInference,
Expand Down Expand Up @@ -71,7 +69,6 @@ export {
DomainResource,
DomainResourceUnion,
Narrative,
RadiologyInsightsResult,
RepeatabilityResult,
KnownApiVersion,
} from "./models.js";
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { ErrorModel } from "@azure-rest/core-client";

/** A patient record, including their clinical information and data. */
export interface PatientRecord {
/** A given identifier for the patient. Has to be unique across all patients in a single request. */
Expand Down Expand Up @@ -1069,49 +1067,6 @@ export function patientRecordArraySerializer(
});
}

/** Provides status details for long running operations. */
export interface HealthInsightsOperationStatusError {
/** The unique ID of the operation. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls help investigate why the model is removed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because tcgc changes the operation status as LroInitial & Json. I think we could accept this breaking considering we would not directly use these models. If we have the usage for this model we could add usage decorator to mitigate this breaking.
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a breaking for HLC? if so, could you create an issue in #2367

Copy link
Member

@MaryGao MaryGao Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would assume no. Swagger side if the polling operation is exposed to public then during converting to tsp relevant models would be tagged with output usage and would include in modular.

Another thing is the health insight case in which we have nested result in body is not supported in hlc yet, so i would assume for this case the body type is directly exposed to public and its usage would be not limited to polling usage.

readonly id: string;
/** The status of the operation */
readonly status: JobStatus;
/** The date and time when the processing job was created. */
readonly createdDateTime?: Date;
/** The date and time when the processing job is set to expire. */
readonly expirationDateTime?: Date;
/** The date and time when the processing job was last updated. */
readonly lastUpdateDateTime?: Date;
/** Error object that describes the error when status is "Failed". */
error?: ErrorModel;
}

export function healthInsightsOperationStatusErrorDeserializer(
item: any,
): HealthInsightsOperationStatusError {
return {
id: item["id"],
status: item["status"],
createdDateTime: !item["createdDateTime"]
? item["createdDateTime"]
: new Date(item["createdDateTime"]),
expirationDateTime: !item["expirationDateTime"]
? item["expirationDateTime"]
: new Date(item["expirationDateTime"]),
lastUpdateDateTime: !item["lastUpdateDateTime"]
? item["lastUpdateDateTime"]
: new Date(item["lastUpdateDateTime"]),
error: !item["error"] ? item["error"] : item["error"],
};
}

/** The status of the processing job. */
export type JobStatus =
| "notStarted"
| "running"
| "succeeded"
| "failed"
| "canceled";

/** The inference results for the Radiology Insights request. */
export interface RadiologyInsightsInferenceResult {
/** Results for the patients given in the request. */
Expand Down Expand Up @@ -2246,46 +2201,6 @@ export function narrativeDeserializer(item: any): Narrative {
};
}

/** The response for the Radiology Insights request. */
export interface RadiologyInsightsResult {
/** The unique ID of the operation. */
readonly id: string;
/** The status of the operation */
readonly status: JobStatus;
/** The date and time when the processing job was created. */
readonly createdDateTime?: Date;
/** The date and time when the processing job is set to expire. */
readonly expirationDateTime?: Date;
/** The date and time when the processing job was last updated. */
readonly lastUpdateDateTime?: Date;
/** Error object that describes the error when status is "Failed". */
error?: ErrorModel;
/** The result of the operation. */
result?: RadiologyInsightsInferenceResult;
}

export function radiologyInsightsResultDeserializer(
item: any,
): RadiologyInsightsResult {
return {
id: item["id"],
status: item["status"],
createdDateTime: !item["createdDateTime"]
? item["createdDateTime"]
: new Date(item["createdDateTime"]),
expirationDateTime: !item["expirationDateTime"]
? item["expirationDateTime"]
: new Date(item["expirationDateTime"]),
lastUpdateDateTime: !item["lastUpdateDateTime"]
? item["lastUpdateDateTime"]
: new Date(item["lastUpdateDateTime"]),
error: !item["error"] ? item["error"] : item["error"],
result: !item["result"]
? item["result"]
: radiologyInsightsInferenceResultDeserializer(item["result"]),
};
}

/** Repeatability Result header options */
export type RepeatabilityResult = "accepted" | "rejected";

Expand Down
2 changes: 1 addition & 1 deletion packages/typespec-test/test/widget_dpg/spec/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ model ListWidgetsPagesResults {
@items
results: Widget[];
@doc("The URL to get the next set of results.")
@Azure.Core.nextLink
@TypeSpec.nextLink
`odata.nextLink`?: string;
}

Expand Down
Loading
Loading