Skip to content

[contoso] Move TSP for folder structure v2 #34679

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

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
20 changes: 0 additions & 20 deletions .github/workflows/typespec-validation-all.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: TypeSpec Validation - All

Check failure on line 1 in .github/workflows/typespec-validation-all.yaml

View workflow job for this annotation

GitHub Actions / Protected Files

File '.github/workflows/typespec-validation-all.yaml' should only be updated by the Azure SDK team. If intentional, the PR may be merged by the Azure SDK team via bypassing the branch protections.

on:
push:
Expand All @@ -7,26 +7,6 @@
- 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 * * *"
Expand Down
3 changes: 2 additions & 1 deletion eng/scripts/TypeSpec-Validation.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[CmdletBinding()]

Check failure on line 1 in eng/scripts/TypeSpec-Validation.ps1

View workflow job for this annotation

GitHub Actions / Protected Files

File 'eng/scripts/TypeSpec-Validation.ps1' should only be updated by the Azure SDK team. If intentional, the PR may be merged by the Azure SDK team via bypassing the branch protections.
param (
[switch]$CheckAll = $false,
[int]$Shard = 0,
Expand All @@ -20,7 +20,8 @@
$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
Expand Down
3 changes: 1 addition & 2 deletions eng/tools/typespec-validation/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { ParseArgsConfig, parseArgs } from "node:util";

Check failure on line 1 in eng/tools/typespec-validation/src/index.ts

View workflow job for this annotation

GitHub Actions / Protected Files

File 'eng/tools/typespec-validation/src/index.ts' should only be updated by the Azure SDK team. If intentional, the PR may be merged by the Azure SDK team via bypassing the branch protections.
import { stat } from "node:fs/promises";
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";
Expand Down Expand Up @@ -45,7 +44,7 @@
}

const rules = [
new FolderStructureRule(),
// new FolderStructureRule(),
new NpmPrefixRule(),
new EmitAutorestRule(),
new FlavorAzureRule(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@doc("Faked shared model")
model FakedSharedModel {
@doc("The tag.")
tag: string;

@doc("The created date.")
createdAt: utcDateTime;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading