feat: migrate Python monitoring components to TypeScript/Bun#23
Closed
NikolayS wants to merge 5 commits into
Closed
feat: migrate Python monitoring components to TypeScript/Bun#23NikolayS wants to merge 5 commits into
NikolayS wants to merge 5 commits into
Conversation
This commit migrates the Flask backend and reporter from Python to TypeScript/Bun, achieving feature parity with the original implementation. Changes: - Add cli/lib/metrics-server.ts: TypeScript port of Flask backend with endpoints for PGSS metrics, btree bloat, and table stats (CSV export) - Add cli/lib/reporter.ts: TypeScript port of reporter with support for generating A002-H002 check reports from Prometheus metrics - Add comprehensive tests for both components (69 tests for metrics-server and reporter with 95-98% coverage) - Add tests for Flask backend (52 tests, 99% coverage) - useful during transition period - Add Dockerfiles for both TypeScript components The TypeScript versions use the existing CLI patterns and can run with Bun.
Remove the Python Flask backend and reporter, keeping only the TypeScript implementations. The JSON schemas in reporter/schemas/ are retained as they define the report format contract used by CLI tests. Removed: - monitoring_flask_backend/ (Python Flask backend) - reporter/*.py (Python reporter code) - reporter/Dockerfile - tests/monitoring_flask_backend/ (Python tests) - tests/reporter/ (Python tests) Retained: - reporter/schemas/*.json (JSON schema files for report validation)
Explicitly set PGAI_API_KEY to empty string in isolatedEnv() helper to prevent API key leakage from parent environment during tests.
- Update .gitlab-ci.yml to use TypeScript Dockerfiles instead of Python - Remove reporter:tests job (Python tests no longer exist) - Replace monitoring-flask-backend with metrics-server in CI builds - Update docker-compose files to use metrics-server service - Update Helm templates: rename flask to metrics-server - Update Grafana dashboards to use metrics-server container name - Update documentation (README, CONTRIBUTING) for new service names - Add test isolation: afterEach cleanup in init.test.ts - Install curl in metrics-server Dockerfile for healthcheck
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.