chore(agent): remove stale unscoped webhook routes from API router #93

Open
sharang wants to merge 1 commits from fix/remove-stale-api-webhook-routes into main
Owner

Summary

compliance-agent/src/api/routes.rs was mounting the pre-M7.2-C webhook routes /webhook/{platform}/{repo_id} on the API server (port 3001), but the handlers in compliance-agent/src/webhooks/{gitea,github,gitlab}.rs expect a (tenant_id, repo_id) path tuple after M7.2-C. Any request to those API-server routes would 500 on the path extraction mismatch.

The webhook handlers are still mounted correctly on the separate webhook server (port 3002, webhooks/server.rs) with the /webhook/{tenant_id}/{platform}/{repo_id} form, which is what the dashboard's webhook proxy forwards to.

No functional change — the broken API-server routes never produced a successful response. This just drops dead code.

Test plan

  • cargo fmt --all -- --check clean
  • cargo clippy -p compliance-agent -- -D warnings clean
  • cargo test -p compliance-agent --lib — 228 pass (no change vs main)

🤖 Generated with Claude Code

## Summary `compliance-agent/src/api/routes.rs` was mounting the pre-M7.2-C webhook routes `/webhook/{platform}/{repo_id}` on the API server (port 3001), but the handlers in `compliance-agent/src/webhooks/{gitea,github,gitlab}.rs` expect a `(tenant_id, repo_id)` path tuple after M7.2-C. Any request to those API-server routes would 500 on the path extraction mismatch. The webhook handlers are still mounted correctly on the separate webhook server (port 3002, `webhooks/server.rs`) with the `/webhook/{tenant_id}/{platform}/{repo_id}` form, which is what the dashboard's webhook proxy forwards to. **No functional change** — the broken API-server routes never produced a successful response. This just drops dead code. ## Test plan - [x] `cargo fmt --all -- --check` clean - [x] `cargo clippy -p compliance-agent -- -D warnings` clean - [x] `cargo test -p compliance-agent --lib` — 228 pass (no change vs main) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sharang added 1 commit 2026-06-18 10:47:00 +00:00
chore(agent): remove stale unscoped webhook routes from API router
CI / Check (pull_request) Successful in 8m6s
CI / Detect Changes (pull_request) Has been skipped
CI / Deploy Agent (pull_request) Has been skipped
CI / Deploy Dashboard (pull_request) Has been skipped
CI / Deploy Docs (pull_request) Has been skipped
CI / Deploy MCP (pull_request) Has been skipped
69dbd83c24
`compliance-agent/src/api/routes.rs` mounted the pre-M7.2-C webhook
routes `/webhook/{platform}/{repo_id}` on the API server (port 3001),
but the handlers in `compliance-agent/src/webhooks/{gitea,github,
gitlab}.rs` expect a `(tenant_id, repo_id)` path tuple since the
M7.2-C tenant-in-URL migration. Any request hitting those API-server
routes would 500 on the path extraction mismatch — dead code from
the M7.2-C migration not propagating to this file.

The webhook handlers are still mounted correctly on the separate
webhook server (port 3002, `compliance-agent/src/webhooks/server.rs`)
with the `/webhook/{tenant_id}/{platform}/{repo_id}` form. That's
what the dashboard's webhook proxy forwards to.

No functional change — the broken routes never produced a successful
response, so removing them just drops the surface area.

Test plan
- cargo fmt --all clean
- cargo clippy -p compliance-agent -- -D warnings clean
- cargo test -p compliance-agent --lib — 228 pass (no change vs main)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Some checks are pending
CI / Check (pull_request) Successful in 8m6s
CI / Detect Changes (pull_request) Has been skipped
CI / Deploy Agent (pull_request) Has been skipped
CI / Deploy Dashboard (pull_request) Has been skipped
CI / Deploy Docs (pull_request) Has been skipped
CI / Deploy MCP (pull_request) Has been skipped
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/remove-stale-api-webhook-routes:fix/remove-stale-api-webhook-routes
git checkout fix/remove-stale-api-webhook-routes
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sharang/compliance-scanner-agent#93