fix: enable cross-service publish and WSDL re-import with external xsd:imports - #285
Merged
Alexander Zaslonov (azaslonov) merged 2 commits intoSep 21, 2026
Conversation
…d:imports
Three publish fixes verified against a live Developer-tier instance:
- strip the top-level source ARM id from PUT/PATCH bodies; newer APIM
api-versions reject cross-service resource references, breaking publish
to any service other than the one extracted from
- normalize diagnostic loggerId (service and API scope) to the target
service ARM path, honoring env-mapping affixes
- drop xsd:import schemaLocation attributes that reference external hosts
when the imported namespace is declared inline in wsdl:types; APIM's
importer otherwise fails ("Unable to parse WSDL") or times out trying
to resolve unreachable source-service URLs. Applied on both the publish
path (existing artifacts) and extract path (future extracts)
Closes Azure#284
Copilot started reviewing on behalf of
Aleksey Zheltov (Alexey-Zheltov)
September 14, 2026 16:52
View session
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Workspace-scoped diagnostic logger references must include the deployed workspace path.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Fixes cross-service APIM publishing and SOAP WSDL re-import failures.
Changes:
- Removes source ARM IDs and remaps diagnostic logger references.
- Normalizes inline WSDL XSD imports on extract and publish.
- Adds unit coverage for the new behavior.
- Critical unresolved issue: workspace-scoped diagnostic logger references omit the workspace path.
File summaries
| File | Summary |
|---|---|
tests/unit/services/resource-publisher.test.ts |
Tests diagnostic logger normalization. |
tests/unit/lib/wsdl-normalizer.test.ts |
Tests WSDL import normalization. |
tests/unit/clients/apim-client.test.ts |
Tests ARM ID stripping. |
src/services/resource-publisher.ts |
Rebuilds diagnostic logger references; workspace paths remain unsupported. |
src/services/api-publisher.ts |
Applies WSDL normalization during publishing. |
src/lib/wsdl-normalizer.ts |
Removes unnecessary inline XSD import locations. |
src/clients/apim-client.ts |
Strips top-level ARM IDs from write payloads. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Review finding on Azure#285: workspace-scoped diagnostics reference workspace loggers, but the rebuilt loggerId always pointed at the service level. Pass descriptor.workspace through and emit /workspaces/{ws}/loggers/{name} (with env-mapping affixes), mirroring normalizeApiVersionSetId.
Copilot started reviewing on behalf of
Aleksey Zheltov (Alexey-Zheltov)
September 14, 2026 17:04
View session
Alexander Zaslonov (azaslonov)
approved these changes
Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two independent publish failures verified end-to-end against a live Developer-tier APIM instance.
1. Cross-service publish rejected (HTTP 400)
Extracted artifacts carry the source service's ARM paths, and the publisher sent them verbatim. Newer APIM api-versions reject these with
ValidationError: Cross-service resource references are not allowed, failing every resource PUT when the target differs from the source service (27/27 errors in repro).stripSourceArmId()inapim-client: strip the top-levelidfrom PUT/PATCH bodiesnormalizeDiagnosticLoggerId()inresource-publisher: rebuildproperties.loggerIdofDiagnostic/ApiDiagnosticagainst the target service (honoring env-mapping affixes), same pattern as existingapiId/apiVersionSetIdnormalizations2. SOAP WSDL re-import fails: "Unable to parse WSDL" / HTTP 422 Timeout
APIM's WSDL export inlines all XSD schemas in
wsdl:typesand preserves the originalxs:import schemaLocationURLs from the initial import (private hosts unreachable from Azure). On re-import APIM tries to resolve them and fails or times out.normalizeWsdlXsdImportLocations()inwsdl-normalizer: drop theschemaLocationattribute only when the imported namespace is declared by an inline schema (per XML Schema spec,schemaLocationis just a hint).wsdl:import location=, no-namespace imports, and namespaces not present inline are left untouchedVerification
format=wsdlimport, 32 externalxs:imports) now publishes with 0 errors (37 creates/updates)tests/unit/cli/index.test.tsare a known 9p-mount environment issue, unrelated)Related Issue(s)
Closes #284
Related: #270 (same WSDL round-trip area, different layer — XSD schema artifact re-PUTs)
Code Review
Code review per
.squad/ceremonies.mdrequested — changes touchsrc/andtests/.