486 Commits
Author SHA1 Message Date
Simone 86716773d7 feat(ci): repo-branch/repo-commit inputs on main
Runner fetches the composite action from @main. Propagates the
cross-repo branch/commit inputs.
2026-05-17 17:37:20 +02:00
Simone 9f54c99c9c feat(ci): repo-branch/repo-commit inputs for cross-repo builds
github.ref_name/github.sha refer to the workflow's own repo. When
repo-url points elsewhere (build-nsInnoUnp builds
nsis-plugin-nsinnounp) the workflow's branch does not exist there
("Remote branch ... not found in upstream origin"). New inputs:
- repo-branch: target branch (default: github.ref_name)
- repo-commit: target commit (default: github.sha only if repo-url
  not overridden; cross-repo => empty = branch tip, no pin)
build-nsInnoUnp.yml sets repo-branch: main.
2026-05-17 17:37:18 +02:00
Simone 5027389080 fix(job): surface redacted git stderr from host-side clone
_host_clone hid all stderr ("exit 128" with no cause). Surface the
last stderr lines with scheme://user:pass@ credentials masked, so
failures (e.g. unresolved SSH alias under LocalSystem) are diagnosable.
2026-05-17 17:28:35 +02:00
Simone 27070ebb3e fix(ci): build-nsInnoUnp uses host-side clone (SSH alias is host-only)
repo-url is ssh://gitea-ci/... — an SSH alias defined only in the
host ~/.ssh/config. With the new in-guest-clone default the guest
tried to resolve `gitea-ci` and failed (name resolution). Set
use-git-clone:'false' so the host (which has the alias + SSH key)
performs the clone.
2026-05-17 17:24:00 +02:00
Simone 81672e9285 fix(ci): build-nsInnoUnp uses full Gitea action URL
Short-form `Simone/local-ci-cd-system/...@main` resolved to
github.com (DEFAULT_ACTIONS_URL=github) -> "authentication required:
Repository not found". Use the full gitea.emulab.it URL like
self-test.yml.
2026-05-17 17:14:23 +02:00
Simone 6b50a0fcea docs(phaseA): record self-test smoke matrix (both transports PASS)
Passo 6: self-test.yml validated — in-guest clone (default) and
host-side clone+zip, Windows + Linux, all SUCCESS. Artifact handling
github-free.
2026-05-17 17:11:40 +02:00
Simone c40373cb2a feat(ci): use-git-clone/submodules default-on in action (main)
Runner fetches the composite action from @main. Propagates the
default-on transport/submodules inputs and explicit flag forwarding.
2026-05-17 17:00:53 +02:00
Simone 8d059cd3c4 feat(job): wire use-git-clone + submodules; default in-guest clone
The job command previously discarded --use-git-clone and --submodules
(`del`) and always in-guest cloned with submodules off — making both
action inputs dead no-ops (submodule repos silently broken).

- job.py: --use-git-clone/--host-clone and --submodules/--no-submodules
  are real booleans defaulting to ON. Default = in-guest clone with
  submodules. --host-clone clones on the host into a temp dir
  (_host_clone) and transfers a zip; temp dir cleaned in finally.
  clone_submodules now honoured (was hardcoded False).
- action.yml: use-git-clone / submodules default 'true'; forward the
  explicit positive/negative flag so the Python default is overridden
  deterministically.
- self-test.yml: add smoke-{windows,linux}-hostclone jobs covering the
  host-side transport (default jobs already cover in-guest).
- tests: default-transport, host-clone, and --no-submodules coverage.
2026-05-17 17:00:46 +02:00
Simone 1577bb8fdb docs(todo): defer GitHub Actions mirror (fix 1) — checkout still github.com
Artifact github.com dependency removed (fix 2 applied). Remaining:
actions/checkout@v4 in lint.yml. Recorded as deferred §8.1 with
revisit conditions (air-gapped host / total github.com independence).
2026-05-17 16:44:49 +02:00
Simone 622279df73 refactor(ci): drop upload-artifact from action on main
Runner fetches the composite action from @main. Propagates the
github.com-free artifact handling (host-side collect dir).
2026-05-17 16:42:38 +02:00
Simone 1e5cdc3b00 refactor(ci): drop upload/download-artifact (remove github.com dependency)
actions/upload-artifact and download-artifact run code fetched from
github.com (and v4 is GHES-incompatible, v3 deprecated). The runner
host is single with a shared filesystem, so the orchestrator's
host-side collect dir is the artifact handoff:

- action.yml: replace the two upload-artifact steps with
  host-path report steps; artifacts stay under F:\CI\Artifacts and
  are aged by Invoke-RetentionPolicy.ps1.
- build-nsInnoUnp.yml: release job reads
  F:\CI\Artifacts\{run_id}-{run_attempt}-{target} directly instead of
  download-artifact; existing Gitea REST release-asset upload unchanged.

Tradeoff (accepted): artifacts are no longer downloadable from the
Gitea Actions run page for non-tag builds — only on host disk, and as
release assets for tagged builds.
2026-05-17 16:42:36 +02:00
Simone 6c9822b929 refactor(artifacts): harmonize Windows to Linux raw-file collection
Windows produced an intermediate C:\CI\output\artifacts.zip that
upload-artifact then re-zipped (zip-in-zip), while Linux deposited raw
files. Make both paths consistent: the build stages raw outputs into a
collect dir; collect zips it only as a transport archive, fetches, and
extracts into the host artifact dir; actions/upload-artifact produces
the single final archive.

- _windows_build: param artifact_zip -> output_dir; stage raw files
  (in-place when source IS the collect dir, else wipe+copy), no
  Compress-Archive; absolute artifact-source resolved.
- _windows_collect: zip guest dir as transport, fetch, extract (mirror
  _linux_collect); guest_path is now the collect directory.
- job.py / build_run CLI: pass output_dir; rename --guest-artifact-zip
  -> --guest-output-dir.
- Tests updated for the raw-file contract.
2026-05-17 16:30:34 +02:00
Simone 54a7fd4171 fix(build): fetch pinned commit (shallow clone lacks it)
git clone --depth 1 --branch X only fetches the branch tip. When the
branch advances between workflow trigger and runner pickup, checking
out the pinned commit failed with "reference is not a tree: <sha>".
Fetch that exact commit (git fetch --depth 1 origin <sha>) before
checkout, on both Linux (SSH) and Windows (WinRM) paths.
2026-05-17 16:17:55 +02:00
Simone 0c68013e87 fix(build): Linux artifact staging — absolute source + don't wipe output
Two bugs made the Linux smoke "succeed" with an empty artifact:
- artifact_source was always joined as workdir + '/' + src, so an
  absolute source (/opt/ci/output) became /opt/ci/build//opt/ci/output
  and was never found — only a non-fatal WARNING was logged.
- `rm -rf output_dir` ran unconditionally; when the build writes
  directly into the collect dir (the smoke case: output == source),
  it deleted the build output before collection.

Resolve absolute vs workdir-relative; when the source is the output
dir, collect in place without wiping; a missing/empty source is now a
hard failure instead of a silent empty artifact.
2026-05-17 16:12:50 +02:00
Simone 9daf7df871 docs(phaseA): mark self-test.yml validated
Both smoke jobs (Linux + Windows) passed end-to-end this session.
2026-05-17 16:09:52 +02:00
Simone b7efa33f76 docs: align documentation with session fixes
Reconcile docs with the end-to-end pipeline fixes:
- upload/download-artifact @v4 -> @v3 (Gitea GHES) in WORKFLOW-AUTHORING
  and workflow-example.yml; add Common Mistakes rows (v4, action ref
  form + DEFAULT_ACTIONS_URL, public action repo).
- BEST-PRACTICES / README / HOST-SETUP: guest credential must live in
  the LocalSystem vault with a host-qualified username; document
  Set-CIGuestCredential.ps1 / Test-CIGuestWinRM.ps1 and auth=ntlm.
- README / AGENTS / HOST-SETUP: production venv install is NON-editable
  (LocalSystem); no CI workflow may install into it.
- HOST-SETUP: add DEFAULT_ACTIONS_URL=github + full-URL uses: + public
  repo + @main requirements discovered during validation.
- Correct stale repo name local-ci-system -> local-ci-cd-system.
2026-05-17 16:09:15 +02:00
Simone d8039ffb4e docs(phaseA): fix Windows smoke artifact-source to match build cmd
The Windows manual smoke used --guest-artifact-source
'C:\ci\workspace\artifact.txt' (a stale absolute path that does not
exist in the build flow; workdir is C:\CI\build). The build command
writes artifact.txt into the workdir, so the source must be relative
'artifact.txt' — matching the Linux example.
2026-05-17 15:55:52 +02:00
Simone 1b2b6acb45 fix(build): run Windows build cmd as PowerShell; resolve absolute artifact-source
Two Windows-guest build bugs:
- The build command was wrapped in `cmd /c`, so PowerShell-authored
  commands failed ("'New-Item' is not recognized"). Run it as PS
  (seed LASTEXITCODE=0 so PS-only commands exit cleanly).
- artifact_source was always Join-Path'd with the workdir; an absolute
  source (C:\CI\output) became C:\CI\build\C:\CI\output. Use the path
  as-is when rooted, else Join-Path the workdir.
2026-05-17 15:50:17 +02:00
Simone 2b6a5f0557 fix(ci): ephemeral lint venv on main
Stops a main-triggered Lint run from poisoning the shared production
venv (see feature branch commit for full rationale).
2026-05-17 15:44:37 +02:00
Simone dc14396832 fix(ci): lint must use an ephemeral venv, not the production one
The python lint job set VENV_DIR=F:\CI\python\venv (the shared
orchestrator venv) and ran `pip install -e ".[dev]"`. Every lint run
repointed ci_orchestrator at the lint job's transient checkout; once
act_runner cleaned that dir, all later smoke/build jobs failed with
"No module named ci_orchestrator". Use a job-local venv under
github.workspace, rebuilt fresh each run.
2026-05-17 15:44:36 +02:00
Simone 953d5b1e02 feat(scripts): add Test-CIGuestWinRM.ps1 diagnostic
Reproduces the orchestrator WinRM readiness probe as SYSTEM (the
act_runner account) and surfaces the real error the silent
is_ready() swallows: TCP reachability, guest hostname from the TLS
cert CN, and an auth x username-form matrix, with a classified
fix recommendation.
2026-05-17 12:24:35 +02:00
Simone c577588bbd fix(winrm): default to NTLM for local-account build VMs
pypsrp defaults to auth='negotiate', which attempts Kerberos with no
domain and fails under SSPI with SEC_E_UNKNOWN_CREDENTIALS for the
workgroup ci_build account. Default to 'ntlm' (configurable). The
guest username must be host-qualified (WINBUILD-2025\ci_build) and
stored that way in the credential vault.
2026-05-17 12:24:34 +02:00
Simone 7336cbe77f fix(ci): BOM-free GITHUB_OUTPUT + hardened artifact path on main
Runner fetches the composite action from @main. Propagates the fix
that stops an empty artifact-path output from globbing the F: drive.
2026-05-17 12:13:23 +02:00
Simone 2e44eaadb9 fix(ci): write GITHUB_OUTPUT without BOM; harden artifact path
PowerShell 5.1 `Out-File -Encoding utf8` prepends a UTF-8 BOM. The
act_runner GITHUB_OUTPUT parser then read the key as "artifact-path",
so steps.invoke-ci.outputs.artifact-path resolved empty. Combined with
the trailing backslash, the upload path became "\" -> the F: drive root,
causing upload-artifact to ingest the entire drive (hundreds of GB of
unrelated files).

- Append outputs with UTF8Encoding($false) (no BOM).
- Throw if artifactPath is empty instead of emitting nothing.
- Drop the trailing backslash; use /*.log for the diagnostic glob.
2026-05-17 12:13:22 +02:00
Simone 0f163a4732 docs(phaseA): production venv install must be non-editable
act_runner runs as LocalSystem; `pip install -e .` writes a .pth to a
path LocalSystem can't resolve (N: user drive or a transient
F:\CI\RunnerWork job dir), causing "No module named ci_orchestrator".
Prescribe `pip install .` and warn about the cd target.
2026-05-17 12:08:57 +02:00
Simone cfe82410ee fix(ci): downgrade artifact actions v4 -> v3 on main
Runner fetches the composite action from @main; main still had
upload-artifact@v4 which fails on Gitea (GHESNotSupportedError).
Brings the v3 action.yml from feature/python-rewrite-and-linux-migration.
2026-05-17 11:57:08 +02:00
Simone e59bac2434 feat(scripts): add Set-CIGuestCredential.ps1
Stores a guest-VM credential into the LocalSystem keyring vault via a
transient SYSTEM scheduled task, using the production venv's keyring
(the backend ci_orchestrator reads). Fixes the per-user vault mismatch
that made act_runner (LocalSystem) fail with "Credential not found in
keyring" for cmdkey/UI-stored credentials.
2026-05-17 11:56:40 +02:00
Simone ea3e30403a fix(ci): downgrade artifact actions v4 -> v3 for Gitea compat
Gitea act_runner reports as GHES; @actions/artifact v2 (upload/
download-artifact@v4) uses the Twirp API Gitea does not implement,
failing with GHESNotSupportedError. v3 uses the artifact protocol
Gitea supports.
2026-05-17 11:56:40 +02:00
Simone 003e899c3c ci: add local-ci-build composite action to main
Required so `uses: .../local-ci-build@main` resolves: the action only
existed on feature/python-rewrite-and-linux-migration. Brings just the
action.yml (host-side orchestrator unchanged) without merging the full
migration branch.
2026-05-17 02:51:36 +02:00
Simone 7bdafe8e59 ci: update artifact upload actions to use standard upload-artifact action 2026-05-17 02:15:36 +02:00
Simone 045d005024 ci: update artifact upload actions to use local repository references 2026-05-17 02:13:18 +02:00
Simone a18912233e ci: update action references to local-ci-cd-system in workflows and action files 2026-05-17 01:37:03 +02:00
Simone aebd308526 ci: sposta local-ci-build action in .gitea/actions/ 2026-05-17 00:45:43 +02:00
Simone 7932c1971c ci: sposta self-test.yml e build-nsInnoUnp.yml in .gitea/workflows 2026-05-17 00:29:53 +02:00
Simone 7f0f34ec42 docs: aggiorna checklist FaseA (tracking workflow) 2026-05-17 00:29:21 +02:00
Simone 2da133b4b8 ci: sposta self-test.yml e build-nsInnoUnp.yml in .gitea/workflows 2026-05-17 00:29:11 +02:00
Simone 3977c4c6ea chore: allinea .gitignore a main 2026-05-17 00:24:26 +02:00
Simone e388bed8a6 ci: aggiungi workflow_dispatch (trigger manuale) a lint.yml 2026-05-17 00:23:56 +02:00
Simone 1e573e4f04 fix: add missing workflow_dispatch trigger to lint.yml
fix: update .gitignore to include AI tools and Python bytecode
2026-05-17 00:22:41 +02:00
Simone ebbd550857 ci: aggiungi workflow lint.yml da feature/python-rewrite-and-linux-migration 2026-05-17 00:14:16 +02:00
Simone 57bfc41a5a 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 958e4ae035 test: cover easy missing branches in report/config/credentials/ssh/wait/job 2026-05-14 23:23:55 +02:00
Simone 9dcd793e84 test: add coverage for monitor/vm/winrm to reach 90%% gate
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 01c8011.
2026-05-14 23:14:08 +02:00
Simone 01c8011537 test: bump coverage gate from 80%% to 90%%
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 07b1ce222e ci(lint): use CI_PYTHON_LAUNCHER from runner config as single source of truth
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 f93f9c1b7e ci(lint): add Python314 to launcher candidates (host has 3.14.5)
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 1b8298e208 ci(lint): probe multiple Python launcher locations for SYSTEM runner
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 7c054e21db ci(lint): fix broken-venv probe (AGENTS.md #12 stderr trap)
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 5736b5cb76 ci(lint): detect broken venv (stale base interpreter) and rebuild
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 04284e592e ci(lint): bootstrap venv via py.exe launcher; bump coverage to 80%
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