Skip to content

Commit 42d3f2f

Browse files
committed
Services Hot Fix
1 parent 7fde038 commit 42d3f2f

3 files changed

Lines changed: 36 additions & 23 deletions

File tree

Makefile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,22 @@ test-template-worker: ## Test template with worker component
269269
@echo "✅ Worker template test completed successfully!"
270270
@echo " Test project available in ../test-worker-stack/"
271271

272+
test-template-auth: ## Test template with auth service
273+
@echo "🔐 Testing auth service template..."
274+
@chmod -R +w ../test-auth-stack 2>/dev/null || true
275+
@rm -rf ../test-auth-stack
276+
@env -u VIRTUAL_ENV uv run aegis init test-auth-stack --services auth --output-dir .. --no-interactive --force --yes
277+
@echo "📦 Installing dependencies and CLI..."
278+
@cd ../test-auth-stack && chmod -R +w .venv 2>/dev/null || true && rm -rf .venv && env -u VIRTUAL_ENV uv sync --extra dev --extra docs
279+
@cd ../test-auth-stack && env -u VIRTUAL_ENV uv pip install -e .
280+
@echo "🔍 Running validation checks..."
281+
@cd ../test-auth-stack && env -u VIRTUAL_ENV make check
282+
@echo "🧪 Testing CLI script installation..."
283+
@cd ../test-auth-stack && env -u VIRTUAL_ENV uv run test-auth-stack --help >/dev/null && echo "✅ CLI script 'test-auth-stack --help' works" || echo "⚠️ CLI script test failed"
284+
@cd ../test-auth-stack && env -u VIRTUAL_ENV uv run test-auth-stack health status --help >/dev/null && echo "✅ Health commands available" || echo "⚠️ Health command test failed"
285+
@echo "✅ Auth service template test completed successfully!"
286+
@echo " Test project available in ../test-auth-stack/"
287+
272288
test-template-full: ## Test template with all components (worker + scheduler + database)
273289
@echo "🌟 Testing full component template..."
274290
@chmod -R +w ../test-full-stack 2>/dev/null || true
@@ -300,7 +316,7 @@ endif
300316
@echo "✅ $(COMPONENT) component generated successfully in ../test-$(COMPONENT)-quick/"
301317
@echo " Run 'cd ../test-$(COMPONENT)-quick && make check' to validate"
302318

303-
.PHONY: test lint fix format typecheck check install clean docs-serve docs-build cli-test redis-start redis-stop redis-cli redis-logs redis-stats redis-reset redis-queues redis-workers redis-failed redis-monitor redis-info test-template-quick test-template test-template-with-components test-template-database test-template-worker test-template-full test-component-quick test-stacks test-stacks-build test-stacks-runtime test-stacks-full clean-test-projects help
319+
.PHONY: test lint fix format typecheck check install clean docs-serve docs-build cli-test redis-start redis-stop redis-cli redis-logs redis-stats redis-reset redis-queues redis-workers redis-failed redis-monitor redis-info test-template-quick test-template test-template-with-components test-template-database test-template-worker test-template-auth test-template-full test-component-quick test-stacks test-stacks-build test-stacks-runtime test-stacks-full clean-test-projects help
304320

305321
# Default target
306322
.DEFAULT_GOAL := help

aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/frontend/dashboard/cards/__init__.py.j2

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""Dashboard component cards."""
22

3-
from .ai_card import AICard
4-
from .auth_card import AuthCard
53
from .fastapi_card import FastAPICard
64
from .flet_card import FletCard
7-
from .payment_card import PaymentCard
5+
{%- if cookiecutter.include_auth == "yes" %}
6+
from .auth_card import AuthCard
87
from .services_card import ServicesCard
8+
{%- endif %}
99
{%- if cookiecutter.include_database == "yes" %}
1010
from .database_card import DatabaseCard
1111
{%- endif %}
@@ -20,12 +20,12 @@ from .worker_card import WorkerCard
2020
{%- endif %}
2121

2222
__all__ = [
23-
"AICard",
24-
"AuthCard",
2523
"FastAPICard",
2624
"FletCard",
27-
"PaymentCard",
25+
{%- if cookiecutter.include_auth == "yes" %}
26+
"AuthCard",
2827
"ServicesCard",
28+
{%- endif %}
2929
{%- if cookiecutter.include_database == "yes" %}
3030
"DatabaseCard",
3131
{%- endif %}

aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/frontend/main.py.j2

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,13 @@ import flet as ft
88

99
from app.core.log import logger
1010
from app.services.system.models import ComponentStatus, ComponentStatusType
11-
12-
# Constants for health system grouping
13-
COMPONENTS_GROUP_KEY = "components"
14-
SERVICES_GROUP_KEY = "services"
15-
SERVICE_PREFIX = "service_"
16-
1711
from .dashboard.cards import (
18-
AICard,
19-
AuthCard,
2012
FastAPICard,
2113
FletCard,
22-
PaymentCard,
14+
{%- if cookiecutter.include_auth == "yes" %}
15+
AuthCard,
2316
ServicesCard,
17+
{%- endif %}
2418
{%- if cookiecutter.include_database == "yes" %}
2519
DatabaseCard,
2620
{%- endif %}
@@ -37,6 +31,11 @@ from .dashboard.cards import (
3731
from .dashboard.cards.card_utils import create_health_status_indicator
3832
from .theme import ThemeManager
3933

34+
# Constants for health system grouping
35+
COMPONENTS_GROUP_KEY = "components"
36+
SERVICES_GROUP_KEY = "services"
37+
SERVICE_PREFIX = "service_"
38+
4039
# Use simple filenames - Flet should auto-resolve from assets_dir
4140
DEFAULT_LOGO_PATH = "aegis-manifesto.png"
4241
DEFAULT_DARK_LOGO_PATH = "aegis-manifesto-dark.png"
@@ -245,18 +244,16 @@ def create_frontend_app() -> Callable[[ft.Page], Awaitable[None]]:
245244
elif component_name == "scheduler":
246245
return SchedulerCard(component_data).build()
247246
{%- endif %}
247+
{%- if cookiecutter.include_auth == "yes" %}
248248
elif component_name == "services":
249249
return ServicesCard(component_data).build()
250250
# Individual service cards
251251
elif component_name == "service_auth":
252252
return AuthCard(component_data).build()
253-
elif component_name == "service_ai":
254-
return AICard(component_data).build()
255-
elif component_name == "service_payment":
256-
return PaymentCard(component_data).build()
257253
elif component_name.startswith("service_"):
258254
# For other services, use generic ServicesCard for now
259255
return ServicesCard(component_data).build()
256+
{%- endif %}
260257
else:
261258
# Fallback for unknown components - should not happen in practice
262259
logger.warning(f"Unknown component type: {component_name}")
@@ -365,9 +362,9 @@ def create_frontend_app() -> Callable[[ft.Page], Awaitable[None]]:
365362
for service_name, service_data in comp_data[
366363
"sub_components"
367364
].items():
368-
components[f"{SERVICE_PREFIX}{service_name}"] = convert_component(
369-
service_data
370-
)
365+
components[
366+
f"{SERVICE_PREFIX}{service_name}"
367+
] = convert_component(service_data)
371368
else:
372369
# For other groupings, add as-is
373370
components[name] = convert_component(comp_data)

0 commit comments

Comments
 (0)