Skip to content

diagnostics: remove legacy /api compatibility endpoints#1528

Merged
strawgate merged 2 commits into
mainfrom
codex/admin-v1-endpoints-cutover
Apr 7, 2026
Merged

diagnostics: remove legacy /api compatibility endpoints#1528
strawgate merged 2 commits into
mainfrom
codex/admin-v1-endpoints-cutover

Conversation

@strawgate
Copy link
Copy Markdown
Owner

@strawgate strawgate commented Apr 7, 2026

Summary

  • remove legacy diagnostics route aliases under /api/* from the diagnostics router
  • migrate in-repo consumers (dashboard, bench helpers, competitive bench agent, docs) to /admin/v1/*
  • regenerate embedded dashboard HTML and keep endpoint comments/tests aligned

Why

PR #1509 landed readiness/status policy improvements, but main still accepted legacy /api/* helper routes. This finishes the cutover so the interface is consistent and explicit.

Validation

  • cargo fmt --check
  • rg -n "/api/stats|/api/config|/api/logs|/api/history|/api/traces" --glob '!dev-docs/research/**' --glob '!target/**'
  • cargo test -p logfwd-io diagnostics::tests:: -- --nocapture

Notes

  • Remaining /api/* references are intentional in the legacy-404 test coverage to assert removed endpoints stay removed.

Note

Remove legacy /api/* diagnostics endpoints in favor of /admin/v1/*

  • Replaces all /api/{stats,config,logs,history,traces} routes in DiagnosticsServer with /admin/v1/ equivalents; the old paths now return 404.
  • Updates all API clients — dashboard (api.ts, dashboard.html, LogViewer.tsx), benchmarking agent, and justfile recipes — to use the new paths.
  • Removes the /api dev-server proxy from vite.config.ts and updates all documentation.
  • Risk: any external tooling or scripts still calling /api/* endpoints will receive 404 with no fallback.

Macroscope summarized f8640f1.

Copilot AI review requested due to automatic review settings April 7, 2026 16:31
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1e00ce8d-df26-49fc-b8d5-d0162937fd8a

📥 Commits

Reviewing files that changed from the base of the PR and between 75d8444 and f8640f1.

📒 Files selected for processing (13)
  • book/src/config/reference.md
  • book/src/deployment/monitoring.md
  • book/src/getting-started/first-pipeline.md
  • book/src/troubleshooting.md
  • crates/logfwd-competitive-bench/src/agents/logfwd.rs
  • crates/logfwd-io/src/dashboard.html
  • crates/logfwd-io/src/diagnostics.rs
  • crates/logfwd-io/src/span_exporter.rs
  • crates/logfwd-io/src/stderr_capture.rs
  • dashboard/src/api.ts
  • dashboard/src/components/LogViewer.tsx
  • dashboard/vite.config.ts
  • justfile
💤 Files with no reviewable changes (1)
  • dashboard/vite.config.ts

Walkthrough

This pull request renames five diagnostic/monitoring API endpoints from the /api path to /admin/v1 across the codebase. The endpoints affected are /stats, /config, /logs, /history, and /traces. Changes span documentation files, the diagnostics server implementation in crates/logfwd-io/src/diagnostics.rs, dashboard frontend code in TypeScript, benchmark agent code, and build configuration files. The HTTP methods, endpoint functionality, and behavior descriptions remain unchanged—only the route paths are updated.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Maintainer Fitness ⚠️ Warning PR description lacks explicit documentation of breaking changes, risk surface, and migration requirements for legacy endpoint removal. Document breaking change status, required migration path to /admin/v1/*, deprecation timeline, and link to migration guidance.
✅ Passed checks (4 passed)
Check name Status Explanation
High-Quality Rust Practices ✅ Passed PR adheres to Rust practices: clone calls in non-hot-path code, unsafe block has SAFETY comment, unwrap/expect calls only in test modules, route changes are straightforward string updates.
Formal Verification Coverage ✅ Passed PR migrates endpoints from /api/* to /admin/v1/* through routing configuration changes, documentation updates, and test modifications. No new public functions, parsers, state machines, or complex logic requiring formal verification were added.
Documentation Thoroughly Updated ✅ Passed PR appropriately addressed documentation for endpoint URL migration from /api/* to /admin/v1/*, with no ARCHITECTURE.md, DESIGN.md, VERIFICATION.md, CONFIG_REFERENCE.md, or CRATE_RULES.md updates needed.
Crate Boundary And Dependency Integrity ✅ Passed PR modifies only documentation and endpoint URL strings in source code, introducing no changes to crate structure, dependencies, or Cargo.toml files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR completes the diagnostics API cutover by removing legacy /api/* compatibility routes and updating all in-repo consumers and docs to use the canonical /admin/v1/* endpoints.

Changes:

  • Remove /api/{stats,config,logs,history,traces} routing in the diagnostics server and update tests to validate both the new routes and legacy 404 behavior.
  • Migrate dashboard + bench helpers + competitive bench agent to /admin/v1/*.
  • Regenerate embedded dashboard HTML and update docs/comments to reference /admin/v1/*.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
justfile Updates benchmark helpers to poll /admin/v1/stats instead of legacy /api/stats.
dashboard/vite.config.ts Removes dev proxy for /api, keeping /admin as the canonical proxy prefix.
dashboard/src/components/LogViewer.tsx Switches log polling from /api/logs to /admin/v1/logs.
dashboard/src/api.ts Moves dashboard API helpers from /api/* to /admin/v1/*.
crates/logfwd-io/src/stderr_capture.rs Updates module docs to reflect the /admin/v1/logs endpoint.
crates/logfwd-io/src/span_exporter.rs Updates docs to reflect the /admin/v1/traces endpoint.
crates/logfwd-io/src/diagnostics.rs Removes legacy /api/* routes, updates routing to /admin/v1/*, and aligns tests (including explicit legacy 404 assertions).
crates/logfwd-io/src/dashboard.html Regenerates embedded dashboard bundle with /admin/v1/* endpoints.
crates/logfwd-competitive-bench/src/agents/logfwd.rs Updates competitive bench agent stats URL to /admin/v1/stats.
book/src/troubleshooting.md Updates example curl commands to /admin/v1/stats.
book/src/getting-started/first-pipeline.md Updates example curl commands to /admin/v1/stats.
book/src/deployment/monitoring.md Updates endpoint list to /admin/v1/*.
book/src/config/reference.md Updates endpoint reference table to /admin/v1/*.

@macroscopeapp
Copy link
Copy Markdown

macroscopeapp Bot commented Apr 7, 2026

Approvability

Verdict: Approved

Mechanical rename of diagnostic API endpoints from /api/* to /admin/v1/* paths across code, tests, documentation, and tooling. This is a breaking change for external consumers of the old endpoints (which now return 404), but the change is consistent, well-tested, and clearly intentional as indicated by the PR title.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants