Azure / Azure/apiops-cli

Improve Extract and Publish log readability

Abierto
#162 1 comentario 0 reacciones 0 asignados Ver en GitHub
Enhancement P2
Lenguaje dominante
TypeScript
Estrellas
26
Forks
9
Merge medio
1 d 3 h
PR fusionados (30 d)
20

Descripción

## Summary

Feedback on the integration test logs (`tests/integration/all-resource-types/basicv2-test.log`) identified several readability and usability improvements for the Extract and Publish command output.

## Proposed Improvements

### Extract Command (`src/cli/extract-command.ts`)

1. **Group resources by dependency tier** — The "Extracted N Type(s)" lines are a flat list with no visual hierarchy. Group by tier or add blank lines between categories.

2. **List all APIs in the detail section** — Currently only APIs with specs/operations are shown (7 of 12). APIs like `src-graphql-synthetic` and `src-a2a-weather-agent` are silently omitted. List all APIs even if minimal.

3. **Add elapsed time to the Total line** — `Total: 96 resources extracted, 0 errors` should include duration (e.g., `in 12.3s`).

### Publish Command (`src/services/publish-service.ts`, `src/cli/publish-command.ts`)

4. **Add tier/phase headers** — All PUTs are a single flat stream. Since publish executes in dependency tiers, add headers:
```
── Tier 1: Independent resources (16) ──
PUT namedvalue/src-nv-plain
...
── Tier 2: Resources with dependencies (2) ──
PUT backend/src-backend-pool
```

5. **Add elapsed time** — No indication of how long publish took or which resources were slow. Add per-tier or total timing.

6. **Enrich the summary** — `41 creates/updates, 0 deletes, 1 skipped` could also show total elapsed time and retry count (e.g., "6 retries across 2 resources").

### Retry Logging (`src/clients/apim-client.ts`)

7. **Round retry delay values** — `retrying after 1175.1730686888397ms` → `retrying in 1.2s`

8. **Include resource context in retry warnings** — Currently no indication of *which* resource triggered the retry.

9. **Include attempt number** — e.g., `(attempt 2/5)` so readers know retry progress.

10. **Reduce retry noise in output** — Retries interleave with PUT lines and break the flow. Consider grouping retries under their resource or suppressing intermediate retries (show only final outcome with retry count).

## Files to Modify

- `src/cli/extract-command.ts` — items 1–3
- `src/services/publish-service.ts` — items 4–6
- `src/cli/publish-command.ts` — items 5–6
- `src/clients/apim-client.ts` — items 7–10

## Related

Based on review of `tests/integration/all-resource-types/basicv2-test.log`

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con tests/integration/all-resource-types/basicv2-test.log y, después, compara las rutas de salida relevantes en src/cli/extract-command.ts, src/services/publish-service.ts, src/cli/publish-command.ts y src/clients/apim-client.ts. Rastrea cómo registran actualmente su trabajo la extracción, la publicación y los reintentos. Se considera terminado cuando la salida cubra las mejoras propuestas de agrupación, tiempos, resumen y contexto de los reintentos sin omitir APIs.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
typescript
Área
cli
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.