fix: Resolve admin dashboard route conflict causing 500 error

CRITICAL production hotfix for v1.1.1-rc.2 addressing route conflict
that caused 500 errors on /admin/dashboard.

Changes:
- Renamed metrics dashboard route from /admin/dashboard to /admin/metrics-dashboard
- Added defensive imports for missing monitoring module with graceful fallback
- Updated version to 1.1.1-rc.2
- Updated CHANGELOG with hotfix details
- Created implementation report in docs/reports/

Testing:
- All 32 admin route tests pass (100%)
- 593/600 total tests pass (7 pre-existing failures unrelated to hotfix)
- Verified backward compatibility maintained

Design:
- Follows ADR-022 architecture decision
- Implements design from docs/design/hotfix-v1.1.1-rc2-route-conflict.md
- No breaking changes - all existing url_for() calls work correctly

Production Impact:
- Resolves 500 error at /admin/dashboard
- Notes dashboard remains at /admin/ (unchanged)
- Metrics dashboard now at /admin/metrics-dashboard
- Graceful degradation when monitoring module unavailable

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-25 21:08:42 -07:00
parent b46ab2264e
commit 2ca6ecc28f
4 changed files with 228 additions and 4 deletions

View File

@@ -269,5 +269,5 @@ def create_app(config=None):
# Package version (Semantic Versioning 2.0.0)
# See docs/standards/versioning-strategy.md for details
__version__ = "1.1.1"
__version__ = "1.1.1-rc.2"
__version_info__ = (1, 1, 1)

View File

@@ -215,7 +215,7 @@ def delete_note_submit(note_id: int):
return redirect(url_for("admin.dashboard"))
@bp.route("/dashboard")
@bp.route("/metrics-dashboard")
@require_auth
def metrics_dashboard():
"""
@@ -236,8 +236,18 @@ def metrics_dashboard():
Decorator: @require_auth
Template: templates/admin/metrics_dashboard.html
"""
from starpunk.database.pool import get_pool_stats
from starpunk.monitoring import get_metrics_stats
# Defensive imports with graceful degradation for missing modules
try:
from starpunk.database.pool import get_pool_stats
from starpunk.monitoring import get_metrics_stats
monitoring_available = True
except ImportError:
monitoring_available = False
# Provide fallback functions that return error messages
def get_pool_stats():
return {"error": "Database pool monitoring not available"}
def get_metrics_stats():
return {"error": "Monitoring module not implemented"}
# Get current metrics for initial page load
metrics_data = {}