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

Update for PATCH change #29617

Draft
wants to merge 6 commits into
base: typespec-next
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/_reusable-eng-tools-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}.x

- run: npm ci
- run: npm install --no-package-lock
shell: pwsh

- run: npm ls -a
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/templates/steps/npm-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ steps:
- script: npm --version --loglevel info
displayName: npm --version

- script: npm ci
displayName: npm ci
- script: npm install --no-package-lock --force
displayName: npm install --no-package-lock

- script: npm ls -a
displayName: npm ls -a
Expand Down
3 changes: 3 additions & 0 deletions eng/pipelines/typespec-validation-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
vmImage: $(OSVmImage)

steps:
- script: git -c user.name="azure-sdk" -c user.email="[email protected]" merge -Xours origin/main
displayName: git merge origin/main

- template: /eng/pipelines/templates/steps/npm-install.yml

- pwsh: |
Expand Down
5 changes: 4 additions & 1 deletion eng/pipelines/typespec-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ jobs:
vmImage: ubuntu-22.04

steps:
- script: git -c user.name="azure-sdk" -c user.email="[email protected]" merge -Xours origin/main
displayName: git merge origin/main

- template: /eng/pipelines/templates/steps/npm-install.yml

- pwsh: |
$(Build.SourcesDirectory)/eng/scripts/TypeSpec-Validation.ps1 -GitClean -Verbose
$(Build.SourcesDirectory)/eng/scripts/TypeSpec-Validation.ps1 -GitClean -BaseCommitish HEAD~2 -Verbose
displayName: Validate Impacted Specs
ignoreLASTEXITCODE: true
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
{
"name": "azure-rest-api-specs",
"devDependencies": {
"@azure-tools/typespec-apiview": "0.4.8",
"@azure-tools/typespec-autorest": "0.43.0",
"@azure-tools/typespec-azure-core": "0.43.0",
"@azure-tools/typespec-azure-portal-core": "0.43.0",
"@azure-tools/typespec-azure-resource-manager": "0.43.0",
"@azure-tools/typespec-client-generator-core": "0.43.0",
"@azure-tools/typespec-azure-rulesets": "0.43.0",
"@azure-tools/typespec-autorest": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvMzkxNjYyMC9hcnRpZmFjdE5hbWUvcGFja2FnZXM1/content?format=file&subPath=%2Fazure-tools-typespec-autorest-0.44.0-pr-1081.20240627.11.tgz",
"@azure-tools/typespec-azure-core": "next",
"@azure-tools/typespec-azure-portal-core": "next",
"@azure-tools/typespec-azure-resource-manager": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvMzkxNjYyMC9hcnRpZmFjdE5hbWUvcGFja2FnZXM1/content?format=file&subPath=%2Fazure-tools-typespec-azure-resource-manager-0.44.0-pr-1081.20240627.11.tgz",
"@azure-tools/typespec-client-generator-core": "next",
"@azure-tools/typespec-azure-rulesets": "next",
"@azure/avocado": "^0.8.4",
"@typespec/compiler": "0.57.0",
"@typespec/http": "0.57.0",
"@typespec/openapi": "0.57.0",
"@typespec/openapi3": "0.57.0",
"@typespec/rest": "0.57.0",
"@typespec/versioning": "0.57.0",
"@typespec/compiler": "next",
"@typespec/http": "next",
"@typespec/openapi": "next",
"@typespec/openapi3": "next",
"@typespec/rest": "next",
"@typespec/versioning": "next",
"azure-rest-api-specs-eng-tools": "file:eng/tools",
"oav": "^3.3.7",
"prettier": "~3.2.5",
Expand Down
8 changes: 7 additions & 1 deletion specification/apicenter/ApiCenter.Management/Service.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ interface Services {
@doc("Creates new or updates existing API.")
createOrUpdate is Azure.ResourceManager.ArmResourceCreateOrReplaceSync<Service>;
@doc("Updates existing service.")
update is ArmResourcePatchSync<Service, ServiceProperties>;
update is ArmCustomPatchSync<
Service,
Azure.ResourceManager.Foundations.ResourceUpdateModel<
Service,
ServiceProperties
>
>;
@doc("Deletes specified service.")
delete is ArmResourceDeleteSync<Service>;
@doc("Returns a collection of services within the resource group.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ options:
"@azure-tools/typespec-autorest":
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "reference-only"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/apicenter.json"
examples-directory: "{project-root}/examples"
use-read-only-status-schema: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ options:
use-read-only-status-schema: true
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "reference-only"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/appcomplianceautomation.json"
examples-directory: "{project-root}/examples"
"@azure-tools/typespec-ts":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ options:
use-read-only-status-schema: true
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "reference-only"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/azurefleet.json"
examples-directory: "examples"
"@azure-tools/typespec-csharp":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ options:
"@azure-tools/typespec-autorest":
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "reference-only"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/azurelargeinstance.json"
examples-directory: "{project-root}/examples"
use-read-only-status-schema: true
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ options:
use-read-only-status-schema: true
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "reference-only"
output-file: "{azure-resource-provider-folder}/{service-name}/StackHCIVM/{version-status}/{version}/stackhcivm.json"
examples-directory: "{project-root}/examples"
linter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ options:
use-read-only-status-schema: true
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "reference-only"
output-file: "{azure-resource-provider-folder}/{service-name}/operations/{version-status}/{version}/operations.json"
examples-directory: "{project-root}/examples"
linter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ options:
use-read-only-status-schema: true
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "reference-only"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/codeSigningAccount.json"
examples-directory: "{project-root}/examples"
linter:
Expand Down
7 changes: 5 additions & 2 deletions specification/communitytraining/Community.Management/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,12 @@ interface CommunityTrainings {
CommunityTraining,
LroHeaders = Azure.Core.Foundations.RetryAfterHeader
>;
update is ArmResourcePatchAsync<
update is ArmCustomPatchAsync<
CommunityTraining,
CommunityTrainingProperties
Azure.ResourceManager.Foundations.ResourceUpdateModel<
CommunityTraining,
CommunityTrainingProperties
>
>;
delete is ArmResourceDeleteAsync<CommunityTraining>;
listByResourceGroup is ArmResourceListByParent<CommunityTraining>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ options:
"@azure-tools/typespec-autorest":
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "reference-only"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/CommunityTrainings.json"
examples-directory: "{project-root}/examples"
linter:
Expand Down
14 changes: 10 additions & 4 deletions specification/containerservice/Fleet.Management/fleetmember.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,12 @@ interface FleetMembers {
@sharedRoute
@added(Versions.v2023_03_15_preview)
@removed(Versions.v2023_06_15_preview)
update is ArmResourcePatchSync<
update is ArmCustomPatchSync<
FleetMember,
FleetMemberProperties,
Azure.ResourceManager.Foundations.ResourceUpdateModel<
FleetMember,
FleetMemberProperties
>,
Azure.ResourceManager.Foundations.BaseParameters<FleetMember> &
IfMatchParameters<FleetMember>
>;
Expand All @@ -107,9 +110,12 @@ interface FleetMembers {
`final-state-via`: "original-uri",
}
)
updateAsync is ArmResourcePatchAsync<
updateAsync is ArmCustomPatchAsync<
FleetMember,
FleetMemberProperties,
Azure.ResourceManager.Foundations.ResourceUpdateModel<
FleetMember,
FleetMemberProperties
>,
Azure.ResourceManager.Foundations.BaseParameters<FleetMember> &
IfMatchParameters<FleetMember>
>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ linter:
options:
"@azure-tools/typespec-autorest":
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "reference-only"
emitter-output-dir: "{project-root}/.."
arm-types-dir: "{project-root}/../../common-types/resource-management"
examples-directory: "{project-root}/examples"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ interface Pools {
LroHeaders = Azure.Core.Foundations.RetryAfterHeader
>;
delete is ArmResourceDeleteWithoutOkAsync<Pool>;
update is ArmResourcePatchAsync<Pool, PoolProperties>;
update is ArmCustomPatchAsync<
Pool,
Azure.ResourceManager.Foundations.ResourceUpdateModel<Pool, PoolProperties>
>;
listByResourceGroup is ArmResourceListByParent<Pool>;
listBySubscription is ArmListBySubscription<Pool>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ linter:
options:
"@azure-tools/typespec-autorest":
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "reference-only"
emitter-output-dir: "{project-root}/.."
examples-directory: "{project-root}/examples"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/containerstorage.json"
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ interface Volumes {
LroHeaders = Azure.Core.Foundations.RetryAfterHeader
>;
delete is ArmResourceDeleteWithoutOkAsync<Volume>;
update is ArmResourcePatchAsync<Volume, VolumeProperties>;
update is ArmCustomPatchAsync<
Volume,
Azure.ResourceManager.Foundations.ResourceUpdateModel<
Volume,
VolumeProperties
>
>;
listByPool is ArmResourceListByParent<Volume>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ options:
"@azure-tools/typespec-autorest":
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "reference-only"
examples-directory: "{project-root}/examples"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/Watcher.json"
use-read-only-status-schema: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,13 @@ interface Watchers {
Watcher,
LroHeaders = Azure.Core.Foundations.RetryAfterHeader
>;
update is ArmResourcePatchAsync<Watcher, WatcherProperties>;
update is ArmCustomPatchAsync<
Watcher,
Azure.ResourceManager.Foundations.ResourceUpdateModel<
Watcher,
WatcherProperties
>
>;
delete is ArmResourceDeleteWithoutOkAsync<Watcher>;
listByResourceGroup is ArmResourceListByParent<Watcher>;
listBySubscription is ArmListBySubscription<Watcher>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,12 @@ interface AssetEndpointProfiles {
LroHeaders = Azure.Core.Foundations.RetryAfterHeader
>;

update is ArmResourcePatchAsync<
update is ArmCustomPatchAsync<
AssetEndpointProfile,
AssetEndpointProfileProperties
Azure.ResourceManager.Foundations.ResourceUpdateModel<
AssetEndpointProfile,
AssetEndpointProfileProperties
>
>;

delete is ArmResourceDeleteWithoutOkAsync<AssetEndpointProfile>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,13 @@ interface Assets {
LroHeaders = Azure.Core.Foundations.RetryAfterHeader
>;

update is ArmResourcePatchAsync<Asset, AssetProperties>;
update is ArmCustomPatchAsync<
Asset,
Azure.ResourceManager.Foundations.ResourceUpdateModel<
Asset,
AssetProperties
>
>;

delete is ArmResourceDeleteWithoutOkAsync<Asset>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ options:
"@azure-tools/typespec-autorest":
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "reference-only"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/deviceregistry.json"
examples-directory: "{project-root}/examples"
use-read-only-status-schema: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,10 @@ interface Pools {
Pool,
LroHeaders = Azure.Core.Foundations.RetryAfterHeader
>;
update is ArmResourcePatchAsync<Pool, PoolProperties>;
update is ArmCustomPatchAsync<
Pool,
Azure.ResourceManager.Foundations.ResourceUpdateModel<Pool, PoolProperties>
>;
delete is ArmResourceDeleteWithoutOkAsync<Pool>;
listByResourceGroup is ArmResourceListByParent<Pool>;
listBySubscription is ArmListBySubscription<Pool>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ options:
"@azure-tools/typespec-autorest":
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "reference-only"
examples-directory: "{project-root}/examples"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/devopsinfrastructure.json"
omit-unreachable-types: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ linter:
options:
"@azure-tools/typespec-autorest":
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "reference-only"
use-read-only-status-schema: true
emitter-output-dir: "{project-root}/.."
examples-directory: "examples"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ model FabricCapacity is TrackedResource<FabricCapacityProperties> {
interface FabricCapacities {
get is ArmResourceRead<FabricCapacity>;
createOrUpdate is ArmResourceCreateOrReplaceAsync<FabricCapacity>;
update is ArmResourcePatchSync<FabricCapacity, FabricCapacityProperties>;
update is ArmCustomPatchSync<
FabricCapacity,
Azure.ResourceManager.Foundations.ResourceUpdateModel<
FabricCapacity,
FabricCapacityProperties
>
>;
delete is ArmResourceDeleteSync<FabricCapacity>;
listByResourceGroup is ArmResourceListByParent<FabricCapacity>;
listBySubscription is ArmListBySubscription<FabricCapacity>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ options:
use-read-only-status-schema: true
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "reference-only"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/fabric.json"
examples-directory: "{project-root}/examples"
linter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ options:
"@azure-tools/typespec-autorest":
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "reference-only"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json"
examples-directory: "{project-root}/examples"
"@azure-tools/typespec-python":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ options:
"@azure-tools/typespec-autorest":
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "reference-only"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json"
examples-directory: "{project-root}/examples"
omit-unreachable-types: true
Expand Down
Loading