Skip to content

[Swagger Linter Migration] RepeatedPathInfo -> no-repeated-path-info - #5526

Open
Yuchao Yan (msyyc) wants to merge 20 commits into
mainfrom
promote-lintdiff-repeated-path-info
Open

Yuchao Yan (msyyc) wants to merge 20 commits into
mainfrom
promote-lintdiff-repeated-path-info

Conversation

@msyyc

@msyyc Yuchao Yan (msyyc) commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Current result: JSON-name matching (October 22, 2026)

Published in 7592f2a for the helper suggestion in #5526 (comment) (5526-M05). The trial supports adopting the suggestion: the rule now uses the shared walkJsonProperties helper and compares compiler-resolved JSON names with HTTP path/query names. This deliberately corrects the former authored-name exception rather than preserving its false positives/negatives.

This current contract and evidence supersede conflicting statements in the historical sections below. The earlier documentation cleanup for 5526-M01 through M04 is preserved.

Guideline, scope and authoring behavior

Promote Swagger RepeatedPathInfo / ARM guideline RPC-Put-V1-05 as @azure-tools/typespec-azure-resource-manager/no-repeated-path-info.

  • Inspect concrete PUT operations with a single model body and a model-valued authored properties bag. Do not inspect PATCH, top-level envelope duplicates or recursively nested members.
  • Compare each inherited member's JSON name with supported HTTP path/query wire names. JSON name overrides can introduce or remove a violation; overrides for other media types do not change JSON matching.
  • Match, deduplicate and format messages using the JSON name, but target the original authored property declaration. Deduplication stays local to each operation: a declaration shared by two PUTs still gets two diagnostics.
  • Preserve template-source exclusions and concrete inherited-operation handling. No provider guard, visibility filtering, emitter dependency or TCGC dependency is introduced.
  • Keep the separate envelope-duplication rule, public identifiers, suppression behavior and ruleset registration unchanged. This new rule remains disabled by default in the Azure resource-manager ruleset.
Supported alias against URI widgetName Previous native result Current native result Swagger result
@encodedName("application/json", "widgetName") otherName?: string No warning Warning on otherName, message names widgetName Violation
@encodedName("application/json", "otherName") widgetName?: string Warning No warning No violation

Source-first repair and shared prerequisite

The original reviewed source pin 08ea9770a0209d7a131c467ec0fd93f3918b1714 and merged inherited-operation repair aa845596546f09d4e76959684bb64cca90528039 remain immutable.

The active JSON-name source repair is #5805, targeting feature/lintdiff-migration-new from current development head 2d8c19e127dc4065f9aee8475ec659504284b295. Exact source pin: msyyc@8dcb693.

The source uses compiler resolveEncodedName directly, avoiding an ARM implementation dependency. It passed a fresh independent development review before this promotion was changed; the reviewer independently reran all 19 native/comparison tests and found no significant issues. The published diff matches reviewed SHA-256 73de9e8139d80b418161a91d81e18407a4da8d15a61f584681fb993a2847abe4. This is local development-review evidence, not GitHub approval. Neither PR is automatically merged.

The promotion reuses the existing ARM model-utils.ts, its canonical helper test and the compiler-only tester exactly as on upstream main 726862b537be9fdb24d7e6a4ca868eb9104025dd. These are the minimal shared-file prerequisites; no unrelated main-branch changes or new dependency are included. No library imports/usings are injected into CompilerTester.

Measured coverage impact

  • All 19 original canonical rule cases remain; only the two intentionally incorrect alias expectations are reversed.
  • Five added cases cover inherited JSON aliases and effective overrides, query wire names, non-JSON media controls, and encoded shared declarations with exact per-operation targets. Canonical rule coverage is now 24 cases.
  • The canonical helper test and public-entry-point import-isolation test also pass: 26/26 focused promotion tests across three files, no skips.
  • The source passes 17/17 native tests plus 2/2 independent AutoRest/Swagger comparisons. All eight existing migration fixtures pass without snapshot changes: five partial-classification covered violations, three reviewed-ambient compliance controls, zero unresolved gaps.
  • The fixture worker and actual built promotion both confirm alias counts 1/0. No existing acceptance case or import guard was deleted.

These results show no regression in the measured native/fixture coverage and close both tested alias discrepancies. They are not a new full-service-corpus run or proof of universal Swagger equivalence. Native operation populations, properties-bag selection and diagnostic units still differ from an emitted selected-version schema; source coverage classification remains conservatively partial.

Fresh local validation

Promotion compiler pin: 054fdc2a3f40dd247837ff6762ae66282964c59a.

  • mise exec -- pnpm --filter @azure-tools/typespec-azure-resource-manager exec vitest run test\rules\no-repeated-path-info.test.ts test\rules\model-utils.test.ts test\package-isolation.test.ts --reporter=dot: 26 passed.
  • mise exec -- pnpm --filter @azure-tools/typespec-azure-resource-manager build: production TypeScript, generated extern signatures and library lint passed.
  • Root mise exec -- pnpm format and mise exec -- pnpm lint, strict changed-test TypeScript checks, focused documentation/changeset formatting and diff hygiene passed.
  • All three actual final documentation excerpts were compiled once in explicit public ARM context using the rebuilt promotion: one expected warning for incorrect, zero diagnostics for correct, zero for suppression. Document SHA-256: 07186db31f053e54de3c389fe6a3ffd1d637bc7d822067fad8a911ba0d4ee25b. Additional built-library alias probes return 1/0. This is one-time evidence, not continuous documentation coverage.

Source compiler pin: a6137cac43a727ce0c2656364fd72d50c272ee4a. Source production build, strict changed-test types, scoped normal/type-aware lint and intended-file formatting passed. The eight-fixture run used the clean shared validator checkout 6243cb01c16c7535cd3b8df6f45fbeb3c095ed7f; historical corpus/source tuples below were not rerun. Source root generated-artifact formatting and unrelated baseline lint warnings retain the documented scoped-validation exception.

No new full-repository test/corpus run or broad CI success is claimed. Final-head CI and GitHub merge requirements remain separate from this completed local validation.

Historical migration and validation notes (superseded where they conflict with the current contract above)

Documentation review cleanup (October 22, 2026)

Published 0f3139e for selected findings 5526-M01 through 5526-M04. Removed the added comparison paragraph from the existing envelope-rule documentation and the reviewed implementation, diagnostic-count and encoded-name paragraphs from the new rule documentation. Examples, the concise migration caveat, production code, tests, registration and default enablement are unchanged. The earlier statement that these documentation-removal requests remain outstanding is superseded; the helper suggestion (5526-M05) remains intentionally untouched for the author.

Local validation: root pnpm format and pnpm lint, focused Prettier checks, unchanged TypeSpec code-block comparison and diff hygiene passed. All three actual final excerpts were compiled once in explicit public ARM context against the unchanged exact-head rule and compiler pin 054fdc2a3f40dd247837ff6762ae66282964c59a: incorrect example one expected warning, correct and suppression examples zero diagnostics. Document SHA-256: 72880bfe370e16ac981db0ecc621c54eb0c2bf3246f2020b25f5f52f911aa681. This is a one-time receipt, not continuous documentation coverage or a whole-PR approval. No new full-suite or corpus run is claimed.

Concrete inherited-PUT regression (F01)

Published in 6ddd909 after the source-first repair and clean independent development review recorded below. The former template-instance guard silently skipped real PUT endpoints inherited into concrete interfaces. The canonical public positive/negative pair now checks that boundary and the repeated property's exact authored span. Genuine template exclusions, authored-name semantics, per-operation deduplication, registration and default enablement are preserved. The existing ARM feature changeset now explicitly includes concrete inherited operations; no redundant release note was added.

Fresh promotion validation at compiler 054fdc2a3f40dd247837ff6762ae66282964c59a: canonical rule 19/19 plus package-isolation 1/1 (20 total), production build, strict changed-test TypeScript check, root format, root lint and diff hygiene all passed. Fresh source validation at its separate compiler pin passed native 12/12 and emission 2/2, including a before-fix failure (expected one warning, found zero). The old source pin and earlier validation claims below remain historical; this is not a new full-corpus run or a broad CI/merge-readiness claim.

Scoped review cleanup (October 21, 2026)

Published selected review fixes in b6ebb8d. The URI/envelope key-name boundary cases now use only no-repeated-path-info through the standard rule tester, retaining exact widgetName and identity targets without executing or asserting the independent envelope rule. The helper-based positive/negative pair is retained; its positive now carries the direct authored-property span assertion, replacing the duplicate literal pair. Production code, public APIs, registration and default enablement are unchanged.

The documentation uses contextual before/after excerpts, preserving @key("widgetName") and the ArmResourceCreateOrReplaceSync<Widget> reference without repeated provider/operation setup. All three actual final excerpts (incorrect, correct, suppression) were compiled once in explicit public ARM context at compiler pin 054fdc2a3f40dd247837ff6762ae66282964c59a: one exact-target own-rule warning, zero diagnostics, and zero diagnostics respectively. Document SHA-256: b816c9fc8b0eb6d4638c809d8f36e23d628421a55747a212863ab88549e6d49a. This one-time receipt is not continuous documentation coverage; no Markdown parser or documentation-testing system was added.

Fresh validation at the recorded compiler pin: dependency-closure build, production TypeScript check, canonical rule 17 tests plus package-isolation 1 test, root pnpm format, root pnpm lint, intended-file formatting and diff hygiene passed. Documentation regeneration completed with existing missing-documentation warnings. The full test TypeScript project has 26 diagnostics before and after, with an unchanged diagnostic multiset and zero diagnostics in the changed suite; it is not error-free. The initial non-pinned test/build run is not used as final evidence. No full-repository test rerun or passing CI claim is made.

These statements supersede the older dual-rule/two-diagnostics and standalone-example coverage claims below. Newer independent human documentation-removal and helper suggestions remain outstanding outside selected report IDs15–17; this selected cleanup does not establish whole-PR readiness. Earlier validation counts and broad-validation limitations remain historical.

Test-responsibility cleanup

Applied the guidance merged in #5572 from the #5507 review. Removed the HTTP-diagnostic-only assertion and redundant nested-namespace case. The path/query collision prerequisite is recorded in the mapping below rather than re-tested as a rule predicate. Retained inherited-property targeting, per-PUT multiplicity, imported project targets, non-recursion, and custom template exclusions. No production code changed.

Current cleanup validation: mise exec -- pnpm --filter @azure-tools/typespec-azure-resource-manager exec vitest run test\rules\no-repeated-path-info.test.ts passed 19 tests in an isolated run with unchanged default timeouts. An earlier concurrent run hit a 10-second setup-hook timeout; its cause is not established. Repository pnpm format, pnpm lint, and git diff --check passed. Earlier validation counts and broad-validation limitations below remain historical; the full test suite was not rerun.

Original Swagger linter

The original ARM guideline is RPC-Put-V1-05:

  • Select PUT operations, not PATCH or other verbs.
  • Combine path-item and operation parameters and collect path/query parameter names.
  • Find the body parameter and resolve its schema and nested resource properties schema.
  • Report nested properties whose names repeat path/query information.
  • Exclude top-level envelope duplicates and deeper nested members from this check.

How the Swagger linter works

The Spectral function traverses resolved OpenAPI path items, selects PUT, then compares serialized keys of the resource properties bag against the combined URI parameter names. It reports at the matching PUT parameter entry. That serialized-schema diagnostic location is not copied into a native declaration-based rule. Historical representative snapshots and emitted occurrences do not establish equal diagnostic counts. JSON name overrides can introduce or remove a Swagger match independently of the authored TypeSpec member name; this intentional boundary is covered by native tests rather than emitter reconstruction.

Source TypeSpec lintdiff rule

The concrete inherited-operation defect was repaired and independently reviewed in development before refreshing this promotion. Review found no significant issues in tree 0ac45147f27cf61f439bcd3778eafb6e4b7d08f3; the published source commit has that identical tree. The reviewer independently reran all fourteen source native/emission tests. This is local development-review evidence, not GitHub approval. Neither source nor promotion PR is automatically merged, and no blanket development-branch cherry-pick is included.

Source production/changed-test types and scoped normal/type-aware lint and formatting passed. Root source lint retains 228 warnings in unchanged files, zero in the changed source/test; unrelated formatter-owned fixture spillover was restored. Historical corpus totals and universal Swagger parity were not revalidated or asserted.

Destination analysis

The agent selected @azure-tools/typespec-azure-resource-manager, exposing the concise official name no-repeated-path-info. Catalog metadata says ARM, the validator source is ARM-specific, fixtures use ARM resource envelopes, and the coverage report selects the resource-manager ruleset. The related official arm-resource-duplicate-property rule compares envelope property names rather than HTTP path/query names and does not provide this check.

Azure Core was considered because the implementation needs only compiler and HTTP APIs, but this guideline specifically constrains PUT resource properties bags rather than shared data-plane REST authoring. ARM is the better ownership boundary. No dependency is added, and no TCGC, OpenAPI or emitter logic is introduced.

How the promoted TypeSpec linter works

getHttpOperation supplies native verb, HTTP parameter names and single request-body metadata. Concrete PUT operations with a model body are checked. walkPropertiesInherited finds the model-valued authored properties member and then its inherited members. Authored ModelProperty.name is compared against supported HTTP path/query names; HTTP name overrides are honored, while JSON @encodedName overrides intentionally do not change the result.

The warning message and property target are preserved. A local set reports each matching name once per operation, so two PUTs sharing a declaration produce two warnings at that declaration. Nested models are not traversed, including cycles and shared siblings. Generic operation sources/instances and generic interface declarations are filtered as in the repaired source; concrete aliases and operations inherited into concrete interfaces are checked. Neither a provider namespace guard nor library-declaration filtering was added. Tests retain a minimal ordinary namespace without provider metadata as well as imported project targets, without duplicating framework namespace traversal.

The source decision logic is preserved, including the independently reviewed template-guard repair. Existing destination adaptations are the public/export names, documentation binding/URL, compiler getProperty lookup and formatting. Native linting uses the compiler operation graph, not an emitter-selected API-version projection. The source harness's http-reachable metadata handles selected-version comparison populations; it is not copied into production. In particular, native names and JSON aliases remain intentionally different in both directions.

The new rule is registered as plain false in the Azure resource-manager ruleset. Availability does not enable new diagnostics for existing service specs. Chronus records a new ARM feature separately from the rulesets' internal disabled registration.

Fixture-to-native test mapping

Native tests use the ARM tester and createLinterRuleTester; no snapshots or lintdiff harness files are copied. The original eight main fixtures and both explicit alias inputs map below, followed by native regression coverage.

Original lintdiff fixture Native vitest case Coverage note
RepeatedPathInfo/body-repeats-path/main.tsp it("reports a path name repeated in ARM PUT resource properties") direct path name on ARM template
RepeatedPathInfo/body-repeats-path-in-base/main.tsp it("targets the repeated authored property, including inherited properties") inherited bag member and exact source span
RepeatedPathInfo/body-repeats-query/main.tsp it("reports a query name repeated in ARM PUT resource properties") query name on ARM PUT
RepeatedPathInfo/body-repeats-multiple-paths/main.tsp it("reports each repeated ARM path name") two exact diagnostics
RepeatedPathInfo/tenant-body-repeats-path/main.tsp it("reports a repeated tenant resource path name") tenant base parameters
RepeatedPathInfo/body-no-repeats/main.tsp it("allows ARM PUT properties with no repeated names") compliant resource bag
RepeatedPathInfo/top-level-body-property-only/main.tsp it("ignores repeated top-level body properties") direct HTTP snippet isolates bag-only semantics from invalid ARM envelope lint
RepeatedPathInfo/patch-body-repeats-path/main.tsp it("ignores repeated properties in PATCH bodies") non-PUT excluded
RepeatedPathInfo/encoded-names/json-name-only.tsp it("allows a JSON alias that alone repeats a path name") native compliant despite JSON alias
RepeatedPathInfo/encoded-names/authored-name-only.tsp it("reports an authored name even when its JSON alias differs") native violation despite JSON alias
N/A (native regression) it("uses supported HTTP parameter names rather than parameter source identifiers") Preserved source-contract regression or destination applicability/early-return coverage
N/A (HTTP prerequisite evidence) Not ported (framework-only) A path parameter and query parameter sharing the same wire name are already rejected by @typespec/http/incompatible-uri-param; this is an HTTP diagnostic, not a native rule assertion.
N/A (native regression) it("does not recurse into cycles or shared sibling models") Preserved source-contract regression or destination applicability/early-return coverage
N/A (native regression) it("reports a shared declaration once per PUT operation at the same source target") Preserved source-contract regression or destination applicability/early-return coverage
N/A (native regression) it("reports project-imported properties at their imported declaration") Preserved source-contract regression or destination applicability/early-return coverage
N/A (native regression) it("ignores missing bodies, non-model bodies, and missing or non-model properties bags") Preserved source-contract regression or destination applicability/early-return coverage
N/A (native regression) it("skips template sources but checks their concrete aliases") Preserved source-contract regression or destination applicability/early-return coverage
N/A (native regression) it("checks ordinary project namespaces without provider metadata") Preserved source-contract regression or destination applicability/early-return coverage
N/A (framework-only coverage removed) Not ported (framework-only) Nested-namespace traversal adds no rule-owned decision beyond the retained ordinary-namespace case.

Migration evidence

See the source RepeatedPathInfo migration evidence for focused fixtures, intentional partial JSON-name parity, historical real-service corpus totals, compile failures, project overlap and Confidential Ledger's selected-version population reconciliation. The historical full-corpus observations are not presented as a newly rerun promotion corpus.

Validation

  • ARM dependency closure built using the prepared checkout/toolchain.

  • Focused native suite: 19 passed, no skips.

  • ARM package build/lint and documentation regeneration passed.

  • Explicit generated README, rule documentation, website linter/rule page and manual ARM matrix formatted and checked using the empty-ignore override.

  • Rulesets build/lint and 5 tests passed; Chronus status and diff hygiene passed.

  • Independent final local prepublication review: no significant issues.

  • Full ARM package: 493 tests across 67 files passed; no skipped tests. The task-local setup profile is retained for this full-scope run.

Validation blocker

The bounded TYPESPEC_SKIP_WEBSITE_BUILD=true pnpm validate:pr --verbose run passed all 64 repository build tasks and the engineering TypeScript check. It then exited with Windows status -1073741510 (0xC000013A) just after printing $ pnpm test, without a test summary or completed validation summary. Elapsed time was about 5 minutes 23 seconds, before the recorded 20-minute overall deadline; the deadline watchdog did not terminate it. Child output is buffered by the validator wrapper, so the precise internal test progress and termination cause are unestablished. This is not a passing broad test/lint/format/docs result, and the command was not retried.

All required targeted validations listed above passed, including full ARM 493/493 and rulesets 5/5 with the recorded local ARM setup profile. The owning queue reconciled this as an incomplete optional broad check: all required targeted validation and independent local prepublication review gates passed. This draft is published with the limitation disclosed, not a claim that repository-wide validation is green; CI remains authoritative for broader integration and the website build. No broad rerun or failed-required-check waiver was authorized. The source rule and both worktree identities remain unchanged; the reviewed promotion commit is retained locally.

Local setup profile

The default 10-second beforeEach limit initially timed out during shared library initialization, before a lint assertion ran; failures are preserved rather than treated as passing. After explicit authorization, profiling the unchanged ARM tester measured cold setup at 11.13 seconds and cached setup at 0.04 ms. Native-host instrumentation identifies JS imports as the largest setup cost. Local focused/full ARM validation uses --hookTimeout 30000 --maxWorkers 1; the checked-in 10-second per-test timeout, all assertions, test population and skip set are unchanged. No repository timeout configuration, dependency, test-host or production logic was changed to address this environment-specific setup limitation.

Promotion sync policy

The lintdiff source remains immutable during promotion. A confirmed source-semantic defect blocks this PR and returns to the owning queue's bounded development/source-repair cycle. This PR is refreshed only after the repaired exact source head passes a fresh development review. Adaptation-only issues belong here; operational failures are not source-repair permission. The queue owns a separate promotion review after publication. Neither PR is automatically merged.

Review cleanup (October 19, 2026)

Moved the URI/envelope interaction cases into no-repeated-path-info.test.ts and removed the per-rule interaction/isolation files. The widgetName/identity cases retain exact targets, including the two-diagnostics-on-one-property case. A focused test/package-isolation.test.ts checks the public ARM entry point with throwing AutoRest/TCGC import guards, without another rule fixture. Removed the redundant internal entry.

Published in eeb9daa. Fresh focused validation: 19 tests passed, package production typecheck, root pnpm format, root pnpm lint, and diff hygiene passed. The full test TypeScript project retains pre-existing diagnostics (25 before, 25 after); the exact-head baseline comparison found no new diagnostics, accounting explicitly for moved tests and any removed duplicate fixture. This is not a claim that the full test TypeScript project is error-free or that pending CI has passed. These current file-layout/coverage statements supersede earlier descriptions of the removed test files; historical validation remains historical.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c593588a-de3f-4117-8f10-101d86839706
@microsoft-github-policy-service microsoft-github-policy-service Bot added int:azure-specs Run integration tests against azure-rest-api-specs lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library meta:website TypeSpec.io updates linter Issues related to linter rules labels Sep 21, 2026
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • ✅ @azure-tools/typespec-azure-resource-manager
  • ✅ @azure-tools/typespec-azure-rulesets
Show changes

@azure-tools/typespec-azure-resource-manager - feature ✏️

Add the no-repeated-path-info lint rule to warn when ARM PUT resource properties repeat path or query parameter names, honoring JSON-encoded property names and including concrete operations inherited from generic interfaces.,> ,> This complements arm-resource-duplicate-property, which checks duplication of resource envelope property names rather than URI parameter names.

@azure-tools/typespec-azure-rulesets - internal ✏️

Register the ARM no-repeated-path-info lint rule as disabled in the resource manager ruleset.

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

📦 Package size report

4 packages changed size, +25.27 KB (+0.1%) packed overall.

Package Packed (base → head) Δ Packed Unpacked (base → head) Δ Unpacked
@azure-tools/typespec-ts 531.62 KB → 550.66 KB +19.04 KB (+3.6%) 🔴 2.67 MB → 2.75 MB +84.13 KB (+3.1%) 🔴
@azure-tools/typespec-client-generator-core 246.53 KB → 248.86 KB +2.34 KB (+0.9%) 🔴 1.31 MB → 1.32 MB +10.30 KB (+0.8%) 🔴
@azure-tools/typespec-azure-resource-manager 192.92 KB → 193.79 KB +892 B (+0.5%) 1.15 MB → 1.16 MB +6.28 KB (+0.5%) 🔴
@azure-tools/typespec-azure-rulesets 5.57 KB → 6.03 KB +471 B (+8.3%) 34.21 KB → 35.39 KB +1.18 KB (+3.4%) 🔴
10 package(s) with no notable change
Package Packed (base → head) Δ Packed Unpacked (base → head) Δ Unpacked
@azure-tools/typespec-java 20.22 MB → 20.22 MB +2.04 KB (+0.0%) 22.51 MB → 22.52 MB +3.61 KB (+0.0%)
@azure-tools/typespec-go 263.76 KB → 264.28 KB +526 B (+0.2%) 1.35 MB → 1.35 MB +2.83 KB (+0.2%)
@azure-tools/typespec-python 42.54 KB → 42.58 KB +43 B (+0.1%) 165.94 KB → 166.02 KB +80 B (+0.0%)
@azure-tools/typespec-metadata 15.91 KB → 15.88 KB -23 B (-0.1%) 62.26 KB → 62.08 KB -181 B (-0.3%)
@azure-tools/typespec-azure-examples 80.17 KB → 80.15 KB -14 B (-0.0%) 383.36 KB → 383.36 KB —
@azure-tools/azure-http-specs 143.52 KB → 143.53 KB +6 B (+0.0%) 1.20 MB → 1.20 MB —
@azure-tools/typespec-azure-portal-core 36.26 KB → 36.26 KB +1 B (+0.0%) 242.62 KB → 242.62 KB —
@azure-tools/typespec-autorest 87.87 KB → 87.87 KB — 424.17 KB → 424.17 KB —
@azure-tools/typespec-autorest-canonical 7.42 KB → 7.42 KB — 26.00 KB → 26.00 KB —
@azure-tools/typespec-azure-core 136.55 KB → 136.55 KB — 733.30 KB → 733.30 KB —

Packed = gzipped .tgz published to npm. Unpacked = total extracted size. 🆕 added, 🗑️ removed. Packages from the core/ submodule are not included.
🔴 grew · 🟢 shrank — only changes of at least 512 B and 0.5% are marked.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Address template-operation filtering and body model resolution issues before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Promotes RepeatedPathInfo to the ARM no-repeated-path-info native linter rule.

Changes:

  • Adds implementation and regression tests.
  • Registers the rule disabled by default.
  • Updates documentation, catalogs, and release metadata.
File Summary
website/​src/​content/​docs/​docs/​libraries/​azure-resource-manager/​reference/​linter.md Updates linter reference.
website/​src/​content/​docs/​docs/​howtos/​ARM/​arm-rules.md Adds ARM guidance entry.
packages/​typespec-azure-rulesets/​src/​rulesets/​resource-manager.ts Registers the disabled rule.
packages/​typespec-azure-resource-manager/​test/​rules/​no-repeated-path-info.test.ts Adds rule tests.
packages/​typespec-azure-resource-manager/​src/​rules/​no-repeated-path-info.ts Implements duplicate path/query detection.
packages/​typespec-azure-resource-manager/​src/​rules/​no-repeated-path-info.md Documents rule behavior.
packages/​typespec-azure-resource-manager/​src/​linter.ts Exposes the rule.
packages/​typespec-azure-resource-manager/​README.md Updates rule catalog.
.chronus/​changes/​register-no-repeated-path-info-disabled.md Adds registration metadata.
.chronus/​changes/​arm-no-repeated-path-info.md Adds feature metadata.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@pkg-pr-new

pkg-pr-new Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@azure-tools/typespec-azure-resource-manager@5526
npm i https://pkg.pr.new/@azure-tools/typespec-azure-rulesets@5526

commit: 7592f2a

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

You can try these changes here

🛝 Playground 🌐 Website

Yuchao Yan (msyyc) and others added 2 commits September 28, 2026 13:14
Document the envelope-versus-URI distinction and cover separate and overlapping diagnostics with both rules enabled.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Yuchao Yan (msyyc) and others added 3 commits September 28, 2026 14:06
Apply the test responsibility guidance from #5572; retain distinct predicate, target, and custom guard regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use default ARM create-or-replace parameters and named overrides only when needed. Compile both authored documentation examples with the rule enabled and assert the duplicate's source target.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9118d346-bf18-4e38-bf01-0d17dacc093f
@microsoft-github-policy-service microsoft-github-policy-service Bot added the stale Mark a PR that hasn't been recently updated and will be closed. label Oct 13, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown

Hi @Yuchao Yan (@msyyc). Your PR has had no update for 14 days and it is marked as a stale PR. If it is not updated within 14 days, the PR will automatically be closed. If you want to refresh the PR, please remove the stale label.

@timotheeguerin

Copy link
Copy Markdown
Member

Copilot-generated review feedback.

Two helper-reuse changes here do not require adding another utility:

  • The local isTemplatedInterfaceOperation duplicates the existing helper in ARM src/rules/utils.ts. Please import that helper, accounting for its current return type, instead of maintaining another copy.
  • getPropertiesModel can use compiler getProperty(model, "properties") followed by a model-kind check instead of walking every inherited property itself. Preserve derived-property override semantics; do not accidentally fall through to an overridden base property when the derived property has a non-model type.

For property enumeration, keep using compiler walkPropertiesInherited. There is a related encoded-name lookup discussion on #5294 and #5502, but this rule's authored-name contract should not be switched to JSON names as a mechanical reuse change. The outstanding overlap/contract discussion remains separate.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Waiting on Mark Cowlishaw (@markcowl) input on if this rule has any purpose over the exising no properties envelope duplicate rules

Yuchao Yan (msyyc) added a commit that referenced this pull request Oct 16, 2026
## Summary

- Treat a lint brief/PR description as the proposal under review, not a
reason to reject clear requests to simplify, revert, or consolidate it.
- Compare existing native mechanisms first; distinguish native
requirements and released compatibility from legacy parity and
complexity introduced by the proposal.
- Delete framework-only suppression/enablement tests without replacement
while retaining concrete rule-owned interactions, authored-node
deduplication, and meaningful regression preconditions.
- Remove bespoke per-rule Markdown parsers instead of moving them into
another suite. Validate published snippets through existing shared
tooling or recorded one-time execution, without claiming continuous
coverage from a one-time receipt.
- Keep actual policy/authorization gates, source immutability, required
validation, and released compatibility intact. Track replies separately
from satisfaction of review concerns.

## Evidence and rationale

This skill-only change follows a retrospective of recorded migration
feedback, not a new live-head review or a change to the underlying rule
PRs.

- [#5591 simplification
direction](#5591 (comment)),
[client-setup
question](#5591 (comment)),
and [model-tree
question](#5591 (comment)):
demonstrating differences from the current design does not independently
establish that its architecture is required.
- [#5551 consolidation
direction](#5551 (comment)):
assess extending the existing native rule and analyze actual
enablement/suppression consequences separately.
- Explicit requests for another maintainer's input, such as
[#5526](#5526 (comment))
and
[#5673](#5673 (comment)),
remain distinct decision dependencies.

The validation skill already discouraged framework-only unit tests, but
evidence-preservation wording could encourage relocating them. Promotion
still explicitly accommodated per-rule Markdown extraction. These
instructions now agree on removing unnecessary infrastructure without
discarding rule-owned behavior or honest published-example evidence.

## Scope

Only five existing skill Markdown files change: discovery,
implementation, validation, development, and promotion. No production
rules, package tests, dependencies, submodules, generated artifacts,
release entries, or CI configuration change. Two custom review/fix
skills stored outside this repository were updated locally in the same
task; they are not included in this PR.

Base: `feature/lintdiff-migration-new`, as explicitly requested.

## Validation

- Existing Prettier 3.9.5: focused Markdown format/check for the changed
files.
- `git diff --check`.
- Checked 78 concrete local Markdown references and heading anchors
across the five changed repository skills; template URL placeholders
were excluded.
- Reviewed the complete task diff and reconciled development/promotion
references with the shared validation guidance.

The root Prettier configuration could not load the unbuilt `core`
TypeSpec plugin. Formatting therefore used the existing Prettier
Markdown parser with the root style options and no custom plugins; no
dependency installation, submodule initialization, or build was
performed for this documentation-only change. Package/source lint and
test suites are not applicable under the skill-only
lightweight-validation policy. Normal CI is left enabled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Yuchao Yan (msyyc) added a commit that referenced this pull request Oct 22, 2026
## Bounded source repair for #5526

The original source migration #5523 is merged. This separately
authorized follow-up fixes its concrete inherited-operation boundary
without reopening that PR or mutating the original reviewed source pin
`08ea9770a0209d7a131c467ec0fd93f3918b1714`. The source package exists on
the owning development queue, so this repair targets
`feature/lintdiff-migration-new`, not `main`. No merge is requested or
performed automatically.

`isTemplateInstance(operation)` also matches real PUT endpoints
inherited from generic interfaces into concrete interfaces. The
canonical violating regression previously produced zero warnings instead
of one. Use the compiler's declaration-aware predicate, retain genuine
template exclusions, and add inherited positive/negative controls with
an exact authored-property diagnostic target. Rule identity, message,
enablement and authored-vs-JSON-name semantics are unchanged. Source
migration guidance and its unreleased fix note match this boundary.

## Validation and review

- Dependency-closure and production builds passed at compiler
`a6137cac43a727ce0c2656364fd72d50c272ee4a`.
- Red regression: expected one warning, found zero; the other eleven
native cases passed.
- Repaired native 12/12 and independent emission 2/2 passed; strict
changed-test types passed.
- Scoped normal/type-aware lint, all five intended-file formatting
checks and diff hygiene passed.
- Independent source-development review found no significant issues in
frozen tree `0ac45147f27cf61f439bcd3778eafb6e4b7d08f3`; the committed
tree is identical. The reviewer independently reran all 14 focused
tests. This is not GitHub approval.

Root lint is not green: it reports 228 warnings entirely in unchanged
harness/other-rule files, zero in the changed source/test. Root
formatting rewrote unrelated baseline fixture/metadata files; only
formatter-owned spillover was restored, and the final diff is exactly
five intended files. Narrow checks follow the repository's
generated-artifact/baseline exception. Historical corpus totals were not
refreshed and are not claimed as repaired-head evidence. No universal
Swagger parity or broad integration/merge readiness is claimed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the four reviewed implementation-detail paragraphs while preserving examples, migration guidance, and rule behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adopt walkJsonProperties after independently reviewed source repair 8dcb693 (#5805). Preserve authored targets and existing coverage while correcting both JSON alias directions. Bring the exact upstream model utility and compiler-only canonical helper coverage without unrelated main-branch changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

int:azure-specs Run integration tests against azure-rest-api-specs lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library linter Issues related to linter rules meta:website TypeSpec.io updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants