You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
publish --dry-run crashes with fatal error when artifacts contain gateway API associations #269
Dry-run completes and reports planned PUT/DELETE/SKIP actions; a log-label formatting problem must never abort the publish.
Actual behavior
Error
[ERROR] Fatal error during publish: formatTemplatePath: nameParts[1] is undefined
for template "gateways/{0}/apis/{1}" (nameParts has 1 entries)
at formatTemplatePath (dist/lib/resource-path.js:43)
at buildResourceLabel (dist/lib/resource-uri.js:106)
at generateDryRunReport (dist/services/dry-run-reporter.js:66)
Root Cause
GatewayApi associations are discovered from gateways/{gateway}/apis.json as a single descriptor carrying only the parent gateway's name (one name-part, e.g. ['managed']). Expansion into per-API entries happens later, at PUT time (publishAssociation). However, buildResourceLabel() in src/lib/resource-uri.ts unconditionally formats the log label from the full ARM path template gateways/{0}/apis/{1} (two placeholders), which throws for a one-part descriptor. The throw escapes from logger.info(...) inside the dry-run loop and kills the whole run.
Steps to Reproduce
Extract a service that has at least one gateway with API assignments (produces gateways/<name>/apis.json).
Run apiops publish --dry-run --source <artifacts> ...
Activity