Skip to content

chore: remove unused PaginationParams, ObservabilityQueryParams, and PerformanceHistoryParams schemas#3708

Merged
crivetimihai merged 1 commit intoIBM:mainfrom
omorros:chore/remove-unused-pagination-schemas-3706
Mar 22, 2026
Merged

chore: remove unused PaginationParams, ObservabilityQueryParams, and PerformanceHistoryParams schemas#3708
crivetimihai merged 1 commit intoIBM:mainfrom
omorros:chore/remove-unused-pagination-schemas-3706

Conversation

@omorros
Copy link
Copy Markdown
Contributor

@omorros omorros commented Mar 17, 2026

🔗 Related Issue

Closes #3706

📝 Summary

Remove three unused Pydantic schema classes (PaginationParams, ObservabilityQueryParams, PerformanceHistoryParams) from mcpgateway/schemas.py. These are dead code that no endpoint imports or uses. Notably, PaginationParams hardcodes le=500 which would silently conflict with the configurable PAGINATION_MAX_PAGE_SIZE setting if anyone used it, potentially reintroducing the 422 bug fixed in #3469.


🏷️ Type of Change

  • Bug fix
  • Feature / Enhancement
  • Documentation
  • Refactor
  • Chore (deps, CI, tooling)
  • Other (describe below)

🧪 Verification

Check Command Status
Lint suite make lint
Unit tests make test
Coverage ≥ 80% make coverage

✅ Checklist

  • Code formatted (make black isort pre-commit)
  • Tests added/updated for changes
  • Documentation updated (if applicable)
  • No secrets or credentials committed

📓 Notes (optional)

  • Removed the corresponding PerformanceHistoryParams unit tests from test_performance_schemas.py and cleaned up
    the now-unused pytest import
  • The getPaginationParams JavaScript function in admin.html/admin.js is unrelated (client-side pagination
    state) and was not touched
  • The auto-generated classes.svg diagram in docs/ still references these classes; it will update on next
    regeneration

@crivetimihai crivetimihai added the chore Linting, formatting, dependency hygiene, or project maintenance chores label Mar 20, 2026
@crivetimihai crivetimihai added this to the Release 1.1.0 milestone Mar 20, 2026
@crivetimihai crivetimihai added the COULD P3: Nice-to-have features with minimal impact if left out; included if time permits label Mar 20, 2026
@crivetimihai
Copy link
Copy Markdown
Member

Thanks @omorros. Clean dead code removal. LGTM.

…PerformanceHistoryParams schemas (IBM#3706)

Signed-off-by: Oriol Morros Vilaseca <OM368@student.aru.ac.uk>
@crivetimihai crivetimihai force-pushed the chore/remove-unused-pagination-schemas-3706 branch from ee00b3e to 1fa1300 Compare March 22, 2026 12:05
Copy link
Copy Markdown
Member

@crivetimihai crivetimihai left a comment

Choose a reason for hiding this comment

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

Rebased onto main (clean, no conflicts).

Verified all three removed classes (PaginationParams, ObservabilityQueryParams, PerformanceHistoryParams) are genuinely dead code:

  • PaginationParams: Not imported or used anywhere. Live pagination uses parse_pagination_params() in mcpgateway/utils/pagination.py, which correctly clamps against settings.pagination_max_page_size. The removed class had a hardcoded le=500 that would conflict with that configurable setting.
  • ObservabilityQueryParams: Not imported or used. The observability router declares query parameters inline with Query(...) in mcpgateway/routers/observability.py.
  • PerformanceHistoryParams: Not imported or used. performance_service.get_history() takes individual parameters directly.

Repo-wide search (all .py, .html, .js, .yaml, .md files) confirmed zero live references — only the auto-generated classes.svg diagram, which will self-correct on next regeneration.

Test file cleanup is correct: removed PerformanceHistoryParams tests, removed unused pytest import, re-sorted imports (isort-compliant). All 22 remaining tests pass.

No security, performance, or consistency concerns. LGTM.

@crivetimihai crivetimihai merged commit 9f31198 into IBM:main Mar 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Linting, formatting, dependency hygiene, or project maintenance chores COULD P3: Nice-to-have features with minimal impact if left out; included if time permits

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CHORE]: Remove unused Pydantic schemas in schemas.py (PaginationParams, ObservabilityQueryParams, PerformanceHistoryParams)

2 participants