Skip to content

refactor(backend): decompose _generate_dynamic_inventory into 5 helpers (#2823)#2945

Merged
mrveiss merged 1 commit intoDev_new_guifrom
fix/issue-2823
Mar 30, 2026
Merged

refactor(backend): decompose _generate_dynamic_inventory into 5 helpers (#2823)#2945
mrveiss merged 1 commit intoDev_new_guifrom
fix/issue-2823

Conversation

@mrveiss
Copy link
Copy Markdown
Owner

@mrveiss mrveiss commented Mar 30, 2026

Summary

Extract Method refactoring of 153-line function into 5 focused helpers:

  • _build_host_entries (27 lines), _apply_role_host_vars (30), _apply_colocation_vars (25), _build_inventory_dict (29), _fetch_inventory_data (44)
  • Main function reduced from 153 to 25 lines
  • Zero behavior change — pure structural refactoring

Closes #2823

🤖 Generated with Claude Code

…rs (#2823)

Extract Method refactoring — zero behavior change:
- _build_host_entries: host dict from DB nodes (27 lines)
- _apply_role_host_vars: stamp roles/deps onto hosts (30 lines)
- _apply_colocation_vars: frontend/backend co-location (25 lines)
- _build_inventory_dict: assemble top-level structure (29 lines)
- _fetch_inventory_data: async DB queries + sync helpers (44 lines)

Main function reduced from 153 to 25 lines.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

⚠️ SSOT Configuration Compliance: Violations Found

Metric Count
Total Violations 3
SSOT Violations (high priority) 2
Other Violations 1

⚠️ 2 values have SSOT config equivalents!

These should be replaced with SSOT config imports:

Python:

from src.config.ssot_config import config
# Use: config.vm.main, config.port.backend, config.backend_url

TypeScript:

import config from '@/config/ssot-config'
// Use: config.vm.main, config.port.backend, config.backendUrl

📖 See SSOT_CONFIG_GUIDE.md for documentation.

@mrveiss mrveiss merged commit ec9be09 into Dev_new_gui Mar 30, 2026
3 of 5 checks passed
@mrveiss mrveiss deleted the fix/issue-2823 branch March 30, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant