Commit Graph
190 Commits
Author SHA1 Message Date
kevinveenbirkenbach ffd071c64e ci(openresty): share gh-action runtime and scope nginx/www volumes per CI run
- Mount /tmp/gh-action into the CI container so Docker can access run-scoped paths
- Scope OpenResty www and nginx volumes to GITHUB_RUN_ID when running in container
- Avoid leaking host /etc/nginx and /var/www into CI runs
- Remove redundant preflight

https://chatgpt.com/share/694918d0-53b4-800f-93a7-ec82946f3e24
2025-12-22 11:09:12 +01:00
kevinveenbirkenbach 1fdf5ae169 fix(openresty): make restart handler safe with include_tasks and assertions
- Move OpenResty restart logic into included handler tasks
- Use block/rescue to dump container logs on failure
- Tolerate restarting state during pre-flight validation
- Wait up to 2 minutes for container to reach running state
- Add explicit change detection for docker restart
- Enable assert mode in container deploy CLI

https://chatgpt.com/share/6948fa05-1970-800f-a010-59c8c3588713
2025-12-22 09:40:08 +01:00
kevinveenbirkenbach d9824bb506 test(deploy): mock backup authorized_keys in CI inventory
Create a dummy authorized_keys file inside the CI container inventory
after inventory generation and before ansible-playbook execution.

This prevents sys-bkp-provider-user from failing on missing file lookups
while keeping the role logic unchanged and the deploy tests deterministic.
2025-12-21 23:39:20 +01:00
kevinveenbirkenbach d2e88b6a8c feat(cli): eliminate runpy warnings for inventory + container entrypoints
* Remove legacy **main** re-export wrappers to avoid `runpy` "already in sys.modules" warnings
* Introduce `cli.deploy.container.command` as the stable implementation module
* Reduce `cli.deploy.container.__main__` to a minimal entrypoint delegating to `command.main`
* Re-export container helpers from package `__init__` without importing `__main__`
* Update unit tests to import/patch the new command module and keep CLI dispatch stable

https://chatgpt.com/share/69484a22-60dc-800f-a23d-068d7c45fe37
2025-12-21 20:27:26 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI d0a2890a08 Potential fix for code scanning alert no. 125: Use of the return value of a procedure
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-21 15:51:36 +01:00
kevinveenbirkenbach 1fe0a420fa fix(cli): avoid runpy warnings by moving logic into command modules
Stop importing __main__ from package __init__.py to prevent runpy RuntimeWarning when using `python -m`.

- Move CLI logic into command.py modules
- Keep __main__.py as thin wrappers
- Update unit tests to import command modules directly

https://chatgpt.com/share/6947fb8e-550c-800f-8323-e36f92cb5bba
2025-12-21 14:52:09 +01:00
kevinveenbirkenbach f9573460e9 fix(deploy): force local CLI build for invokable resolution
- Drop legacy compatibility wrapper in cli.meta.applications.invokable
- Resolve repository root explicitly via pathlib
- Ensure filter_plugins are importable outside Ansible
- Run invokable discovery with INSTALL_LOCAL_BUILD=1 in deploy tests
- Make deploy.sh fail fast when invokable resolution is unavailable
- Normalize sorting and exclusion logic (drv-* roles, locale-safe sort)
2025-12-21 14:27:21 +01:00
kevinveenbirkenbach 79785ea531 Merge branch 'master' of github.com:kevinveenbirkenbach/infinito-nexus 2025-12-21 11:53:55 +01:00
kevinveenbirkenbach ce19fed69a Increased verbosity 2025-12-21 11:52:04 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI d3020ce1a4 Potential fix for code scanning alert no. 120: Empty except
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-21 11:42:31 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI efe7429c8b Potential fix for code scanning alert no. 121: Empty except
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-21 11:41:45 +01:00
kevinveenbirkenbach e97186ffec Removed unused colorama library 2025-12-21 11:15:17 +01:00
kevinveenbirkenbach d381111150 Merge branch 'master' of github.com:kevinveenbirkenbach/infinito-nexus 2025-12-21 10:46:31 +01:00
kevinveenbirkenbach 6eb35ef450 refactor(cli): remove wildcard re-exports from __init__ wrappers
Replace `from .__main__ import *` with controlled re-exports based on `__all__`
to avoid namespace pollution and improve static analysis.

Public APIs remain unchanged while making re-export behavior explicit and
lint-friendly across all CLI subpackages.

https://chatgpt.com/share/6947c1d6-23d0-800f-9910-008ee277213c
2025-12-21 10:45:51 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI 98c001f419 Potential fix for code scanning alert no. 117: Use of a print statement at module level
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-21 10:37:39 +01:00
kevinveenbirkenbach e23187bccb refactor(deploy): remove skip-tests option from dedicated deploy
- Drop --skip-tests CLI flag and runner parameter
- Remove test phase execution from deploy workflow
- Update unit tests to match simplified deploy flow

https://chatgpt.com/share/69473607-22e4-800f-845b-a628677fb8b9
2025-12-21 00:49:21 +01:00
kevinveenbirkenbach 103659a534 refactor(deploy): modularize dedicated deploy CLI and fix make cwd issue
- Split dedicated deploy logic into focused modules (apps, modes, paths, proc, runner)
- Ensure all make targets run from the repository root via explicit cwd handling
- Fix "make: No rule to make target" errors caused by incorrect working directory
- Slim down __main__ to a thin CLI entrypoint
- Rework unit tests into one file per module and expand coverage

https://chatgpt.com/share/69472632-9740-800f-962c-bcb4474963d6
2025-12-20 23:41:41 +01:00
kevinveenbirkenbach 378d41e9fb Optimized path 2025-12-20 23:08:58 +01:00
kevinveenbirkenbach 59a68ff940 fix(inventory): run credentials generator via module instead of file path
Switch credentials generation to `python -m cli.create.credentials` to avoid
fragile file path execution after package migration and ensure the correct
interpreter and environment are used.

https://chatgpt.com/share/69471879-cd18-800f-a390-efa23d9d1813
2025-12-20 22:43:15 +01:00
kevinveenbirkenbach a354992f27 refactor(create-inventory): modularize CLI, stabilize path handling, add unit tests
- Split create-inventory logic into focused modules (cli, project, filters, host_vars, credentials, etc.)
- Replace fragile path construction with python -m module execution
- Add robust project root detection
- Centralize password generation
- Improve test coverage with per-module unit tests
- Preserve existing inventory and host_vars behavior

https://chatgpt.com/share/69471157-79c0-800f-8dec-25c0f8e38f03
2025-12-20 22:12:44 +01:00
kevinveenbirkenbach 3da6e3a23e refactor(cli): modularize dispatcher and improve command discovery
https://chatgpt.com/share/6947052d-76fc-800f-9db3-98de6894ceb0
2025-12-20 21:20:47 +01:00
kevinveenbirkenbach 23ce1e50b2 fix(inventory): correct project root detection to avoid duplicate cli path
Fix detect_project_root() to return the actual repository root instead of the
cli directory. This prevents incorrect path construction like `cli/cli/...`
when invoking build inventory scripts.

https://chatgpt.com/share/6946fe09-8730-800f-8eca-2503df61d9ae
2025-12-20 20:50:26 +01:00
kevinveenbirkenbach 20d03575e7 fix(deploy): mount project root instead of cli/deploy in CI container
https://chatgpt.com/share/6946f9a9-bf94-800f-adab-f1baf49e1e12
2025-12-20 20:37:10 +01:00
kevinveenbirkenbach 2e6d973839 fix(build): align CLI module invocations and stabilize include generation
- Switch Makefile targets to direct module execution (cli.build.*)
- Remove obsolete flags and normalize tree invocation
- Minor formatting cleanups for readability and test stability
- Keep inventory and include paths consistent after package layout migration

https://chatgpt.com/share/6946eac4-eb48-800f-becb-f08420ab03a6
2025-12-20 19:28:14 +01:00
kevinveenbirkenbach a8a4948e39 **fix(cli): restore test patchability after package migration**
* Reintroduced proxy wrappers in cli subcommands to keep unit/integration tests patchable
* Synced test monkeypatches with **main** implementations (tree, deploy, fix, users)
* Fixed ROLES_DIR resolution to repo root after package refactor
* Re-exported private helpers required by tests
* Made cli/setup/users script-safe when executed directly

https://chatgpt.com/share/6946e285-2658-800f-b8f3-b68d66b91be9
2025-12-20 18:52:56 +01:00
kevinveenbirkenbach bb8c05a653 Replaced tree.py by tree/__main__.py 2025-12-20 18:38:52 +01:00
kevinveenbirkenbach 102735dba4 Renamed inventory.py to inventory/__main__.py 2025-12-20 18:30:20 +01:00
kevinveenbirkenbach 993ed8addd Renamed Makefile *.py includes 2025-12-20 18:28:37 +01:00
kevinveenbirkenbach 5c6afd2cf6 p2pkg executed 2025-12-20 18:25:37 +01:00
kevinveenbirkenbach 0ea828ab6e cleanup: unify git cleanup, simplify deploy flow, fix dockerignore
- Remove clean-keep-logs target and enforce git-repo guard in Makefile
- Always use `make clean` during deploy cleanup with live output
- Add shared subprocess runner for consistent stdout/stderr handling
- Align unit tests with simplified cleanup semantics
- Fix .dockerignore to ignore build artifacts and Ruff cache correctly

https://chatgpt.com/share/6945784a-daac-800f-bc02-d7e8d3087376
2025-12-19 17:07:33 +01:00
kevinveenbirkenbach f775ae9dfa ci(deploy): run deploy tests with --missing and docker-based invokable excludes 2025-12-19 16:07:59 +01:00
kevinveenbirkenbach aea82e8080 ci(deploy): use host Docker socket and local infinito image for deploy tests
- Install Docker CLI in the Docker image (distro-aware)
- Switch deploy container runner from Docker-in-Docker to host /var/run/docker.sock
  with clearer diagnostics when docker/permissions are missing
- Rewrite scripts/tests/deploy.sh to build a local infinito-<distro> image via Make
  and run deployment strictly against that local tag (no pkgmgr/GHCR pulls)

https://chatgpt.com/share/694513c7-daec-800f-a9b5-c8fb25274958
2025-12-19 09:58:43 +01:00
kevinveenbirkenbach 7c0c1321d5 Fix Hadolint code scanning identity and apply formatting cleanups
https://chatgpt.com/share/694420ac-5d70-800f-94b8-71549893936e
2025-12-18 16:41:25 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI aa586e0e2c Potential fix for code scanning alert no. 43: Unnecessary lambda
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-18 16:28:02 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI 0d9ad719f7 Potential fix for code scanning alert no. 66: Empty except
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-18 16:27:37 +01:00
kevinveenbirkenbach a38f36837f style: reformat code for readability and lint compliance 2025-12-18 14:08:01 +01:00
kevinveenbirkenbach 9047285e7a Fix CodeQL warning by avoiding implicit string concatenation in sh -c command
https://chatgpt.com/share/6943f9b0-7dd4-800f-9259-da3c9c4bf156
2025-12-18 13:54:55 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI 69b1df72f8 Potential fix for code scanning alert no. 53: Explicit returns mixed with implicit (fall through) returns
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-18 13:10:19 +01:00
kevinveenbirkenbach cbd11530f8 Merge pull request #19 from kevinveenbirkenbach/alert-autofix-40
Potential fix for code scanning alert no. 40: Jinja2 templating with autoescape=False
2025-12-18 12:46:53 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI 1da7a25474 Potential fix for code scanning alert no. 79: File is not always closed
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-18 12:45:53 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI 18ae1b2838 Potential fix for code scanning alert no. 40: Jinja2 templating with autoescape=False
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-18 12:42:33 +01:00
kevinveenbirkenbach 39b52f4449 fix(security): create vault password file with restrictive permissions
https://chatgpt.com/share/6943d45b-fc7c-800f-8742-413bde1b1516
2025-12-18 11:15:38 +01:00
kevinveenbirkenbach dc846b0672 refactor(cli): move main entrypoint to cli package and standardize execution
- Move main.py to cli/__main__.py and expose via console script
- Switch Makefile execution to `python -m cli`
- Remove fragile Docker symlink to main.py
- Ensure infinito console script is available via venv PATH
- Update tests and documentation to reflect new CLI structure
- Improve logging location and permissions (XDG_STATE_HOME)
- Handle Ctrl+C gracefully with POSIX-compliant exit code (130)

https://chatgpt.com/share/6942f140-fb8c-800f-a13a-641ebf1c644e
2025-12-17 19:06:49 +01:00
kevinveenbirkenbach 7123841fb4 style: apply ruff autoformat 2025-12-17 16:37:21 +01:00
kevinveenbirkenbach 324f9bebf4 fix(lint): resolve Ruff E402 import-order violations
Move all module-level imports to the top of affected files and remove
late imports after sys.path manipulation or runtime code.

Also normalize test imports to use package paths instead of ad-hoc
sys.path hacks, aligning tests with the new layered architecture.

No functional changes intended.

https://chatgpt.com/share/6942c6af-bd10-800f-886a-0ed8731675ee
2025-12-17 16:05:15 +01:00
kevinveenbirkenbach 9e6256dc6e lint(test,core): remove misplaced test code and fix undefined names
- Import subprocess where used to fix F821 in cli/setup/applications
- Remove accidental test methods from RoleDependencyResolver implementation
- Remove invalid and non-discoverable test functions from test_role_dependency_resolver
- Eliminate test code that was never executed due to wrong scope/indentation
- Restore clear separation between production code and unit tests

https://chatgpt.com/share/6942c3ec-8a10-800f-9a15-c319f5e93089
2025-12-17 15:53:25 +01:00
kevinveenbirkenbach 176c8799ce lint(ruff): fix E402 and related import issues
- Fix E402 by removing sys.path hacks and ensuring imports are at module top level
- Replace ad-hoc imports with proper package imports (filter_plugins, lookup_plugins, module_utils, cli)
- Make lookup plugins importable via package paths (e.g. lookup_plugins.application_gid)
- Clean up test imports to rely on installed package layout instead of sys.path manipulation
- Partially fix F821 caused by missing/invalid imports

This establishes a consistent, ruff-compliant import architecture across CLI, filters, plugins, and tests.
2025-12-17 14:36:29 +01:00
kevinveenbirkenbach 73f7c00acd Solved ruff E741 2025-12-17 13:54:51 +01:00
kevinveenbirkenbach 14a0268ec3 Solved ruff E741 2025-12-17 13:51:03 +01:00
kevinveenbirkenbach 9db66f6f98 Ruff autofix 2025-12-17 12:56:47 +01:00