Command that triggered the bug
apiops --publish --dry-run
Expected behavior
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> ...
apiops CLI version
1.0.1
Environment details
- apiops-cli 1.0.1
- Node.js v22.16.0
CI/CD environment
None
Is this bug blocking you?
No
Command that triggered the bug
apiops --publish --dry-run
Expected behavior
Dry-run completes and reports planned PUT/DELETE/SKIP actions; a log-label formatting problem must never abort the publish.
Actual behavior
Error
Root Cause
GatewayApiassociations are discovered fromgateways/{gateway}/apis.jsonas 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()insrc/lib/resource-uri.tsunconditionally formats the log label from the full ARM path templategateways/{0}/apis/{1}(two placeholders), which throws for a one-part descriptor. The throw escapes fromlogger.info(...)inside the dry-run loop and kills the whole run.Steps to Reproduce
gateways/<name>/apis.json).apiops publish --dry-run --source <artifacts> ...apiops CLI version
1.0.1
Environment details
CI/CD environment
None
Is this bug blocking you?
No