Skip to content
Open
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
5 changes: 3 additions & 2 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ jobs:
python -m pip install --upgrade pip
pip install ansible pylint kubernetes prettytable \
requests passlib fastapi uvicorn sqlalchemy pytest \
httpx argon2-cffi pyyaml dependency-injector
httpx argon2-cffi pyyaml dependency-injector \
starlette pydantic

- name: Get changed Python files (excluding deleted)
id: changed-files
Expand Down Expand Up @@ -73,7 +74,7 @@ jobs:
# for proper import resolution
# This allows pylint to resolve both relative imports
# in build_stream and regular imports elsewhere
PYTHONPATH=.:./src/build_stream pylint $FILES \
PYTHONPATH=.:./src/build_stream:./src/utils/gui pylint $FILES \
--fail-under=${PYLINT_THRESHOLD}
else
echo "No files to lint after filtering."
Expand Down
2 changes: 2 additions & 0 deletions src/utils/gui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GUI module test/run artifacts
.pytest_cache/
403 changes: 403 additions & 0 deletions src/utils/gui/README.md

Large diffs are not rendered by default.

75 changes: 75 additions & 0 deletions src/utils/gui/backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# OS
.DS_Store
Thumbs.db

# Logs
*.log
23 changes: 23 additions & 0 deletions src/utils/gui/backend/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Config Editor Module (Refactored)

Production-ready configuration editor with proper structure,
dependency injection, and error handling.
"""

from .app import app

__all__ = ["app"]
34 changes: 34 additions & 0 deletions src/utils/gui/backend/api/v1/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""API v1 module."""

from .dependencies import (
get_settings_dependency,
get_adapter_policy_service,
get_catalog_editor_service,
get_wizard_generator_service,
get_local_repo_generator_service,
get_os_package_service,
get_software_config_service,
)

__all__ = [
"get_settings_dependency",
"get_adapter_policy_service",
"get_catalog_editor_service",
"get_wizard_generator_service",
"get_local_repo_generator_service",
"get_os_package_service",
"get_software_config_service",
]
125 changes: 125 additions & 0 deletions src/utils/gui/backend/api/v1/dependencies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Dependency injection setup for Config Editor Module

Provides FastAPI Depends functions for service injection following best practices.
"""

from fastapi import Depends, Request

# pylint: disable=relative-beyond-top-level
from ...config.settings import Settings, get_settings
from ...services.catalog_editor_service import CatalogEditorService
from ...services.adapter_policy_service import AdapterPolicyService
from ...services.wizard_generator_service import WizardGeneratorService
from ...services.local_repo_generator_service import LocalRepoGeneratorService
from ...services.os_package_service import OSPackageService
from ...services.software_config_service import SoftwareConfigService
# pylint: enable=relative-beyond-top-level


# Settings dependency
def get_settings_dependency() -> Settings:
"""FastAPI dependency for settings."""
return get_settings()


# Service dependencies
def get_adapter_policy_service(
settings: Settings = Depends(get_settings_dependency)
) -> AdapterPolicyService:
"""FastAPI dependency for AdapterPolicyService.

Args:
settings: Application settings

Returns:
AdapterPolicyService instance
"""
return AdapterPolicyService(settings=settings)


def get_catalog_editor_service(request: Request) -> CatalogEditorService:
"""FastAPI dependency for CatalogEditorService.

Args:
request: FastAPI Request object for accessing app.state

Returns:
CatalogEditorService instance
"""
return CatalogEditorService(app_state=request.app.state)


def get_wizard_generator_service(
settings: Settings = Depends(get_settings_dependency)
) -> WizardGeneratorService:
"""FastAPI dependency for WizardGeneratorService.

Args:
settings: Application settings

Returns:
WizardGeneratorService instance
"""
return WizardGeneratorService(settings=settings)


def get_local_repo_generator_service(
settings: Settings = Depends(get_settings_dependency)
) -> LocalRepoGeneratorService:
"""FastAPI dependency for LocalRepoGeneratorService.

Args:
settings: Application settings

Returns:
LocalRepoGeneratorService instance
"""
return LocalRepoGeneratorService(settings=settings)


def get_os_package_service(request: Request) -> OSPackageService:
"""FastAPI dependency for OSPackageService.

Args:
request: FastAPI Request object for accessing app.state

Returns:
OSPackageService instance (cached in app.state)
"""
if not hasattr(request.app.state, 'os_package_service'):
settings = get_settings()
request.app.state.os_package_service = OSPackageService(
config_dir=str(settings.base_input_dir / "config")
)
return request.app.state.os_package_service


def get_software_config_service(request: Request) -> SoftwareConfigService:
"""FastAPI dependency for SoftwareConfigService.

Args:
request: FastAPI Request object for accessing app.state

Returns:
SoftwareConfigService instance (cached in app.state)
"""
if not hasattr(request.app.state, 'software_config_service'):
settings = get_settings()
request.app.state.software_config_service = SoftwareConfigService(
config_dir=str(settings.base_input_dir)
)
return request.app.state.software_config_service
28 changes: 28 additions & 0 deletions src/utils/gui/backend/api/v1/routes/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""API v1 routes module."""

from .catalog_routes import router as catalog_router
from .wizard_routes import router as wizard_router
from .adapter_policy_routes import router as adapter_policy_router
from .catalog_editor_routes import router as catalog_editor_router
from .local_repo_routes import router as local_repo_router

__all__ = [
"catalog_router",
"wizard_router",
"adapter_policy_router",
"catalog_editor_router",
"local_repo_router"
]
Loading