Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
433 changes: 433 additions & 0 deletions BUG_ANALYSIS_COMPREHENSIVE_2025_11_18.md

Large diffs are not rendered by default.

514 changes: 514 additions & 0 deletions COMPREHENSIVE_BUG_FIX_REPORT_2025_11_18_SESSION_2.md

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions blastdock/cli/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def check(verbose, save_report):
console=console,
transient=True,
) as progress:
task = progress.add_task("Running diagnostics...", total=None)
# Task ID not needed for single-task progress display
_task = progress.add_task("Running diagnostics...", total=None) # noqa: F841

# Run all diagnostic checks
results = diagnostics_service.run_diagnostics()
Expand Down Expand Up @@ -143,7 +144,8 @@ def health(auto_fix, dry_run):
console=console,
transient=True,
) as progress:
task = progress.add_task("Checking system health...", total=None)
# Task ID not needed for single-task progress display
_task = progress.add_task("Checking system health...", total=None) # noqa: F841

# Run health checks
health_results = diagnostics_service.run_diagnostics()
Expand Down Expand Up @@ -256,7 +258,8 @@ def info():
console=console,
transient=True,
) as progress:
task = progress.add_task("Checking components...", total=None)
# Task ID not needed for single-task progress display
_task = progress.add_task("Checking components...", total=None) # noqa: F841
component_results = diagnostics_service.run_diagnostics()

_display_diagnostic_results(component_results, verbose=False)
Expand Down
6 changes: 4 additions & 2 deletions blastdock/cli/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,15 +457,17 @@ def report(check_thresholds, export_report):
console.print("[bold red]🚨 Threshold Violations:[/bold red]")
for violation in threshold_results["violations"]:
console.print(
f" • {violation['operation']}: {violation['type']} = {violation['value']:.1f} (threshold: {violation['threshold']})"
f" • {violation['operation']}: {violation['type']} = "
f"{violation['value']:.1f} (threshold: {violation['threshold']})"
)

# Show warnings
if threshold_results["warnings"]:
console.print("\\n[bold yellow]⚠️ Performance Warnings:[/bold yellow]")
for warning in threshold_results["warnings"]:
console.print(
f" • {warning['operation']}: {warning['type']} = {warning['value']:.1f} (threshold: {warning['threshold']})"
f" • {warning['operation']}: {warning['type']} = "
f"{warning['value']:.1f} (threshold: {warning['threshold']})"
)

# Generate summary report
Expand Down
9 changes: 6 additions & 3 deletions blastdock/cli/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ def scan_template(template_path, detailed):
console=console,
transient=True,
) as progress:
task = progress.add_task("Scanning template...", total=None)
# Task ID not needed for single-task progress display
_task = progress.add_task("Scanning template...", total=None) # noqa: F841
result = scanner.scan_template(template_path)

if not result.get("accessible"):
Expand Down Expand Up @@ -151,7 +152,8 @@ def scan_container(container_name):
console=console,
transient=True,
) as progress:
task = progress.add_task("Scanning container...", total=None)
# Task ID not needed for single-task progress display
_task = progress.add_task("Scanning container...", total=None) # noqa: F841
result = checker.check_container_security(container_name)

if not result.get("accessible"):
Expand Down Expand Up @@ -180,7 +182,8 @@ def scan_files(directory_path, fix):
console=console,
transient=True,
) as progress:
task = progress.add_task("Scanning files...", total=None)
# Task ID not needed for single-task progress display
_task = progress.add_task("Scanning files...", total=None) # noqa: F841
result = file_ops.scan_directory_security(directory_path)

if not result.get("exists"):
Expand Down
3 changes: 2 additions & 1 deletion blastdock/config/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ def _check_legacy_config(self) -> Optional[Dict[str, Any]]:
migrated_config = self._migrate_legacy_config(legacy_config)

# Create backup of legacy config
backup_name = (
# Backup name generated for documentation purposes
_backup_name = ( # noqa: F841
f"legacy_migration_{datetime.now().strftime('%Y%m%d_%H%M%S')}"
)
self.backup_manager.create_backup(
Expand Down
3 changes: 2 additions & 1 deletion blastdock/core/template_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def _validate_template_name(self, template_name):
# Validate against allowed character pattern
if not self.TEMPLATE_NAME_PATTERN.match(template_name):
raise TemplateValidationError(
f"Template name contains invalid characters. Only alphanumeric, hyphens, and underscores allowed: {template_name}"
f"Template name contains invalid characters. "
f"Only alphanumeric, hyphens, and underscores allowed: {template_name}"
)

def list_templates(self):
Expand Down
4 changes: 3 additions & 1 deletion blastdock/docker/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ def _run_command(

except subprocess.TimeoutExpired as e:
if attempt == self.max_retries - 1:
self.logger.error(f"Command timed out after {timeout}s: {safe_cmd}")
self.logger.error(
f"Command timed out after {timeout}s: {safe_cmd}. Error: {e}"
)
raise DockerError(
f"Docker command timed out after {timeout} seconds",
f"Command: {safe_cmd}",
Expand Down
3 changes: 2 additions & 1 deletion blastdock/docker/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def validate_compose_file(self, compose_file: str) -> Dict[str, Any]:
# Additional validations
try:
# Test compose file syntax with docker-compose config
result = self.docker_client.execute_compose_command(
# Result not used - command executed for validation only
_result = self.docker_client.execute_compose_command( # noqa: F841
["config", "--quiet"],
compose_file=compose_file,
cwd=os.path.dirname(compose_file),
Expand Down
5 changes: 4 additions & 1 deletion blastdock/docker/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,10 @@ def get_health_summary(self) -> Dict[str, Any]:
continue

# Check container health
running_containers = [c for c in containers if c.get("State") == "running"]
# Filter for running containers (reserved for future health checks)
_running_containers = [ # noqa: F841
c for c in containers if c.get("State") == "running"
]
summary["containers"] = [
{
"id": c.get("ID", "")[:12],
Expand Down
5 changes: 4 additions & 1 deletion blastdock/marketplace/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ def install_template(
installed_version = self.get_installed_version(marketplace_template.name)
return {
"success": False,
"error": f"Template '{marketplace_template.name}' already installed (v{installed_version}). Use --force to reinstall.",
"error": (
f"Template '{marketplace_template.name}' already installed "
f"(v{installed_version}). Use --force to reinstall."
),
}

# Download template package
Expand Down
4 changes: 2 additions & 2 deletions blastdock/marketplace/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ def import_from_directory(
with open(metadata_file, "r") as f:
metadata = yaml.safe_load(f) or {}

# Package the template
_package = self.package_template(
# Package the template (result not used - packaged for side effect)
_package = self.package_template( # noqa: F841
template_dir, template_id, version, metadata
)

Expand Down
20 changes: 16 additions & 4 deletions blastdock/monitoring/alert_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ def _initialize_default_rules(self):
duration_seconds=300,
annotations={
"summary": "High CPU usage detected",
"description": "Container {{ $labels.container }} in project {{ $labels.project }} has high CPU usage ({{ $value }}%)",
"description": (
"Container {{ $labels.container }} in project {{ $labels.project }} "
"has high CPU usage ({{ $value }}%)"
),
},
),
AlertRule(
Expand All @@ -146,7 +149,10 @@ def _initialize_default_rules(self):
duration_seconds=180,
annotations={
"summary": "Critical CPU usage detected",
"description": "Container {{ $labels.container }} in project {{ $labels.project }} has critical CPU usage ({{ $value }}%)",
"description": (
"Container {{ $labels.container }} in project {{ $labels.project }} "
"has critical CPU usage ({{ $value }}%)"
),
},
),
AlertRule(
Expand All @@ -159,7 +165,10 @@ def _initialize_default_rules(self):
duration_seconds=300,
annotations={
"summary": "High memory usage detected",
"description": "Container {{ $labels.container }} in project {{ $labels.project }} has high memory usage ({{ $value }}%)",
"description": (
"Container {{ $labels.container }} in project {{ $labels.project }} "
"has high memory usage ({{ $value }}%)"
),
},
),
AlertRule(
Expand All @@ -185,7 +194,10 @@ def _initialize_default_rules(self):
duration_seconds=600,
annotations={
"summary": "Health checks failing",
"description": "Service {{ $labels.service }} in project {{ $labels.project }} has low health check success rate ({{ $value }}%)",
"description": (
"Service {{ $labels.service }} in project {{ $labels.project }} "
"has low health check success rate ({{ $value }}%)"
),
},
),
AlertRule(
Expand Down
3 changes: 2 additions & 1 deletion blastdock/monitoring/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,10 @@ def _create_system_alerts_panel(
def show_live_monitoring(self, project_name: str, refresh_interval: float = 5.0):
"""Show live monitoring dashboard with auto-refresh"""
try:
# Live context manager handles display updates automatically
with Live(
console=self.console, refresh_per_second=1 / refresh_interval
) as _live:
) as _live: # noqa: F841
while True:
# Create fresh dashboard
self.show_project_overview(project_name)
Expand Down
4 changes: 2 additions & 2 deletions blastdock/utils/template_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,8 @@ def generate_validation_report(self, analyses: Dict[str, TemplateAnalysis]) -> s
for analysis in analyses.values():
traefik_counts[analysis.traefik_compatibility] += 1

# Calculate average score
_avg_score = (
# Calculate average score (reserved for future use in report)
_avg_score = ( # noqa: F841
sum(a.score for a in analyses.values()) / total_templates
if total_templates > 0
else 0
Expand Down
Loading