CodeForPhilly / CodeForPhilly/codeforphilly-ng

Remove or guard /_test/* stub routes in production

Open
#18 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1
Forks
1
Avg merge
5d 3h
Merged PRs (30d)
9

Description

The api-skeleton plan added three stub routes used only by integration tests:
- `POST /api/_test/validation-error` — throws `ApiValidationError` for testing the error mapper
- `POST /api/_test/internal-error` — throws a generic Error for testing 500 behavior
- `POST /api/_test/idempotency` — tests idempotency key replay

These have `{ schema: { hide: true } }` so they don't appear in the OpenAPI doc, but they're live in production. They should either be removed before cutover or guarded behind `NODE_ENV !== 'production'`.

Came out of api-skeleton (PR #17), Follow-up item.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the three /api/_test/* route definitions added by the api-skeleton work in PR #17, then inspect the integration tests that exercise validation errors, internal errors, and idempotency replay. Decide whether removal or an environment guard fits the cutover plan; done means the test behavior remains available while production no longer exposes these routes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.