Commit Graph

357 Commits

Author SHA1 Message Date
Simone af25358b5b ci: update artifact upload actions to use standard upload-artifact action 2026-05-17 02:15:36 +02:00
Simone e29f5eb995 ci: update artifact upload actions to use local repository references 2026-05-17 02:13:18 +02:00
Simone ea29203f37 ci: update action references to local-ci-cd-system in workflows and action files 2026-05-17 01:37:03 +02:00
Simone 5cb3a7510f ci: sposta local-ci-build action in .gitea/actions/ 2026-05-17 00:45:43 +02:00
Simone efd39c2279 ci: sposta self-test.yml e build-nsInnoUnp.yml in .gitea/workflows 2026-05-17 00:29:53 +02:00
Simone c5b2f36c77 docs: aggiorna checklist FaseA (tracking workflow) 2026-05-17 00:29:21 +02:00
Simone 935b212d1a ci: sposta self-test.yml e build-nsInnoUnp.yml in .gitea/workflows 2026-05-17 00:29:11 +02:00
Simone 9490aec92a chore: allinea .gitignore a main 2026-05-17 00:24:26 +02:00
Simone 4b70172c52 ci: aggiungi workflow_dispatch (trigger manuale) a lint.yml
Lint / pssa (push) Successful in 23s
Lint / python (push) Successful in 26s
2026-05-17 00:23:56 +02:00
Simone aa7e375e5d fix: add missing workflow_dispatch trigger to lint.yml
Lint / python (push) Failing after 11s
Lint / pssa (push) Failing after 27s
fix: update .gitignore to include AI tools and Python bytecode
2026-05-17 00:22:41 +02:00
Simone 67d81c2fc2 ci: aggiungi workflow lint.yml da feature/python-rewrite-and-linux-migration
Lint / python (push) Failing after 27s
Lint / pssa (push) Failing after 38s
2026-05-17 00:14:16 +02:00
Simone e810747557 docs,config: aggiorna AGENTS.md, config.example, HOST-SETUP.md, checklist faseA e fix vari orchestrator (workstation, build, job, wait, winrm, test) 2026-05-17 00:14:04 +02:00
Simone dc8449a0d7 test: cover easy missing branches in report/config/credentials/ssh/wait/job
Lint / pssa (push) Successful in 34s
Lint / python (push) Successful in 41s
2026-05-14 23:23:55 +02:00
Simone b2b31f4b6e test: add coverage for monitor/vm/winrm to reach 90%% gate
Lint / pssa (push) Successful in 35s
Lint / python (push) Successful in 42s
Bring monitor.py 49->99%%, vm.py 79->98%%, winrm.py 76->100%%. Total project coverage 80.10%% -> 90.69%%, satisfying the 90%% gate set in commit 451a61c.
2026-05-14 23:14:08 +02:00
Simone 451a61c6a1 test: bump coverage gate from 80%% to 90%%
Lint / python (push) Failing after 22s
Lint / pssa (push) Successful in 25s
Update --cov-fail-under in lint workflow + docs (AGENTS, README, ARCHITECTURE). Note: A5 closeout reported 80.10%% so this run will likely fail until additional tests are added.
2026-05-14 23:04:56 +02:00
Simone 4f656725bf ci(lint): use CI_PYTHON_LAUNCHER from runner config as single source of truth
Lint / pssa (push) Successful in 24s
Lint / python (push) Successful in 22s
Configure system Python path once in runner/config.yaml (runner.envs) instead of probing N candidate locations in the workflow. Workflow now fails fast with a clear error if the env is unset or points to a missing file. Document the new env in AGENTS.md.
2026-05-14 22:56:51 +02:00
Simone 3c62bbbcbb ci(lint): add Python314 to launcher candidates (host has 3.14.5)
Lint / pssa (push) Successful in 24s
Lint / python (push) Successful in 1m0s
Reorder candidates to put C:\Program Files\Python314 first (verified install path on the production host). Drop py.exe -3.11 hint to plain -3 since host has only 3.14.
2026-05-14 22:53:16 +02:00
Simone 6e0d0cba88 ci(lint): probe multiple Python launcher locations for SYSTEM runner
Lint / python (push) Failing after 10s
Lint / pssa (push) Successful in 24s
act_runner SYSTEM context may not have py.exe or python.exe in PATH. Try a list of common install paths (C:\Python3XX, Program Files, LocalAppData) and allow override via CI_PYTHON_LAUNCHER env var.
2026-05-14 22:51:22 +02:00
Simone 38898a3c21 ci(lint): fix broken-venv probe (AGENTS.md #12 stderr trap)
Lint / python (push) Failing after 11s
Lint / pssa (push) Successful in 24s
Native stderr from a broken python.exe shim ('No Python at ...') becomes a terminating exception under \Continue='Stop' BEFORE \0 can be read. Wrap the probe in try/catch + SilentlyContinue.
2026-05-14 22:50:29 +02:00
Simone 0c7c9272ee ci(lint): detect broken venv (stale base interpreter) and rebuild
Lint / python (push) Failing after 8s
Lint / pssa (push) Successful in 24s
The venv at F:\CI\python\venv may exist but be broken if its pyvenv.cfg points to a deleted base interpreter (e.g. a stale actions/setup-python tool_cache). Detect this by running 'python --version' and rebuild the venv with py.exe -3.11 if it fails.
2026-05-14 22:48:46 +02:00
Simone 406c0e31a9 ci(lint): bootstrap venv via py.exe launcher; bump coverage to 80%
Lint / python (push) Failing after 18s
Lint / pssa (push) Successful in 24s
act_runner runs as SYSTEM and does not have plain 'python' in PATH; use py.exe launcher (-3.11) to bootstrap the venv when missing. The production venv at F:\CI\python\venv normally already exists, so the bootstrap is just a fallback. Also align coverage threshold to 80% (raised in A5, see AGENTS.md).
2026-05-14 22:46:13 +02:00
Simone 632d668327 ci(lint): tweak comment header to trigger workflow re-run
Lint / python (push) Failing after 9s
Lint / pssa (push) Successful in 25s
2026-05-14 22:43:55 +02:00
Simone ebc53b5fb9 ci: trigger lint workflow re-run 2026-05-14 22:39:30 +02:00
Simone 137287176e docs: rename branch references to feature/python-rewrite-and-linux-migration
Update active docs (PhaseA/B checklists, README) after rename of feature/python-rewrite-phase-a -> feature/python-rewrite-and-linux-migration. Historical A1-A5 closeouts left untouched as they document state at the time of writing.
2026-05-14 18:34:04 +02:00
Simone 28523375b9 docs(plans): add A->B bridge checklist (windows prereqs + baseline + logistics)
Bridges the gap between PhaseA-user-checklist.md (Windows validation) and PhaseB-user-checklist.md (Linux setup):

  Section 1: capture pre-migration benchmark to docs/RUNBOOK.md (referenced by B7)

  Section 2: 7 Windows prerequisites (SSH keys, BuildVMGuest password, Gitea PAT, OpenSSH server, template power-off check per AGENTS.md #9, F:\CI\ backup, scheduled task cadence audit)

  Section 3: logistics (hardware, DNS, maintenance window, user comms)
2026-05-14 18:34:04 +02:00
Simone bd61258a42 feat(b6): add Phase B user checklist for CI migration to Linux Mint 2026-05-14 18:34:04 +02:00
Simone 0bd3b52fb5 feat(b5): add systemd unit files for CI periodic tasks (Linux host)
Implements the repo-side artifacts of Phase B5 (plans/implementation-plan-A-B.md). Creates 5 .service + .timer pairs under deploy/systemd/ that replicate the periodic tasks registered on Windows by scripts/Register-CIScheduledTasks.ps1:

  - ci-cleanup-orphans       -> python -m ci_orchestrator vm cleanup --max-age-hours 6 (every 6h + boot)

  - ci-retention-policy      -> pwsh Invoke-RetentionPolicy.ps1 (daily 03:00)

  - ci-watch-disk-space      -> python -m ci_orchestrator monitor disk (every 15min)

  - ci-watch-runner-health   -> python -m ci_orchestrator monitor runner (every 15min)

  - ci-backup-template       -> pwsh Backup-CITemplate.ps1 (weekly Sun 02:00, NEW)

Includes deploy/systemd/README.md with mapping table, install/test/rollback instructions, and PowerShell Core install note for the two PS-only scripts. Plan checklist updated; B5-closeout.md added. Hardware install steps (systemctl enable + smoke) remain user responsibility on the Linux host.
2026-05-14 18:34:04 +02:00
Simone 4e0b796f81 docs: add Fase A user checklist for hardware validation 2026-05-14 18:34:04 +02:00
Simone a658f4ed3b docs(a5): mark A5 as code-complete; add A5-closeout.md
Master checklist + step A5 attivita + 'definizione di fatto' updated; A5-closeout.md added (116 pytest, coverage 80.10% total, gate raised to 80%). Hardware validation (burn-in 4x10 + workflow matrix end-to-end) deferred to user. Shim PS removal deferred to B5 (systemd timers): all 10 shims still referenced by Register-CIScheduledTasks.ps1 / docs / Test-*.ps1.
2026-05-14 18:34:04 +02:00
Simone 4d9c6d07ba docs(a5): document Python orchestrator in AGENTS.md, ARCHITECTURE.md, README.md
AGENTS.md: new 'Python development' section (venv paths, install/lint/typecheck/test commands, conventions, full PS->Python sub-command mapping, list of PS scripts that stay PowerShell, link to phase closeouts). README.md: expand 'Python orchestrator' with examples for all 10 sub-commands (wait-ready, vm new/remove/cleanup, build run, artifacts collect, monitor disk/runner, report job, job), local validation gates with 80% coverage gate, link to test_agents_errors.py. docs/ARCHITECTURE.md: new 'Python orchestrator (Phase A)' section with package layout tree, VmBackend Protocol contract, load_backend(config) factory, Phase C ESXi extension recipe, transport selection note, and CI validation gates.
2026-05-14 18:34:04 +02:00
Simone 5459672b42 test(a5): add pytest regression tests for AGENTS.md errors #9-#12
12 dedicated tests covering: (#9) clone_linked surfaces 'should not be powered on' as typed BackendError; (#10) is_running uses 'vmrun list' only and never falls back to getGuestIPAddress (incl. on vmrun list failure); (#11) two consecutive 'vm new' invocations with identical inputs MUST produce distinct clone names/destinations (timestamp suffix), guarding the orchestrator-side safety net against the machine-id duplicate-IP failure mode; (#12) SshTransport defaults to paramiko AutoAddPolicy with no known_hosts, never shells out to ssh-keygen/ssh.exe/scp.exe, wraps paramiko import/exec/SFTP errors as TransportConnectError. Coverage: 80.10% (gate 80%).
2026-05-14 18:34:04 +02:00
Simone 1bcd40e483 docs(a4): mark A4 as code-complete; add A4-closeout.md
Master checklist + step A4 attivita + 'definizione di fatto' updated; A4-closeout.md added (104 pytest, coverage 79.25% total / 83% commands/job.py). Hardware validation (matrix workflow + benchmark) deferred to user.
2026-05-14 18:34:04 +02:00
Simone e5cd749ea1 ci(a4): switch local-ci-build action.yml to Python CLI; add PYTHONIOENCODING=utf-8
The composite action now invokes & $venvPython -m ci_orchestrator job ... directly instead of splatting a hashtable into Invoke-CIJob.ps1, removing the only mismatch between the new shim's positional args contract and the action's previous PascalCase splatting. runner/config.yaml exports PYTHONIOENCODING=utf-8 so non-ASCII build output survives the act_runner -> Gitea round-trip.
2026-05-14 18:34:03 +02:00
Simone f5091d0903 feat(a4): port Invoke-CIJob.ps1 to ci_orchestrator job
Phase A4 of plans/implementation-plan-A-B.md. Implements the full job orchestrator (clone -> start -> wait -> probe -> build -> collect -> guaranteed cleanup) as a new commands/job.py click command, registered under python -m ci_orchestrator job. Backend selection goes through backends.load_backend(config) so Phase C can swap in remote drivers without touching the command. The legacy scripts/Invoke-CIJob.ps1 is replaced by a thin PS 5.1 shim that delegates to the Python CLI; tests/python/test_commands_job.py adds 13 cases covering Linux/Windows happy paths, override application, skip-artifact, and cleanup on every failure mode.
2026-05-14 18:34:03 +02:00
Simone 816a15503e feat(a3): port build pipeline (vm new, build run, artifacts collect)
Implements Phase A3 of plans/implementation-plan-A-B.md:

- commands/vm.py: vm new (replaces New-BuildVM.ps1)

- commands/build.py: build run (replaces Invoke-RemoteBuild.ps1) with WinRM/SSH dispatch and stdout streaming for act_runner

- commands/artifacts.py: artifacts collect (replaces Get-BuildArtifacts.ps1) using transport.fetch()

- 3 PS scripts reduced to shims preserving \0

- Pester tests/{New-BuildVM,Wait-VMReady,Remove-BuildVM}.Tests.ps1 removed; equivalent cases covered in pytest

- Phase C hook: build/artifacts accept opaque VmHandle/vmx; no Windows path assumptions

Tests: 91 pytest, ruff clean, mypy --strict clean, coverage 78.27% (>=70 gate).

Master checklist + step A3 attivita + 'definizione di fatto' updated; A3-closeout.md added.
2026-05-14 18:34:03 +02:00
Simone 096ba7fe16 docs(a1): sync master checklist + A1 'definizione di fatto' to actual state
A1 items were completed but only A1-closeout.md was updated. Mark all A1 checkboxes done in implementation-plan-A-B.md (master checklist + step-A1 attivita + definizione di fatto), leaving only the real-VM PoC pending (hardware validation deferred).
2026-05-14 18:34:03 +02:00
Simone ad9e6e9673 docs(a2): mark A2 as code-complete; add A2-closeout.md 2026-05-14 18:34:03 +02:00
Simone 80f6661ad5 feat(a2): port leaf PS scripts to ci_orchestrator CLI
Implements Phase A2 of plans/implementation-plan-A-B.md:

- commands/wait.py    -> wait-ready (replaces Wait-VMReady.ps1)

- commands/vm.py      -> vm remove + vm cleanup (replaces Remove-BuildVM.ps1, Cleanup-OrphanedBuildVMs.ps1); cleanup accepts injected VmBackend (Phase C ESXi hook preserved)

- commands/monitor.py -> monitor disk + monitor runner (replaces Watch-DiskSpace.ps1, Watch-RunnerHealth.ps1)

- commands/report.py  -> report job (replaces Get-CIJobSummary.ps1)

Each PS script reduced to a 3-line shim that delegates to the Python CLI and preserves \0.

Tests: 69 pytest cases across new test_commands_*.py modules; ruff clean, mypy --strict clean, coverage 74.5% (>=70 gate).
2026-05-14 18:34:03 +02:00
Simone 10da8f4e81 docs(A1): mark lint.yml python job as PASS on act_runner 2026-05-14 18:34:03 +02:00
Simone 484a18efd7 ci(lint): drop actions/setup-python; use host Python in machine PATH
The runner's act_runner runs as SYSTEM, which only sees the Machine PATH.
Host has Python 3.14 installed at C:\Program Files\Python314\; once that
path is added to the machine PATH (one-time admin op) the simple
Get-Command python lookup works without network downloads.
2026-05-14 18:34:03 +02:00
Simone 3f05e89362 ci(lint): add CmdletBinding and ShouldProcess support to ISO creation functions for safer execution 2026-05-14 18:34:03 +02:00
Simone 2ac26dbd00 ci(lint): enhance PSScriptAnalyzer settings and suppress false positives; improve error handling in scripts 2026-05-14 18:34:03 +02:00
Simone 032d6f200e ci(lint): add rule to suppress false positives for param() in remote script blocks 2026-05-14 18:34:03 +02:00
Simone 7e6b65db18 ci(lint): update PSScriptAnalyzer settings and suppress warnings for plain-text passwords in templates 2026-05-14 18:34:03 +02:00
Simone 366ff0ce46 ci(lint): update PSScriptAnalyzer settings to include additional formatting rules 2026-05-14 18:34:02 +02:00
Simone e09c0cf5a5 ci(lint): update PSScriptAnalyzer invocation to use custom settings file 2026-05-14 18:34:02 +02:00
Simone 81c85beb81 ci: remove Python setup step from lint workflow 2026-05-14 18:34:02 +02:00
Simone 8a2727ccf7 ci(lint): use actions/setup-python to provision Python on runner
The act_runner service account doesn't have python in PATH. Delegating
to actions/setup-python@v5 which downloads/caches Python 3.11 reliably.

Also bump timeout-minutes 15 -> 20 to absorb first-run pip install.
2026-05-14 18:34:02 +02:00
Simone 305ee6fa8b ci: move lint.yml to .gitea/workflows so Gitea Actions discovers it
Gitea Actions only scans .gitea/workflows/ and .github/workflows/. The
file under gitea/workflows/ (no leading dot) was never picked up. Other
files in gitea/workflows/ remain as templates copied into consumer repos.
2026-05-14 18:34:02 +02:00
Simone 44a99af14f feat: add closeout checklist for Phase A1 implementation 2026-05-14 18:34:02 +02:00