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
537 changes: 537 additions & 0 deletions BUG_ANALYSIS_REPORT_2025_11_17.md

Large diffs are not rendered by default.

411 changes: 411 additions & 0 deletions BUG_FIX_SUMMARY_2025_11_17.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions blastdock/utils/cli_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import time
import functools
from typing import Any, Callable, Dict, List, Optional
from typing import Callable, List
import click

from .ux import get_ux_manager, TaskType, task_progress, status_spinner
Expand Down Expand Up @@ -171,7 +171,7 @@ def wrapper(*args, **kwargs):
f"Deployment completed: {project_name}",
[
f"Duration: {duration:.1f} seconds",
f"Status: Success",
"Status: Success",
f"Time: {time.strftime('%H:%M:%S')}",
],
)
Expand Down Expand Up @@ -226,7 +226,7 @@ def wrapper(*args, **kwargs):
]
)

ux.show_error(f"Template operation failed", error_msg, suggestions)
ux.show_error("Template operation failed", error_msg, suggestions)
raise

return wrapper
Expand Down
14 changes: 6 additions & 8 deletions blastdock/utils/docker_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@
Enhanced Docker utility functions for BlastDock
"""

import os
import time
import logging
from typing import Dict, List, Optional, Any, Iterator
from typing import Dict, List, Any
import docker
from docker.errors import DockerException, NotFound, APIError
from docker.errors import DockerException, NotFound

from .logging import get_logger
from ..docker.errors import DockerError, DockerNotFoundError, DockerNotRunningError
from ..docker.errors import DockerNotRunningError

logger = get_logger(__name__)

Expand All @@ -36,11 +33,12 @@ def client(self):
return self._client

def is_running(self) -> bool:
"""Check if Docker daemon is running"""
"""Check if Docker daemon is running (BUG-QUAL-001 FIX: Specific exceptions)"""
try:
self.client.ping()
return True
except Exception:
except (DockerException, ConnectionError, OSError) as e:
logger.debug(f"Docker daemon check failed: {e}")
return False

def is_docker_running(self) -> bool:
Expand Down
5 changes: 2 additions & 3 deletions blastdock/utils/error_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
from typing import Dict, List, Optional, Any, Tuple
from dataclasses import dataclass, asdict
from datetime import datetime
from pathlib import Path

from ..exceptions import BlastDockError, get_error_severity, ErrorSeverity
from ..constants import ERROR_MESSAGES
from ..exceptions import get_error_severity, ErrorSeverity
from .logging import get_logger


Expand Down Expand Up @@ -295,6 +293,7 @@ def check_http(url, timeout=5):
OSError,
ValueError,
) as e:
logger.debug(f"HTTP connectivity check failed for {url}: {e}") # BUG-QUAL-002 FIX
return False

return {
Expand Down
8 changes: 2 additions & 6 deletions blastdock/utils/error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@
"""

import sys
import os
from typing import Dict, Any, Optional, List
from rich.console import Console
from rich.panel import Panel
from rich.text import Text
from rich.table import Table
from rich.columns import Columns
from rich.tree import Tree

from ..exceptions import (
BlastDockError,
ErrorSeverity,
get_error_severity,
DockerNotAvailableError,
TraefikNotInstalledError,
TraefikNotRunningError,
Expand Down Expand Up @@ -162,7 +158,7 @@ def _display_error_message(self, error_context: ErrorContext, exception: Excepti
error_content.append("")

# Error message
error_content.append(f"[dim]Error Message:[/dim]")
error_content.append("[dim]Error Message:[/dim]")
error_content.append(f" {error_context.error_message}")

# Context information
Expand Down Expand Up @@ -313,7 +309,7 @@ def _generate_error_report(self, error_context: ErrorContext):
self.diagnostics.export_error_report(error_context, report_file)

console.print(f"\n[green]📄 Error report saved: {report_file}[/green]")
console.print(f"[dim]Include this file when reporting issues[/dim]")
console.print("[dim]Include this file when reporting issues[/dim]")

except Exception as e:
logger.error(f"Failed to generate error report: {e}")
Expand Down
18 changes: 6 additions & 12 deletions blastdock/utils/error_recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,10 @@
import subprocess
import time
import shutil
from typing import Dict, List, Optional, Tuple, Any
from typing import Dict, List, Optional, Any
from dataclasses import dataclass
from enum import Enum

from ..exceptions import (
BlastDockError,
DockerNotAvailableError,
TraefikNotInstalledError,
TraefikNotRunningError,
PortConflictError,
DirectoryNotWritableError,
InsufficientSpaceError,
ServiceUnavailableError,
)
from .logging import get_logger
from .error_diagnostics import ErrorContext

Expand Down Expand Up @@ -394,7 +384,9 @@ def _update_config(self, step: RecoveryStep) -> Dict[str, Any]:
shutil.copy2(config_file, backup_file)

# Apply updates (simplified implementation)
# In a real implementation, this would parse and update the config
# BUG-QUAL-002 FIX: Log that updates parameter exists but not yet implemented
# In a real implementation, this would parse and update the config with 'updates' dict
logger.debug(f"Config update requested for {config_file} with {len(updates)} updates")
return {"success": True, "message": f"Configuration updated: {config_file}"}

except Exception as e:
Expand Down Expand Up @@ -445,6 +437,7 @@ def _verify_recovery_success(self, plan: RecoveryPlan) -> bool:
subprocess.SubprocessError,
FileNotFoundError,
) as e:
logger.debug(f"Docker info check failed: {e}") # BUG-QUAL-002 FIX
return False

elif criterion == "traefik_running":
Expand All @@ -455,6 +448,7 @@ def _verify_recovery_success(self, plan: RecoveryPlan) -> bool:
if not manager.is_running():
return False
except Exception as e:
logger.debug(f"Traefik status check failed: {e}") # BUG-QUAL-002 FIX
return False

elif criterion == "ports_available":
Expand Down
7 changes: 1 addition & 6 deletions blastdock/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
from pathlib import Path

# Import cross-platform filesystem utilities
from .filesystem import (
get_deploys_dir,
get_project_path,
ensure_dir,
initialize_directories,
)
from .filesystem import ensure_dir


def load_yaml(file_path):
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 @@ -2,7 +2,6 @@
Template validation and enhancement system for BlastDock
"""

import os
import yaml
import re
from typing import Dict, List, Tuple, Optional, Any
Expand Down Expand Up @@ -69,7 +68,8 @@ def score(self) -> float:

errors = self.error_count
warnings = self.warning_count
total_checks = len(self.results)
# BUG-QUAL-002 FIX: Removed unused total_checks variable
# Total checks count not needed for current scoring algorithm

# Penalize errors heavily, warnings moderately
penalty = (errors * 20) + (warnings * 5)
Expand Down
11 changes: 4 additions & 7 deletions blastdock/utils/ux.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import time
import threading
from typing import Dict, List, Any, Optional, Callable, Union
from typing import Dict, List, Any, Optional
from dataclasses import dataclass, field
from contextlib import contextmanager
from enum import Enum
Expand All @@ -29,9 +29,7 @@
from rich.live import Live
from rich.layout import Layout
from rich.align import Align
from rich.rule import Rule
from rich.prompt import Prompt, Confirm, IntPrompt, FloatPrompt
from rich.tree import Tree
from rich.prompt import Prompt, Confirm, IntPrompt
from rich.columns import Columns
from rich.status import Status

Expand Down Expand Up @@ -555,7 +553,7 @@ def show_deployment_summary(
):
"""Show deployment completion summary"""
summary_text = Text()
summary_text.append(f"🚀 Deployment Complete: ", style="bold green")
summary_text.append("🚀 Deployment Complete: ", style="bold green")
summary_text.append(f"{project_name}\n", style="bold cyan")
summary_text.append(f"Duration: {duration:.1f} seconds\n\n", style="green")

Expand Down Expand Up @@ -610,12 +608,11 @@ def complete_service(self, service: str, success: bool = True):
if service in self.service_tasks:
task_id = self.service_tasks[service]

# BUG-QUAL-002 FIX: Removed unused style variable, description already has emoji
if success:
description = f"✅ {service} deployed"
style = "green"
else:
description = f"❌ {service} failed"
style = "red"

self.progress.update(task_id, completed=100, description=description)

Expand Down
Loading