Skip to content

Add status filter to V3 metadata list APIs for inactive data discovery#216

Merged
em3s merged 3 commits intomainfrom
feature/v3-metadata-status-filter
Mar 16, 2026
Merged

Add status filter to V3 metadata list APIs for inactive data discovery#216
em3s merged 3 commits intomainfrom
feature/v3-metadata-status-filter

Conversation

@eazyhozy
Copy link
Copy Markdown
Member

@eazyhozy eazyhozy commented Mar 13, 2026

Summary

Add status query parameter (ACTIVE/INACTIVE/ALL) to V3 metadata list endpoints, enabling discovery of inactive items for cleanup purposes.

Closes #212

Changes

  • Add MetadataStatus enum with matches() method for status-based filtering
  • Add @RequestParam status (default: ACTIVE) to DatabaseController, TableController, AliasController list endpoints
  • Replace hardcoded .filter { it.active } in V3CompatService with status.matches(it.active)
  • Add E2E tests for status filtering (default, ACTIVE, INACTIVE, ALL) on all 3 endpoints
  • Add unit tests for MetadataStatus.matches() logic
  • Add validation tests for invalid status values (400 Bad Request)

How to Test

# Default (backward compatible) — returns only active
GET /graph/v3/databases

# Explicit active filter
GET /graph/v3/databases?status=ACTIVE

# Inactive items only
GET /graph/v3/databases?status=INACTIVE

# All items regardless of status
GET /graph/v3/databases?status=ALL

# Invalid value returns 400
GET /graph/v3/databases?status=BOGUS

Same pattern applies to /graph/v3/databases/{db}/tables and /graph/v3/databases/{db}/aliases.

Note

The original discussion in #212 used lowercase values (active|inactive|all), but this PR implements them as uppercase (ACTIVE/INACTIVE/ALL). This project's enum parameter binding is case-sensitive — the query parameter value must exactly match the enum constant name. Lowercase values (e.g. ?status=active) return 400 Bad Request. If case-insensitive support is desired, a custom converter can be registered separately.

Allow filtering by status (ACTIVE/INACTIVE/ALL) on list endpoints:
- GET /graph/v3/databases
- GET /graph/v3/databases/{database}/tables
- GET /graph/v3/databases/{database}/aliases

Default is ACTIVE, preserving backward compatibility.
Inactive items can now be discovered for cleanup via ?status=INACTIVE
or ?status=ALL.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@eazyhozy eazyhozy self-assigned this Mar 13, 2026
Verify that lowercase status values (e.g. ?status=active) return 400,
documenting the current case-sensitive enum binding behavior.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@eazyhozy eazyhozy marked this pull request as ready for review March 13, 2026 08:49
@eazyhozy eazyhozy requested a review from em3s as a code owner March 13, 2026 08:49
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Mar 13, 2026
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@em3s em3s changed the title Add status query parameter to V3 metadata list APIs Add status query parameter to V3 metadata list APIs to query inactive data Mar 16, 2026
@em3s em3s changed the title Add status query parameter to V3 metadata list APIs to query inactive data Add status filter to V3 metadata list APIs for inactive data discovery Mar 16, 2026
@em3s
Copy link
Copy Markdown
Contributor

em3s commented Mar 16, 2026

Solid implementation

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 16, 2026
@em3s em3s merged commit 664355b into main Mar 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to include inactive items in V3 metadata list APIs

2 participants