diff --git a/.github/workflows/typespec-validation-all.yaml b/.github/workflows/typespec-validation-all.yaml index 6d7d037980f3..261afb63b892 100644 --- a/.github/workflows/typespec-validation-all.yaml +++ b/.github/workflows/typespec-validation-all.yaml @@ -7,26 +7,6 @@ on: - RPSaaSMaster - typespec-next - pull_request: - branches: - - main - - RPSaaSMaster - - typespec-next - paths: - - .gitattributes - - .prettierrc.json - - package-lock.json - - package.json - - tsconfig.json - - eng/** - - '!eng/common/**' - - specification/suppressions.yaml - - specification/common-types/** - - # Workflow and workflow dependencies - - .github/workflows/typespec-validation-all.yaml - - .github/actions/setup-node-npm-ci/** - schedule: # Run 4x/day - cron: "0 0,6,12,18 * * *" diff --git a/eng/scripts/TypeSpec-Validation.ps1 b/eng/scripts/TypeSpec-Validation.ps1 index 0ea5255aa788..d82d82a22a01 100644 --- a/eng/scripts/TypeSpec-Validation.ps1 +++ b/eng/scripts/TypeSpec-Validation.ps1 @@ -20,7 +20,8 @@ if ($TotalShards -gt 0 -and $Shard -ge $TotalShards) { $typespecFolders, $checkedAll = &"$PSScriptRoot/Get-TypeSpec-Folders.ps1" ` -BaseCommitish:$BaseCommitish ` -HeadCommitish:$HeadCommitish ` - -CheckAll:$CheckAll + -CheckAll:$CheckAll ` + -IgnoreCoreFiles:$true if ($TotalShards -gt 1 -and $TotalShards -le $typespecFolders.Count) { $typespecFolders = shardArray $typespecFolders $Shard $TotalShards diff --git a/eng/tools/typespec-validation/src/index.ts b/eng/tools/typespec-validation/src/index.ts index b05d49175a73..0feebb39a37f 100755 --- a/eng/tools/typespec-validation/src/index.ts +++ b/eng/tools/typespec-validation/src/index.ts @@ -4,7 +4,6 @@ import { Suppression } from "suppressions"; import { CompileRule } from "./rules/compile.js"; import { EmitAutorestRule } from "./rules/emit-autorest.js"; import { FlavorAzureRule } from "./rules/flavor-azure.js"; -import { FolderStructureRule } from "./rules/folder-structure.js"; import { FormatRule } from "./rules/format.js"; import { LinterRulesetRule } from "./rules/linter-ruleset.js"; import { NpmPrefixRule } from "./rules/npm-prefix.js"; @@ -45,7 +44,7 @@ export async function main() { } const rules = [ - new FolderStructureRule(), + // new FolderStructureRule(), new NpmPrefixRule(), new EmitAutorestRule(), new FlavorAzureRule(), diff --git a/specification/contosowidgetmanager/Contoso.WidgetManager/client.tsp b/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/client.tsp similarity index 100% rename from specification/contosowidgetmanager/Contoso.WidgetManager/client.tsp rename to specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/client.tsp diff --git a/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_CreateOrUpdateWidgetSample.json b/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_CreateOrUpdateWidgetSample.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_CreateOrUpdateWidgetSample.json rename to specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_CreateOrUpdateWidgetSample.json diff --git a/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_DeleteWidgetSample.json b/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_DeleteWidgetSample.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_DeleteWidgetSample.json rename to specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_DeleteWidgetSample.json diff --git a/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetOperationStatusSample.json b/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetOperationStatusSample.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetOperationStatusSample.json rename to specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetOperationStatusSample.json diff --git a/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetSample.json b/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetSample.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetSample.json rename to specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetSample.json diff --git a/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_ListWidgetsSample.json b/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_ListWidgetsSample.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_ListWidgetsSample.json rename to specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_ListWidgetsSample.json diff --git a/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-12-01/Widgets_CreateOrUpdateWidgetSample.json b/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-12-01/Widgets_CreateOrUpdateWidgetSample.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-12-01/Widgets_CreateOrUpdateWidgetSample.json rename to specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-12-01/Widgets_CreateOrUpdateWidgetSample.json diff --git a/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-12-01/Widgets_DeleteWidgetSample.json b/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-12-01/Widgets_DeleteWidgetSample.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-12-01/Widgets_DeleteWidgetSample.json rename to specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-12-01/Widgets_DeleteWidgetSample.json diff --git a/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-12-01/Widgets_GetWidgetOperationStatusSample.json b/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-12-01/Widgets_GetWidgetOperationStatusSample.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-12-01/Widgets_GetWidgetOperationStatusSample.json rename to specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-12-01/Widgets_GetWidgetOperationStatusSample.json diff --git a/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-12-01/Widgets_GetWidgetSample.json b/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-12-01/Widgets_GetWidgetSample.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-12-01/Widgets_GetWidgetSample.json rename to specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-12-01/Widgets_GetWidgetSample.json diff --git a/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-12-01/Widgets_ListWidgetsSample.json b/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-12-01/Widgets_ListWidgetsSample.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-12-01/Widgets_ListWidgetsSample.json rename to specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/examples/2022-12-01/Widgets_ListWidgetsSample.json diff --git a/specification/contosowidgetmanager/Contoso.WidgetManager/main.tsp b/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/main.tsp similarity index 97% rename from specification/contosowidgetmanager/Contoso.WidgetManager/main.tsp rename to specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/main.tsp index 3caf321e31e4..e1c5e078f148 100644 --- a/specification/contosowidgetmanager/Contoso.WidgetManager/main.tsp +++ b/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/main.tsp @@ -2,7 +2,7 @@ import "@typespec/http"; import "@typespec/rest"; import "@typespec/versioning"; import "@azure-tools/typespec-azure-core"; -import "../Contoso.WidgetManager.Shared"; +import "./shared.tsp"; using TypeSpec.Http; using TypeSpec.Rest; diff --git a/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/main.tsp b/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/shared.tsp similarity index 100% rename from specification/contosowidgetmanager/Contoso.WidgetManager.Shared/main.tsp rename to specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/shared.tsp diff --git a/specification/contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml b/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/tspconfig.yaml similarity index 97% rename from specification/contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml rename to specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/tspconfig.yaml index 9a29a6fc3971..b2a488dcb2b2 100644 --- a/specification/contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml +++ b/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/tspconfig.yaml @@ -12,7 +12,7 @@ options: "@azure-tools/typespec-autorest": azure-resource-provider-folder: "data-plane" emit-lro-options: "none" - emitter-output-dir: "{project-root}/.." + emitter-output-dir: "{project-root}/../.." output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/widgets.json" "@azure-tools/typespec-python": package-dir: "azure-contoso-widgetmanager" diff --git a/specification/contosowidgetmanager/Contoso.Management/employee.tsp b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/employee.tsp similarity index 100% rename from specification/contosowidgetmanager/Contoso.Management/employee.tsp rename to specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/employee.tsp diff --git a/specification/contosowidgetmanager/Contoso.Management/examples/2021-10-01-preview/Employees_CreateOrUpdate.json b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-10-01-preview/Employees_CreateOrUpdate.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.Management/examples/2021-10-01-preview/Employees_CreateOrUpdate.json rename to specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-10-01-preview/Employees_CreateOrUpdate.json diff --git a/specification/contosowidgetmanager/Contoso.Management/examples/2021-10-01-preview/Employees_Delete.json b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-10-01-preview/Employees_Delete.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.Management/examples/2021-10-01-preview/Employees_Delete.json rename to specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-10-01-preview/Employees_Delete.json diff --git a/specification/contosowidgetmanager/Contoso.Management/examples/2021-10-01-preview/Employees_Get.json b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-10-01-preview/Employees_Get.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.Management/examples/2021-10-01-preview/Employees_Get.json rename to specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-10-01-preview/Employees_Get.json diff --git a/specification/contosowidgetmanager/Contoso.Management/examples/2021-10-01-preview/Employees_ListByResourceGroup.json b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-10-01-preview/Employees_ListByResourceGroup.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.Management/examples/2021-10-01-preview/Employees_ListByResourceGroup.json rename to specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-10-01-preview/Employees_ListByResourceGroup.json diff --git a/specification/contosowidgetmanager/Contoso.Management/examples/2021-10-01-preview/Employees_ListBySubscription.json b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-10-01-preview/Employees_ListBySubscription.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.Management/examples/2021-10-01-preview/Employees_ListBySubscription.json rename to specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-10-01-preview/Employees_ListBySubscription.json diff --git a/specification/contosowidgetmanager/Contoso.Management/examples/2021-10-01-preview/Employees_Update.json b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-10-01-preview/Employees_Update.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.Management/examples/2021-10-01-preview/Employees_Update.json rename to specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-10-01-preview/Employees_Update.json diff --git a/specification/contosowidgetmanager/Contoso.Management/examples/2021-10-01-preview/Operations_List.json b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-10-01-preview/Operations_List.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.Management/examples/2021-10-01-preview/Operations_List.json rename to specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-10-01-preview/Operations_List.json diff --git a/specification/contosowidgetmanager/Contoso.Management/examples/2021-11-01/Employees_CreateOrUpdate.json b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-11-01/Employees_CreateOrUpdate.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.Management/examples/2021-11-01/Employees_CreateOrUpdate.json rename to specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-11-01/Employees_CreateOrUpdate.json diff --git a/specification/contosowidgetmanager/Contoso.Management/examples/2021-11-01/Employees_Delete.json b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-11-01/Employees_Delete.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.Management/examples/2021-11-01/Employees_Delete.json rename to specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-11-01/Employees_Delete.json diff --git a/specification/contosowidgetmanager/Contoso.Management/examples/2021-11-01/Employees_Get.json b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-11-01/Employees_Get.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.Management/examples/2021-11-01/Employees_Get.json rename to specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-11-01/Employees_Get.json diff --git a/specification/contosowidgetmanager/Contoso.Management/examples/2021-11-01/Employees_ListByResourceGroup.json b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-11-01/Employees_ListByResourceGroup.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.Management/examples/2021-11-01/Employees_ListByResourceGroup.json rename to specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-11-01/Employees_ListByResourceGroup.json diff --git a/specification/contosowidgetmanager/Contoso.Management/examples/2021-11-01/Employees_ListBySubscription.json b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-11-01/Employees_ListBySubscription.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.Management/examples/2021-11-01/Employees_ListBySubscription.json rename to specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-11-01/Employees_ListBySubscription.json diff --git a/specification/contosowidgetmanager/Contoso.Management/examples/2021-11-01/Employees_Update.json b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-11-01/Employees_Update.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.Management/examples/2021-11-01/Employees_Update.json rename to specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-11-01/Employees_Update.json diff --git a/specification/contosowidgetmanager/Contoso.Management/examples/2021-11-01/Operations_List.json b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-11-01/Operations_List.json similarity index 100% rename from specification/contosowidgetmanager/Contoso.Management/examples/2021-11-01/Operations_List.json rename to specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/examples/2021-11-01/Operations_List.json diff --git a/specification/contosowidgetmanager/Contoso.Management/main.tsp b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/main.tsp similarity index 100% rename from specification/contosowidgetmanager/Contoso.Management/main.tsp rename to specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/main.tsp diff --git a/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/shared.tsp b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/shared.tsp new file mode 100644 index 000000000000..1b94bb705031 --- /dev/null +++ b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/shared.tsp @@ -0,0 +1,8 @@ +@doc("Faked shared model") +model FakedSharedModel { + @doc("The tag.") + tag: string; + + @doc("The created date.") + createdAt: utcDateTime; +} diff --git a/specification/contosowidgetmanager/Contoso.Management/tspconfig.yaml b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/tspconfig.yaml similarity index 92% rename from specification/contosowidgetmanager/Contoso.Management/tspconfig.yaml rename to specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/tspconfig.yaml index c3dae4d70301..f20debf41298 100644 --- a/specification/contosowidgetmanager/Contoso.Management/tspconfig.yaml +++ b/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/tspconfig.yaml @@ -6,9 +6,10 @@ emit: options: "@azure-tools/typespec-autorest": use-read-only-status-schema: true - emitter-output-dir: "{project-root}/.." + emitter-output-dir: "{project-root}/../.." azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/contoso.json" + arm-types-dir: "{project-root}/../../../common-types/resource-management" "@azure-tools/typespec-csharp": flavor: azure package-dir: "Azure.ResourceManager.Contoso"