feat(pipeline-monitor): per-scope progress tab — live ETA + stalled detection (FDD-OPS-015 UI)#8
Merged
nascimentolimaandre-cloud merged 1 commit intomainfrom Apr 29, 2026
Conversation
…d detection (FDD-OPS-015 UI) Closes the FDD-OPS-015 deliverable list — backend (PR #6) shipped the API, this PR ships the operator-facing UI tab "Per-scope" no Pipeline Monitor. WHAT YOU SEE A 4ª aba "Per-scope" no `/pipeline-monitor` route mostra **live**: - Sumário no header: counts de "running", "stalled", "done", "failed" - Tabela com 1 row por scope ativo/recente: Scope (jira:project:BG / github:repo:foo/bar) Entity type Progress bar com itemsDone / itemsEstimate + percentage Status badge (running spinner, stalled warning, done check, failed X) Rate (items/sec) ETA formatado (90s, 5m 23s, 2h 14m) Last activity (relative: "12s ago", "3m ago") - Filters: by entity_type (issues/prs/deploys/sprints) + by status - Polling cada 5s (live update, stale at 2s) STALLED DETECTION Quando backend reporta `isStalled=true` (status='running' AND no progress for >60s), a row ganha: - Background tinted warning (subtle yellow) - AlertCircle icon - "STALLED" badge replaces normal status Operator vê em segundos qual scope precisa de atenção. NO-ESTIMATE GRACEFUL HANDLING Se backend não conseguiu pre-flight count (timeout, source unsupported), itemsEstimate=null: - Progress bar mostra stripe indeterminado (15% width como hint) - Pct label exibe "?" - ETA exibe "—" Não trava UI; operador vê "fetching, taxa X/s, total desconhecido". ANTI-SURVEILLANCE Schema Zod strict() em testes rejeita `author`/`assignee` no payload — matches o invariant em metrics-inconsistencies §8.9. FILES Frontend: - types/pipeline.ts: ProgressJob, ProgressJobStatus, ProgressJobPhase - lib/api/pipeline.ts: fetchPipelineJobs (com query params) - hooks/usePipeline.ts: usePipelineJobs (5s polling, 2s staleTime) - components/pipeline/PerScopeJobs.tsx (NEW, ~330 lines) - routes/_dashboard/pipeline-monitor.tsx: 4ª tab "Per-scope" Tests: - tests/contract/schemas/pipeline-jobs.schema.ts (Zod schema) - tests/contract/pipeline-jobs-contract.test.ts (13 tests): A-G: shape validity (running/no-estimate/stalled/failed/done/empty/array) H-I: anti-surveillance (rejects author/assignee) J-M: defensive bounds (negative items, >100 pct, unknown enums) VALIDATION ✅ TypeScript build clean (npx tsc --noEmit) ✅ ESLint clean (no new warnings) ✅ 163/163 frontend tests pass (13 novos + 150 anteriores) ✅ Live API smoke test: 10+ scopes returned, isStalled correctly computed ✅ JSON wire-shape matches schema (verified via curl during dev) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Fecha a entrega do FDD-OPS-015 — backend (PR #6) shipou a API
/pipeline/jobs, esta PR ship a UI tab "Per-scope" no Pipeline Monitor. Operadores agora respondem "is BG project still progressing or stuck?" em segundos via interface visual, sem precisar curl/grep.What you see
4ª aba "Per-scope" no route
/pipeline-monitor:Header summary
Counts ao vivo: running (spinner), stalled (warning), done, failed — operator olhada de 1s.
Tabela (1 row por scope ativo/recente)
jira:project:BG→ "BG" + source badge "JIRA"Filters
Polling
5s
refetchInterval, 2sstaleTime— live updates sem refresh.Stalled detection (operator signal)
Quando backend reporta
isStalled=true(status='running' AND no progress for >60s), a row recebe:Operator vê em segundos qual scope precisa de atenção — sem precisar dar curl em
/pipeline/jobs.No-estimate graceful handling
Se backend não conseguiu pre-flight count (timeout/source unsupported),
itemsEstimate=null:UI não trava; mostra "fetching, taxa X/s, total desconhecido".
Anti-surveillance
ProgressJobSchema.strict()em tests rejeitaauthor/assigneeinjetados no payload — matches o invariant emmetrics-inconsistencies §8.9. Schema completamente metadata-only.Files
Frontend
types/pipeline.ts:ProgressJob,ProgressJobStatus,ProgressJobPhaselib/api/pipeline.ts:fetchPipelineJobs(params)com query filteringhooks/usePipeline.ts:usePipelineJobs(5s polling, 2s stale)components/pipeline/PerScopeJobs.tsx(novo, ~330 linhas)routes/_dashboard/pipeline-monitor.tsx: tab "Per-scope" wiredTests
tests/contract/schemas/pipeline-jobs.schema.ts: Zod schematests/contract/pipeline-jobs-contract.test.ts: 13 testsauthor/assigneeextras)Validation
npx tsc --noEmit)npx vitest run)curl /pipeline/jobs)isStalledcorrectly computedStats
PerScopeJobs.tsx)Test plan
cd packages/pulse-web && npx vitest run tests/contract/pipeline-jobs-contract.test.ts→ 13 verdenpm run dev→ http://localhost:5173/pipeline-monitor → clicar tab "Per-scope"Dependencies
🤖 Generated with Claude Code