Dry-run should perform client-side validation to catch failures that actual publish would hit
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- typescript
Línea de trabajo
Empieza leyendo src/services/dry-run-reporter.ts, src/services/override-merger.ts y src/lib/config-loader.ts, y después compara tests/test-overrides/extract-dryrun.log con extract.log. Rastrea el payload final después de combinar los overrides e identifica cómo el dry-run informa de las operaciones PUT. Se considera terminado cuando las comprobaciones del lado del cliente emiten líneas [DRY RUN] WARN informativas sin bloquear el informe ni cambiar su código de salida.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
The current --dry-run implementation only checks whether resources exist in the target APIM instance (GET to determine PUT vs create). It does not validate the merged payload, so dry-run reports success for resources that will fail during actual publish.
Evidence
Comparing tests/test-overrides/extract-dryrun.log (dry-run) vs tests/test-overrides/extract.log (actual publish), dry-run reported all resources as PUT while actual publish hit multiple HTTP 400 validation errors:
| Resource | Publish Error | Dry-run result |
|---|---|---|
namedvalue/src-nv-plain |
ValidationError — display name contains spaces/parens (invalid characters) |
✅ PUT |
namedvalue/src-nv-secret |
ValidationError — same display name issue |
✅ PUT |
namedvalue/src-nv-keyvault |
Managed identity clientId not found on target |
✅ PUT |
backend/src-backend-circuit-breaker |
failureCondition must not be empty |
✅ PUT |
backend/src-backend-function |
resourceId — "Value should represent absolute http URL" |
✅ PUT |
backend/src-backend-logicapp |
resourceId — same URL format issue |
✅ PUT |
logger/src-logger-appinsights |
Invalid instrumentation key | ✅ PUT |
logger/src-logger-eventhub |
HTTP 502/500 (connection string validation) | ✅ PUT |
diagnostic/applicationinsights |
Invalid loggerId reference |
✅ PUT |
diagnostic/azuremonitor |
Invalid loggerId reference |
✅ PUT |
Proposed Validations
The dry-run reporter should add client-side validation before reporting PUT. These checks should produce [DRY RUN] WARN lines without blocking the rest of the report. Suggested checks:
1. Named Value display name format
ARM rejects display names with spaces, parentheses, and other special characters. Validate against the pattern: ^[A-Za-z0-9._-]+$.
2. Resource ID format validation
resourceId fields on backends must be valid ARM resource IDs (starting with /subscriptions/). Currently, override values like bare paths pass through unchecked.
3. URL format validation
Backend url fields and API serviceUrl fields should be valid URLs with a scheme (https://, wss://, etc.).
4. Cross-resource reference validation (loggerId)
Diagnostics reference loggers by loggerId. Dry-run should verify the referenced logger exists either in the artifact set or in the target APIM instance. Same applies after override merging — if an override changes loggerId, validate the new value.
5. Circuit breaker rule completeness
ARM requires failureCondition when circuitBreaker.rules is specified. Validate that overrides don't produce partial circuit breaker configs.
6. Key Vault identity pre-check
When a named value references a Key Vault with identityClientId, verify that the identity is present on the target APIM service (the service's managed identities are available via the service resource GET).
7. Logger credential validation
Warn when logger credentials contain placeholder values (e.g., production-instrumentation-key-00000000) that are unlikely to be valid GUIDs or connection strings.
8. Override key validity
Warn when override properties don't match any known field in the resource's ARM schema (typo detection). For example, retryCondition vs the correct failureCondition nesting.
9. Dependency ordering warnings
When a resource depends on another resource that is itself invalid or skipped, warn that downstream resources will likely also fail.
Implementation Notes
- Validations should run after override merging, against the final payload that would be sent to ARM.
- Warnings should not change the exit code — they are advisory. Consider a
--strictflag that promotes warnings to errors. - These are client-side heuristics; ARM will always be the authoritative validator. The goal is to catch the most common mistakes early.
Related Files
src/services/dry-run-reporter.ts— main dry-run logicsrc/services/override-merger.ts— override mergingsrc/lib/config-loader.ts— override loading
- Lenguaje dominante
- TypeScript
- Estrellas
- 29
- Forks
- 10
- Merge medio
- 1 d 14 h
- PR fusionados (30 d)
- 22
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Azure/apiops-cli
-
type:question
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Azure/apiops-cli#277 ·
-
type:documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 94/100
Azure/apiops-cli#250 ·
-
Documentation P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Azure/apiops-cli#24 · 1 comentario ·
-
type:bug
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Azure/apiops-cli#291 ·
-
type:bug
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
Azure/apiops-cli#276 ·
Todos los issues de Azure/apiops-cli
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Abiertobug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Client support matrix inclusion Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
calcite-components needs triage refactor
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Esri/calcite-design-system#15203 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
danielmiessler/LifeOS#2218 ·