Commit Graph

202 Commits

Author SHA1 Message Date
Kevin Veen-Birkenbach
22b65f83d3 Add changelog CLI command and tests (see ChatGPT conversation 2025-12-08) https://chatgpt.com/share/69370663-4eb8-800f-bba9-4f5c42682450 2025-12-08 18:11:39 +01:00
Kevin Veen-Birkenbach
0b96270f78 Refactor pkgmgr CLI into modular core and add E2E tests for config/release/make/tools (see ChatGPT conversation 2025-12-08 https://chatgpt.com/share/6936ffa5-4868-800f-ab63-6e367093adce) 2025-12-08 17:41:27 +01:00
Kevin Veen-Birkenbach
ccf3b1aa3c Fix RPM installation for Fedora/CentOS by enforcing offline local install
This commit improves the robustness of the RPM installation step for
Fedora and CentOS by disabling all remote repositories when installing
the locally built package-manager RPM. This prevents failures caused
by flaky or mismatched upstream metadata (e.g., BaseOS repomd.xml
checksum errors). The installer now:

- uses 'dnf5/dnf/yum --disablerepo=*' for fully offline installation
- falls back to 'rpm -i --nodeps' if the package manager fails
- ensures deterministic CI builds without remote repo dependencies

Reference: Conversation with ChatGPT (2025-12-08). https://chatgpt.com/share/6936ff1e-4adc-800f-b508-b5b90c0ef635
2025-12-08 17:39:21 +01:00
Kevin Veen-Birkenbach
0933e73e1c Extend 'pkgmgr version' command with multi-source version detection (pyproject, flake, PKGBUILD, debian, spec, AnsibleGalaxy), implement SemVer parsing, consistency warnings, full E2E + unit test coverage.
Ref: https://chatgpt.com/share/6936ef7e-ad5c-800f-96b2-e5d0f32b39ca
2025-12-08 16:32:38 +01:00
Kevin Veen-Birkenbach
a5aaacc8d0 Refactor Docker-based packaging and delegate Nix installation to system hooks (see ChatGPT conversation: https://chatgpt.com/share/6936db94-ff30-800f-9b50-86a4b45c44bf) 2025-12-08 15:08:42 +01:00
Kevin Veen-Birkenbach
ef23e14ae4 Add Git utilities, semantic version helpers, and unit tests
Ref: https://chatgpt.com/share/6936c64b-ae80-800f-ae7e-ed0a692ec3fc
2025-12-08 13:36:40 +01:00
Kevin Veen-Birkenbach
e6d041553b Fix Makefile build-arch target to use a single shell and correctly pass BASE_IMAGE_arch to docker build.
Reference: https://chatgpt.com/share/6936c5f9-5064-800f-8597-1cf3ccf7f42b
2025-12-08 13:35:20 +01:00
Kevin Veen-Birkenbach
15f3c1bcba Refine command resolution and symlink creation (see ChatGPT conversation: https://chatgpt.com/share/6936be2d-952c-800f-a1cd-7ce5438014ff) 2025-12-08 13:02:05 +01:00
Kevin Veen-Birkenbach
f641b95d81 Add recursive capability resolver, integration tests, and GitHub workflow (see: https://chatgpt.com/share/6936abc9-87cc-800f-97e6-f7429fb1a910) 2025-12-08 11:43:39 +01:00
Kevin Veen-Birkenbach
775c30149c Improve MakefileInstaller: only run 'make install' if an install target exists
- Added parsing of Makefile to detect real 'install' target
- Added safe fallback when Makefile cannot be read
- Added informative skip message when install target is missing
- Updated unit tests to cover: install present, install missing, file read
- Removed circular self-import causing test import failures

Conversation reference: https://chatgpt.com/share/6936a2bf-6aa4-800f-a1bc-7c8eac66bc18
2025-12-08 11:05:08 +01:00
Kevin Veen-Birkenbach
26ba3c50cd Improve installer debugging and enhance E2E test diagnostics
- Added rich error reporting to install_repos() for clearer installer failure context
  (repository identifier, repo directory, installer name, exit code).
- Updated E2E test 'install_all_shallow' to show additional diagnostics,
  including Nix profile dumps and contextual SystemExit handling.
- Removed outdated/deactivated test file.
- New test now mirrors the robust debugging flow of the pkgmgr-only test.

See conversation for full context:
https://chatgpt.com/share/6936241b-52ec-800f-9859-1734a581c002
2025-12-08 02:05:03 +01:00
Kevin Veen-Birkenbach
9648be4a26 Refactor test pipeline: introduce separate unit/e2e workflows, fix Dockerfile, update Makefile test targets, and move integration tests to tests/e2e.
Conversation reference:
https://chatgpt.com/share/69361e70-4d74-800f-acd7-51548ac3fa37
2025-12-08 01:40:36 +01:00
Kevin Veen-Birkenbach
b124166205 Fix Nix devShell tests for multi-distro Docker images
- Enable test matrix for arch, debian, ubuntu, fedora, centos
- Mount /nix Docker volume only on Arch so image-local Nix installs remain visible on other distros
- Keep shared Nix cache volume for all distros

Details: https://chatgpt.com/share/69361196-e950-800f-ad3d-670156337b7e
2025-12-08 00:49:36 +01:00
Kevin Veen-Birkenbach
0286cb44e0 Refactor multi-distro Dockerfile and Makefile:
- Add dynamic BASE_IMAGE selection via ARG for Arch, Debian, Ubuntu, Fedora, CentOS
- Introduce conditional package installation and unified Nix installer logic
- Implement single-user Nix install without build-users-group for Debian/Ubuntu/Fedora/CentOS
- Add Nix environment preparation and PATH fixes
- Restore Arch-only makepkg build stage
- Extend Makefile with multi-distro build/test workflow
- Add base image mappings (arch/debian/ubuntu/fedora/centos)
- Add test runner logic for each distro, including Nix devShell fallback scanning
- Improve structure with clear section headers and comments

https://chatgpt.com/share/69360c94-ef04-800f-afd2-75bc6cd33d4d
2025-12-08 00:24:22 +01:00
Kevin Veen-Birkenbach
87b806d1b9 feat: package config/ and defaults.yaml correctly for Nix & setuptools
This commit fixes the missing `config/defaults.yaml` issue that caused
`pkgmgr --help` to fail with exit code 5 inside Nix builds and during
integration tests.

Changes:
- Added `config/__init__.py` to make the directory a proper Python package.
- Updated `pyproject.toml` to rely on setuptools package discovery.
- Extended `tool.setuptools.packages.find.include` to include both `pkgmgr*` and `config*`.
- Added `tool.setuptools.package-data` so `defaults.yaml` is included
  in wheels, Nix builds, and PKGBUILD-derived installations.
- Removed the conflicting `tool.setuptools.packages` declaration.

This ensures that Nix's pypaBuildPhase can build the wheel successfully
and that `pkgmgr --help` no longer crashes due to missing default config.

Reference:
https://chatgpt.com/share/6935f05f-03d8-800f-a126-b3114cc116ec
2025-12-07 22:29:58 +01:00
Kevin Veen-Birkenbach
7760c77952 Use pyproject-based Nix flake build and fix install logic for pkgmgr
- Add pyproject.toml to define package-manager as a Python application
  - Declare setuptools build backend (setuptools.build_meta) and wheel
  - Expose CLI entrypoint via [project.scripts] as `pkgmgr = pkgmgr.cli:main`
  - Define PyYAML as a base runtime dependency

- Update flake.nix to build pkgmgr via python311Packages.buildPythonApplication
  - Use format = "pyproject" and src = ./. (current git checkout)
  - Add setuptools and wheel to nativeBuildInputs for the backend
  - Add pyyaml to propagatedBuildInputs to match pyproject dependencies
  - Provide a devShell that includes the built pkgmgr, git, and Ansible
  - Expose `nix run .#pkgmgr` and `nix run .#default` as flake apps

- Fix Makefile install target for Nix shells
  - Treat install as a no-op when IN_NIX_SHELL is set (skip venv / pip)
  - In non-Nix environments, create ~/.venvs/pkgmgr, install deps, and
    wire automatic activation into shell rc files
  - Keep Arch/Manjaro-specific aur_builder/yay setup behind pacman check

- Adjust PKGBUILD prepare() to correctly copy the full project tree
  - Stop excluding the top-level src directory from rsync
  - Still exclude .git, .github, pkg, and srcpkg

This unifies the installation workflow across Arch, Nix, and local venvs,
and ensures pkgmgr builds cleanly inside the Docker-based Nix devShell tests.

Reference: ChatGPT-assisted refactor & debugging session on 2025-12-07.
https://chatgpt.com/share/6935ee1f-6c0c-800f-bb32-434c4051bd1e
2025-12-07 22:14:29 +01:00
Kevin Veen-Birkenbach
8e80dc5fd7 Fixed tests in container 2025-12-07 21:52:04 +01:00
Kevin Veen-Birkenbach
9679478353 Improve Docker-based build & test pipeline for pkgmgr
- Add .dockerignore rules to prevent Arch package artifacts from entering the build context
- Rework Dockerfile to remove stale package artifacts before makepkg and use a dev entry script
- Introduce docker-entry-dev.sh to always rebuild pkgmgr from the mounted /src tree
- Update Makefile 'test' target to rebuild pkgmgr inside the container before running tests
- Fix predictable makepkg failures caused by residual *.pkg.tar.* files

Conversation reference: https://chatgpt.com/share/6935e6e8-f3fc-800f-a4e9-7537114f13d1
2025-12-07 21:43:38 +01:00
Kevin Veen-Birkenbach
225d6a84b7 Added error code 2025-12-07 21:02:55 +01:00
Kevin Veen-Birkenbach
6e52e875aa Added ENV to Dockerfile 2025-12-07 20:58:49 +01:00
Kevin Veen-Birkenbach
6fee6f27ee Fix PKGBUILD source handling and Docker build context
This commit removes unnecessary source entries from PKGBUILD
to allow full local-tree packaging through prepare(), and updates
the Dockerfile to copy the entire repository and install rsync
for makepkg buildtime dependencies.

See conversation: https://chatgpt.com/share/6935db4e-f3e8-800f-b0ca-42f77491ef5b
2025-12-07 20:54:04 +01:00
Kevin Veen-Birkenbach
16a9d55d4f Refactor pkgmgr installers, introduce capability-based execution, and replace manifest layer
References:
- Current ChatGPT conversation: https://chatgpt.com/share/6935d6d7-0ae4-800f-988a-44a50c17ba48
- Extended discussion: https://chatgpt.com/share/6935d734-fd84-800f-9755-290902b8cee8

Summary:
This commit performs a major cleanup and modernization of the installation pipeline:

1. Introduced a new capability-detection subsystem:
   - Capabilities (python-runtime, make-install, nix-flake) are detected per installer/layer.
   - Installers run only when they add new capabilities.
   - Prevents duplicated work such as Python installers running when Nix already provides the runtime.

2. Removed deprecated pkgmgr.yml manifest installer:
   - Dependency resolution is now delegated entirely to real package managers (Nix, pip, make, distro build tools).
   - Simplifies layering and avoids unnecessary recursion.

3. Reworked OS-specific installers:
   - Arch PKGBUILD now uses 'makepkg --syncdeps --cleanbuild --install --noconfirm'.
   - Debian installer now builds proper .deb packages via dpkg-buildpackage + installs them.
   - RPM installer now builds packages using rpmbuild and installs them via rpm.

4. Switched from remote GitHub flakes to local-flake execution:
   - Wrapper now executes: nix run /usr/lib/package-manager#pkgmgr
   - Avoids lock-file write attempts and improves reliability in CI.

5. Added bash -i based integration test:
   - Correctly sources ~/.bashrc and evaluates alias + venv activation.
   - ‘pkgmgr --help’ is now printed for debugging without failing tests.

6. Updated unit tests across all installers:
   - Removed references to manifest installer.
   - Adjusted expectations for new behaviors (makepkg, dpkg-buildpackage, rpmbuild).
   - Added capability subsystem tests.

7. Improved flake.nix packaging logic:
   - The entire project source tree is copied into the runtime closure.
   - pkgmgr wrapper now executes runpy inside the packaged directory.

Together, these changes create a predictable, layered, capability-driven installer pipeline with consistent behavior across Arch, Debian, RPM, Nix, and Python layers.
2025-12-07 20:36:39 +01:00
Kevin Veen-Birkenbach
5134fd5273 Added missing package-manager.install 2025-12-06 19:46:59 +01:00
Kevin Veen-Birkenbach
aaf20da0a0 Add cross-distribution OS package installers (Arch PKGBUILD, Debian control, RPM spec) and restructure tests.
Remove deprecated AUR and Ansible requirements installers.
Introduce Nix init + wrapper scripts and full packaging (Arch/DEB/RPM).
Associated conversation: https://chatgpt.com/share/693476a8-b9f0-800f-8e0c-ea5151295ce2
2025-12-06 19:32:31 +01:00
Kevin Veen-Birkenbach
d6a7ce0aa0 Fix: Skip venv/pip installation inside Nix shell and add fallback for _requirements.txt (see conversation: https://chatgpt.com/share/69345df2-a960-800f-8395-92a7c3a6629f) 2025-12-06 17:57:05 +01:00
Kevin Veen-Birkenbach
f57ab0c2d1 Refactor pkgmgr self-install handling, add pip-enabled Python env to flake, and fix Nix/pip integration
- Rename requirements.txt to _requirements.txt to avoid unintended self-install via PythonInstaller.
- Update flake.nix to provide Python with pip in both devShell and runtime closure.
- Generate a wrapper for pkgmgr that uses the pip-enabled interpreter.
- Adjust NixFlakeInstaller to correctly handle old profile removal and install outputs.
- Update run_command to support string commands and allow_failure.
- Improve integration test by adding nix profile cleanup and debugging output.

Reference: https://chatgpt.com/share/69345df2-a960-800f-8395-92a7c3a6629f
2025-12-06 17:47:46 +01:00
Kevin Veen-Birkenbach
96a0409dbb Enhance Nix flake installer to remove old profile entries before installation and update unit tests accordingly.
Includes:
- Added best-effort removal of existing 'package-manager' Nix profile entry.
- Updated install logic to avoid file conflicts.
- Extended unit tests to verify removal behavior and SystemExit-safe handling.

Conversation reference: https://chatgpt.com/share/69332bc4-a128-800f-a69c-fdc24c4cc7fe
2025-12-06 15:47:31 +01:00
Kevin Veen-Birkenbach
aae852995e Updated version in flate.nix 2025-12-05 22:53:58 +01:00
Kevin Veen-Birkenbach
6bc4d75744 Updated version 2025-12-05 22:53:00 +01:00
Kevin Veen-Birkenbach
9517c79342 Refactor flake.nix to use stdenv.mkDerivation instead of buildPythonApplication, disable configure/build phases, add minimal installPhase to avoid triggering Makefile. See ChatGPT conversation: https://chatgpt.com/share/69332bc4-a128-800f-a69c-fdc24c4cc7fe 2025-12-05 22:47:13 +01:00
Kevin Veen-Birkenbach
46efb7d187 Removed python building 2025-12-05 22:40:29 +01:00
Kevin Veen-Birkenbach
218c6a4a82 Make pkgmgr installers fail hard and integrate Nix-based test pipeline (see https://chatgpt.com/share/69332bc4-a128-800f-a69c-fdc24c4cc7fe) 2025-12-05 22:33:49 +01:00
Kevin Veen-Birkenbach
005f828877 Add Nix-based fallback for ansible-galaxy resolution
- Introduce _get_ansible_galaxy_cmd() to resolve ansible-galaxy dynamically
- Prefer system ansible-galaxy when available
- Fall back to Nix: 'nix run nixpkgs#ansible-core -- ansible-galaxy'
- Allow pkgmgr to install Ansible dependencies on hosts without ansible-core
- Print clear warning when neither ansible-galaxy nor nix is available

See: https://chatgpt.com/share/69332bc4-a128-800f-a69c-fdc24c4cc7fe
2025-12-05 20:34:26 +01:00
Kevin Veen-Birkenbach
42212b8cb0 Add Nix configuration defaults and new shallow-clone integration test
- Enable 'nix-command' and 'flakes' globally via flake.nix nixConfig
- Improve .gitignore by excluding *.log files
- Add integration test for shallow clone mode using pkgmgr install pipeline
- Ensures pkgmgr works end-to-end inside test container with --clone-mode shallow

See: https://chatgpt.com/share/69332bc4-a128-800f-a69c-fdc24c4cc7fe
2025-12-05 20:20:33 +01:00
Kevin Veen-Birkenbach
a435745c02 Enforce Ansible availability via Nix and validate requirements.yml
- Add ansiblePkg as propagated dependency in flake.nix so ansible-galaxy is available on host
- Introduce strict requirements.yml validator for AnsibleRequirementsInstaller
- Accept roles entries with either 'name' or 'src'
- Ensure run() always validates requirements before installing dependencies
- Extend unit tests to cover valid, invalid and warning-only requirements.yml cases

See: https://chatgpt.com/share/69332bc4-a128-800f-a69c-fdc24c4cc7fe
2025-12-05 20:00:47 +01:00
Kevin Veen-Birkenbach
f5475d86e2 Refactor pkgmgr into modular installer pipeline with Nix flake support, PKGBUILD build workflow, local Nix cache, and full test suite restructuring.
See conversation: https://chatgpt.com/share/69332519-7ff4-800f-bc21-7fcd24a66c10
2025-12-05 19:32:42 +01:00
Kevin Veen-Birkenbach
341ec1179e Removed pyproject.toml 2025-12-05 16:31:28 +01:00
Kevin Veen-Birkenbach
41084234c7 Package pkgmgr with multi-format manifests
- Add pyproject.toml and setuptools config for pkgmgr packaging
- Add Nix flake (devShell + pkgmgr package output)
- Add Arch PKGBUILD for system packaging
- Introduce pkgmgr.yml manifest for repo-level dependencies
- Refactor CLI into pkgmgr/cli.py and make main.py a thin entrypoint
- Extend install_repos to handle pkgmgr.yml, PKGBUILD, flake.nix, Ansible and Python manifests
- Enhance status/update to show Nix/yay system status and upgrades
- Improve .gitignore and document requirements.yml

Created with AI (ChatGPT) – see conversation: https://chatgpt.com/share/6932f2ca-f560-800f-8bb0-52cb82f27e88
2025-12-05 15:57:45 +01:00
Kevin Veen-Birkenbach
c4395a4764 Add Arch-based Docker test setup, shallow clone mode support and pkgmgr tests (see ChatGPT conversation: https://chatgpt.com/share/693052a1-edd0-800f-a9d6-c154b8e7d8e0) 2025-12-03 16:09:42 +01:00
Kevin Veen-Birkenbach
71cf032506 Added fidedu 2025-10-18 11:32:48 +02:00
Kevin Veen-Birkenbach
19c2abc117 Add automatic aur_builder and yay setup for Arch-based systems
- Added aur_builder_setup target to Makefile
- Automatically detects Arch/Manjaro via pacman
- Creates aur_builder user and group with sudoers permissions
- Installs yay if not already present
- Skips AUR setup gracefully on non-Arch systems

https://chatgpt.com/share/68f2a922-63f8-800f-a6d6-18b8d06b7139
2025-10-17 23:01:34 +02:00
Kevin Veen-Birkenbach
88b34e83a3 Fix Makefile to use python3 for venv creation and pip installation
- Replaced 'python' with 'python3' for better compatibility on Arch-based systems
- Added ensurepip call to guarantee pip availability inside virtual environment
- Improved venv creation logic and ensured setuptools/wheel upgrade
- Fixed potential 'pip not found' (Error 127) issue during installation

https://chatgpt.com/share/68f2a922-63f8-800f-a6d6-18b8d06b7139
2025-10-17 22:38:32 +02:00
Kevin Veen-Birkenbach
8ec43840b9 Added automtu 2025-10-15 19:18:15 +02:00
Kevin Veen-Birkenbach
59220f5c43 Added reuse 2025-10-15 14:02:00 +02:00
Kevin Veen-Birkenbach
d13784995b Added invbuilder 2025-10-15 11:28:49 +02:00
Kevin Veen-Birkenbach
f17c395dac Added localnet 2025-10-14 10:56:14 +02:00
Kevin Veen-Birkenbach
0430a746ca Added poc-mcp-llm-stack 2025-09-20 10:22:55 +02:00
Kevin Veen-Birkenbach
b9c9f473e9 Updated cleanback 2025-09-11 19:36:49 +02:00
Kevin Veen-Birkenbach
d9ed53b876 Added doscol 2025-08-20 16:57:18 +02:00
Kevin Veen-Birkenbach
7a3187278f Replaced pgsr through dbsr 2025-08-15 18:53:07 +02:00