Skip to content

Fix stale typespec-ts modular-unit snapshot after ARM doc changes (#4795)#4796

Merged
JialinHuang803 merged 2 commits into
mainfrom
xirzec-xirzec-fix-typespec-ts-stale-modular-sna
Jul 2, 2026
Merged

Fix stale typespec-ts modular-unit snapshot after ARM doc changes (#4795)#4796
JialinHuang803 merged 2 commits into
mainfrom
xirzec-xirzec-fix-typespec-ts-stale-modular-sna

Conversation

@xirzec

@xirzec xirzec commented Jul 1, 2026

Copy link
Copy Markdown
Member

Why

PR #4494 ("Improve documentation for ARM library decorators, interfaces, and models") added @doc("") to the ARM ArmResourceActionAsync operation template, so those operations no longer emit a public doc comment. Because #4494 did not touch packages/typespec-ts/**, ci-typescript.yml never ran on it, and the stale modular-unit scenario snapshot landed on main unnoticed. This made the typespec-ts / CI -> Run unit tests job red on main and on every typespec-ts PR (including #4788).

What changed

  • Updated the bodyOptionalParameterName.md modular-unit scenario to drop the now-empty ARM operation doc comment (/** A long-running resource action. */) and the corresponding sample summary text, matching what the current ARM library emits.
  • Added an internal chronus changeset for @azure-tools/typespec-ts.

Notes for reviewers

  • The drift was narrower than the issue implied. Only bodyOptionalParameterName.md actually failed: its backup op uses ArmResourceActionAsync (which got @doc("")). lroPaging.md still passes because its suspend op uses ArmResourceActionAsyncBase, which Improve documentation for ARM library decorators, interfaces, and models #4494 left with a public doc, so it correctly still emits A long-running resource action.
  • I did not commit the full SCENARIOS_UPDATE=true output. Write mode reformats every scenario through prettier and produced 46 changed files (+1039/-763), but 44 of those were pure formatting noise: the runner's assertion is whitespace-normalized (ignoreWeirdLine), so those never actually failed. I discarded the noise and hand-applied only the 3 genuine doc removals to keep the diff minimal and reviewable.

Verification

  • pnpm unit-test -> 657 passed
  • pnpm test-next -> 252 passed
  • pnpm chronus verify -> clean
  • prettier --check on changed files -> clean

Follow-up (out of scope)

ARM library (typespec-azure-resource-manager) changes can alter typespec-ts emitted output but do not trigger ci-typescript.yml, so this drift class can recur. Consider widening the workflow paths triggers to include the emitter's TypeSpec library dependencies. Tracked separately.

Fixes: #4795

)

#4494 added `@doc("")` to the ARM `ArmResourceActionAsync` operation template,
so those operations no longer emit a public doc comment. The checked-in
`bodyOptionalParameterName.md` modular-unit scenario still expected the old
`A long-running resource action.` doc text, making `pnpm unit-test` fail on
main and on every typespec-ts PR.

Update the scenario to drop the now-empty operation doc comment and the
corresponding sample summary text. Only this one scenario failed;
`lroPaging.md` uses `ArmResourceActionAsyncBase` (unchanged by #4494) and
still correctly emits the doc.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@xirzec xirzec marked this pull request as ready for review July 1, 2026 20:57
@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:typescript Issues for @azure-tools/typespec-ts emitter label Jul 1, 2026
@azure-sdk-automation

Copy link
Copy Markdown
Contributor

No changes needing a change description found.

@pkg-pr-new

pkg-pr-new Bot commented Jul 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@azure-tools/typespec-ts@4796

commit: 0ec531b

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

You can try these changes here

🛝 Playground 🌐 Website

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

⚡ Benchmark Results

⚠️ 27 metric(s) regressed above the +5% threshold:

Metric Baseline Current Change
total 🔴 774.0ms 🔴 968.2ms +25.1% 🔴
loader 🟡 224.1ms 🟡 288.6ms +28.8% 🔴
resolver 🟢 26.6ms 🟢 40.6ms +52.7% 🔴
checker 🟡 258.9ms 🟡 350.6ms +35.5% 🔴
validation 🟢 60.1ms 🟢 84.7ms +41.0% 🔴
 ↳ validation/@azure-tools/typespec-azure-core 🟢 8.7ms 🟡 11.8ms +35.9% 🔴
 ↳ validation/@typespec/http 🟢 9.3ms 🟡 14.6ms +58.2% 🔴
 ↳ validation/@typespec/versioning 🔴 38.2ms 🔴 52.6ms +37.6% 🔴
 ↳ validation/compiler 🟢 2.5ms 🟢 3.9ms +55.2% 🔴
linter 🟢 168.9ms 🟡 203.1ms +20.3% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/byos 🟢 6.9ms 🟢 8.1ms +17.8% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/no-header-explode 🔴 21.8ms 🔴 24.4ms +11.9% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/no-query-explode 🔴 23.0ms 🔴 25.4ms +10.4% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/no-response-body 🔴 27.3ms 🔴 31.3ms +14.6% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/response-schema-problem 🔴 26.0ms 🔴 31.1ms +19.9% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-agent-base-type-child-resources 🟡 10.1ms 🔴 20.6ms +104.0% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-common-types-version 🟢 7.1ms 🟡 11.3ms +59.7% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes 🟢 3.2ms 🟢 6.4ms +101.8% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-no-path-casing-conflicts 🟡 13.1ms 🟡 15.9ms +21.0% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-operation-response 🟢 6.4ms 🟢 8.7ms +35.5% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/lro-location-header 🟡 15.8ms 🟡 18.0ms +13.6% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-response-body 🔴 23.5ms 🔴 27.7ms +17.6% 🔴
 ↳ emit/@azure-tools/typespec-autorest 🟢 96.5ms 🟢 120.7ms +25.2% 🔴
 ↳ emit/@typespec/http-client-js 🔴 499.7ms 🔴 554.8ms +11.0% 🔴
 ↳ emit/@typespec/openapi3 🟢 86.0ms 🟢 103.3ms +20.1% 🔴
 ↳ emit/@typespec/openapi3/compute 🟢 74.8ms 🟢 89.5ms +19.7% 🔴
 ↳ emit/@typespec/openapi3/write 🟢 11.0ms 🟢 13.5ms +22.8% 🔴
Full details – comparing a6baa71 vs baseline rolling-baseline-29cf646-cd9c422 (rolling baseline (20 main runs))
Metric Baseline Current Change
total 🔴 774.0ms 🔴 968.2ms +25.1% 🔴
loader 🟡 224.1ms 🟡 288.6ms +28.8% 🔴
resolver 🟢 26.6ms 🟢 40.6ms +52.7% 🔴
checker 🟡 258.9ms 🟡 350.6ms +35.5% 🔴
validation 🟢 60.1ms 🟢 84.7ms +41.0% 🔴
 ↳ validation/@azure-tools/typespec-azure-core 🟢 8.7ms 🟡 11.8ms +35.9% 🔴
 ↳ validation/@typespec/http 🟢 9.3ms 🟡 14.6ms +58.2% 🔴
 ↳ validation/@typespec/rest 🟢 1.0ms 🟢 1.7ms +66.3%
 ↳ validation/@typespec/versioning 🔴 38.2ms 🔴 52.6ms +37.6% 🔴
 ↳ validation/compiler 🟢 2.5ms 🟢 3.9ms +55.2% 🔴
linter 🟢 168.9ms 🟡 203.1ms +20.3% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/auth-required 🟢 0.0ms 🟢 0.1ms +110.6%
 ↳ linter/@azure-tools/typespec-azure-core/bad-record-type 🟢 0.4ms 🟢 0.6ms +64.4%
 ↳ linter/@azure-tools/typespec-azure-core/byos 🟢 6.9ms 🟢 8.1ms +17.8% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/casing-style 🟢 0.9ms 🟢 1.4ms +55.6%
 ↳ linter/@azure-tools/typespec-azure-core/composition-over-inheritance 🟢 0.1ms 🟢 0.2ms +59.2%
 ↳ linter/@azure-tools/typespec-azure-core/documentation-required 🟢 1.3ms 🟢 1.9ms +52.6%
 ↳ linter/@azure-tools/typespec-azure-core/friendly-name 🟢 0.9ms 🟢 1.3ms +48.5%
 ↳ linter/@azure-tools/typespec-azure-core/key-visibility-required 🟢 0.2ms 🟢 0.4ms +47.7%
 ↳ linter/@azure-tools/typespec-azure-core/known-encoding 🟢 0.4ms 🟢 0.5ms +29.9%
 ↳ linter/@azure-tools/typespec-azure-core/long-running-polling-operation-required 🟢 0.5ms 🟢 0.8ms +63.0%
 ↳ linter/@azure-tools/typespec-azure-core/no-case-mismatch 🟢 0.4ms 🟢 0.7ms +67.1%
 ↳ linter/@azure-tools/typespec-azure-core/no-closed-literal-union 🟢 0.5ms 🟢 1.0ms +80.9%
 ↳ linter/@azure-tools/typespec-azure-core/no-enum 🟢 0.1ms 🟢 0.2ms +102.2%
 ↳ linter/@azure-tools/typespec-azure-core/no-error-status-codes 🟢 0.2ms 🟢 0.3ms +66.5%
 ↳ linter/@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops 🟢 0.1ms 🟢 0.2ms +32.7%
 ↳ linter/@azure-tools/typespec-azure-core/no-format 🟢 0.7ms 🟢 0.8ms +23.1%
 ↳ linter/@azure-tools/typespec-azure-core/no-generic-numeric 🟢 0.6ms 🟢 0.9ms +45.0%
 ↳ linter/@azure-tools/typespec-azure-core/no-header-explode 🔴 21.8ms 🔴 24.4ms +11.9% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/no-legacy-usage 🟢 1.4ms 🟢 1.9ms +32.9%
 ↳ linter/@azure-tools/typespec-azure-core/no-multiple-discriminator 🟢 0.1ms 🟢 0.2ms +58.6%
 ↳ linter/@azure-tools/typespec-azure-core/no-nullable 🟢 0.3ms 🟢 0.4ms +27.3%
 ↳ linter/@azure-tools/typespec-azure-core/no-offsetdatetime 🟢 1.5ms 🟢 1.9ms +28.5%
 ↳ linter/@azure-tools/typespec-azure-core/no-openapi 🟢 2.1ms 🟢 2.3ms +9.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-private-usage 🟢 2.4ms 🟢 3.0ms +27.6%
 ↳ linter/@azure-tools/typespec-azure-core/no-query-explode 🔴 23.0ms 🔴 25.4ms +10.4% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/no-response-body 🔴 27.3ms 🔴 31.3ms +14.6% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/no-rest-library-interfaces 🟢 0.1ms 🟢 0.1ms +102.0%
 ↳ linter/@azure-tools/typespec-azure-core/no-route-parameter-name-mismatch 🟢 6.0ms 🟢 7.0ms +16.3%
 ↳ linter/@azure-tools/typespec-azure-core/no-rpc-path-params 🟢 0.3ms 🟢 0.4ms +41.3%
 ↳ linter/@azure-tools/typespec-azure-core/no-string-discriminator 🟢 0.1ms 🟢 0.1ms +63.2%
 ↳ linter/@azure-tools/typespec-azure-core/no-unknown 🟢 0.3ms 🟢 0.3ms +30.6%
 ↳ linter/@azure-tools/typespec-azure-core/no-unnamed-union 🟢 0.5ms 🟢 0.8ms +47.9%
 ↳ linter/@azure-tools/typespec-azure-core/operation-missing-api-version 🟢 0.3ms 🟢 0.4ms +51.0%
 ↳ linter/@azure-tools/typespec-azure-core/request-body-problem 🟢 0.4ms 🟢 0.5ms +27.4%
 ↳ linter/@azure-tools/typespec-azure-core/require-versioned 🟢 0.0ms 🟢 0.1ms +112.3%
 ↳ linter/@azure-tools/typespec-azure-core/response-schema-problem 🔴 26.0ms 🔴 31.1ms +19.9% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/rpc-operation-request-body 🟢 0.5ms 🟢 0.7ms +45.2%
 ↳ linter/@azure-tools/typespec-azure-core/spread-discriminated-model 🟢 0.3ms 🟢 0.4ms +32.1%
 ↳ linter/@azure-tools/typespec-azure-core/use-standard-names 🟢 6.3ms 🟢 7.0ms +11.5%
 ↳ linter/@azure-tools/typespec-azure-core/use-standard-operations 🟢 0.2ms 🟢 0.3ms +45.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-agent-base-type-child-resources 🟡 10.1ms 🔴 20.6ms +104.0% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-agent-base-type-lifecycle-operations 🟢 0.1ms 🟢 0.3ms +165.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-common-types-version 🟢 7.1ms 🟡 11.3ms +59.7% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key 🟢 0.1ms 🟢 0.2ms +56.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage 🟢 0.1ms 🟢 0.1ms +43.4%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes 🟢 3.2ms 🟢 6.4ms +101.8% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-no-path-casing-conflicts 🟡 13.1ms 🟡 15.9ms +21.0% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-no-record 🟢 0.4ms 🟢 0.6ms +36.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-post-operation-response-codes 🟢 0.9ms 🟢 1.3ms +56.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes 🟢 0.1ms 🟢 0.2ms +135.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-action-no-segment 🟢 0.3ms 🟢 0.4ms +45.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property 🟢 0.2ms 🟢 0.4ms +67.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator 🟢 0.1ms 🟢 0.1ms +104.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-action-verb 🟢 0.1ms 🟢 0.2ms +46.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property 🟢 0.2ms 🟢 0.3ms +62.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-version-format 🟢 0.1ms 🟢 0.2ms +100.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-key-invalid-chars 🟢 0.3ms 🟢 0.4ms +38.4%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-name-pattern 🟢 0.1ms 🟢 0.1ms +134.4%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-operation 🟢 0.3ms 🟢 0.5ms +76.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-operation-response 🟢 6.4ms 🟢 8.7ms +35.5% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-patch 🟢 0.5ms 🟢 0.9ms +76.4%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-path-segment-invalid-chars 🟢 0.3ms 🟢 0.4ms +42.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state 🟢 0.2ms 🟢 0.4ms +80.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/beyond-nesting-levels 🟢 0.1ms 🟢 0.2ms +56.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/empty-updateable-properties 🟢 0.2ms 🟢 0.4ms +61.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/improper-subscription-list-operation 🟢 0.0ms 🟢 0.1ms +146.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/lro-location-header 🟡 15.8ms 🟡 18.0ms +13.6% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint 🟢 0.1ms 🟢 0.1ms +99.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers 🟢 0.6ms 🟢 1.0ms +81.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-empty-model 🟢 0.2ms 🟢 0.2ms +41.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-override-props 🟢 0.2ms 🟢 0.3ms +94.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation 🟢 0.3ms 🟢 0.4ms +51.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-response-body 🔴 23.5ms 🔴 27.7ms +17.6% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/patch-envelope 🟢 0.2ms 🟢 0.4ms +63.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/resource-name 🟢 0.3ms 🟢 0.4ms +67.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/secret-prop 🟢 4.6ms 🟢 5.5ms +18.4%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/unsupported-type 🟢 0.5ms 🟢 0.7ms +40.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/version-progression 🟢 0.1ms 🟢 0.3ms +128.1%
 ↳ linter/@azure-tools/typespec-client-generator-core/property-name-conflict 🟢 1.5ms 🟢 2.2ms +45.9%
 ↳ linter/@azure-tools/typespec-client-generator-core/require-client-suffix 🟢 0.7ms 🟢 1.6ms +116.3%
emit 🔴 5.63s 🔴 5.83s +3.5%
 ↳ emit/@Azure-Tools 🟢 0.0ms 🟢 0.0ms +0.0%
 ↳ emit/@azure-tools/typespec-autorest 🟢 96.5ms 🟢 120.7ms +25.2% 🔴
 ↳ emit/@azure-tools/typespec-python 🔴 2.14s 🔴 2.17s +1.4%
 ↳ emit/@typespec 🟢 0.0ms 🟢 0.0ms +0.0%
 ↳ emit/@typespec/http-client-js 🔴 499.7ms 🔴 554.8ms +11.0% 🔴
 ↳ emit/@typespec/openapi3 🟢 86.0ms 🟢 103.3ms +20.1% 🔴
 ↳ emit/@typespec/openapi3/compute 🟢 74.8ms 🟢 89.5ms +19.7% 🔴
 ↳ emit/@typespec/openapi3/write 🟢 11.0ms 🟢 13.5ms +22.8% 🔴

Averaged across 3 specs (azure-arm-resource-manager, azure-core-dataplane, azure-full).
Threshold: changes > ±5% are highlighted.
🟢 Fast · 🟡 Moderate (stages >200ms, rules >10ms) · 🔴 Slow (stages >400ms, rules >20ms)

@JialinHuang803 JialinHuang803 added this pull request to the merge queue Jul 2, 2026
Merged via the queue into main with commit f6e42f0 Jul 2, 2026
31 checks passed
@JialinHuang803 JialinHuang803 deleted the xirzec-xirzec-fix-typespec-ts-stale-modular-sna branch July 2, 2026 06:45
Copilot AI added a commit that referenced this pull request Jul 2, 2026
…4796

Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:typescript Issues for @azure-tools/typespec-ts emitter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: typespec-ts modular-unit snapshots stale after ARM doc changes in #4494 — CI red on main

2 participants