Commit Graph

295 Commits

Author SHA1 Message Date
Simone 29c4ef09bc ci: ns7zip build uses --dist; collect dist/
ns7zip now supports --dist (commit 57133b7 on nsis-plugin-ns7zip):
DLLs land in <repo>/dist/<config>. Build with `python build_plugin.py
--dist` and collect artifact-source 'dist'.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 20:33:56 +02:00
Simone eec3f42fe0 ci: single build-command for ns7zip (Linux has python)
Linux template provides `python`, so the OS-aware split is
unnecessary. Use `python build_plugin.py` for both matrix legs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 20:28:39 +02:00
Simone b2cfe85f88 fix(ci): correct ns7zip build-command and artifact-source
build_plugin.py is a dispatcher: it auto-detects host/toolset and
forwards extra args to the per-version script, which rejected
--final/--dist-dir. Both the Windows (legacy 2601_vs2026) and Linux
build scripts copy nsis7z.dll into <repo>/plugins/{x86-ansi,
x86-unicode,amd64-unicode}, not dist.

- build-command: just `python build_plugin.py` (python3 on Linux —
  Ubuntu 24.04 has no `python`).
- artifact-source: 'plugins' (fixes the "dist missing" failure too).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 20:27:14 +02:00
Simone 383490b769 ci: rename build workflow to build-ns7zip.yml on main
Propagates the renamed cross-repo build workflow (targets
nsis-plugin-ns7zip) to main.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 20:12:26 +02:00
Simone 97ec820ebb ci: rename build-nsInnoUnp.yml -> build-ns7zip.yml; update doc refs
Workflow now targets Simone/nsis-plugin-ns7zip. Renamed the file and
the workflow `name:`, and updated all references in active docs
(plans/archived and docs/archived left as frozen history).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 20:12:25 +02:00
Simone facf3670b2 ci: build-nsInnoUnp targets nsis-plugin-ns7zip
Switch the cross-repo build target to Simone/nsis-plugin-ns7zip
(repo-url, artifact-name, release asset name).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 20:09:15 +02:00
Simone 67c90f10eb fix(build): flush guest build output + put tail in failure message
Lint / pssa (push) Failing after 23s
Lint / python (push) Successful in 52s
On a non-zero build the guest stdout/stderr was written unflushed
then a ClickException raised, so the cause was lost (only
"build command failed (exit 1)" surfaced). _report_build_output now
emits the output with markers, flushes both streams, and returns the
last lines which are appended to the failure message — diagnosable
even if act_runner buffering drops the body. Applied to Linux + Windows.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 17:47:17 +02:00
Simone 02ea7e61ec fix(ci): conditional --commit splat on main
Propagates the PS5.1 empty-arg-drop fix (runner fetches action @main).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 17:39:37 +02:00
Simone 2b8011c35d fix(ci): don't splat empty --commit (PS5.1 drops zero-length args)
PowerShell 5.1 drops a zero-length string when splatting to a native
exe, so an empty $repoCommit shifted flag/value pairing and click saw
the build command as an unexpected positional. Append --commit only
when a commit is set.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 17:39:36 +02:00
Simone 61cb6cdb40 feat(ci): repo-branch/repo-commit inputs on main
Runner fetches the composite action from @main. Propagates the
cross-repo branch/commit inputs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 17:37:20 +02:00
Simone ed4dc793f5 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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 17:37:18 +02:00
Simone 0df592504f fix(job): surface redacted git stderr from host-side clone
Lint / pssa (push) Failing after 24s
Lint / python (push) Successful in 49s
_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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 17:28:35 +02:00
Simone 8be5fa8220 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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 17:24:00 +02:00
Simone 0d51ba29b6 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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 17:14:23 +02:00
Simone 2201d0ace6 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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 17:11:40 +02:00
Simone ecfe0f3006 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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 17:00:53 +02:00
Simone 29dfbf1cae feat(job): wire use-git-clone + submodules; default in-guest clone
Lint / pssa (push) Failing after 26s
Lint / python (push) Successful in 54s
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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 17:00:46 +02:00
Simone a26a7e784e 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).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 16:44:49 +02:00
Simone 5c6fb778ad 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).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 16:42:38 +02:00
Simone d6031a5e32 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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 16:42:36 +02:00
Simone 456db0a3e2 refactor(artifacts): harmonize Windows to Linux raw-file collection
Lint / pssa (push) Failing after 23s
Lint / python (push) Successful in 50s
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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 16:30:34 +02:00
Simone 2e1f3ec477 fix(build): fetch pinned commit (shallow clone lacks it)
Lint / pssa (push) Failing after 24s
Lint / python (push) Failing after 42s
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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 16:17:55 +02:00
Simone ce5e68f357 fix(build): Linux artifact staging — absolute source + don't wipe output
Lint / pssa (push) Failing after 23s
Lint / python (push) Failing after 43s
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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 16:12:50 +02:00
Simone ce71c95083 docs(phaseA): mark self-test.yml validated
Both smoke jobs (Linux + Windows) passed end-to-end this session.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 16:09:52 +02:00
Simone 425d8bc4f3 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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 16:09:15 +02:00
Simone 662a4eb85d 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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 15:55:52 +02:00
Simone d3f129f777 fix(build): run Windows build cmd as PowerShell; resolve absolute artifact-source
Lint / pssa (push) Failing after 25s
Lint / python (push) Failing after 43s
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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 15:50:17 +02:00
Simone 72defb2601 fix(ci): ephemeral lint venv on main
Lint / python (push) Failing after 24s
Lint / pssa (push) Failing after 35s
Stops a main-triggered Lint run from poisoning the shared production
venv (see feature branch commit for full rationale).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 15:44:37 +02:00
Simone 0726829c5c fix(ci): lint must use an ephemeral venv, not the production one
Lint / pssa (push) Failing after 30s
Lint / python (push) Successful in 1m2s
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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 15:44:36 +02:00
Simone 21681e7419 feat(scripts): add Test-CIGuestWinRM.ps1 diagnostic
Lint / python (push) Successful in 21s
Lint / pssa (push) Failing after 24s
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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 12:24:35 +02:00
Simone ef6f36c702 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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 12:24:34 +02:00
Simone 719317ed91 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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 12:13:23 +02:00
Simone d73c7ff0ff 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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 12:13:22 +02:00
Simone 9972010230 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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 12:08:57 +02:00
Simone fde084ed37 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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 11:57:08 +02:00
Simone 2ccc9009ff feat(scripts): add Set-CIGuestCredential.ps1
Lint / pssa (push) Failing after 36s
Lint / python (push) Successful in 40s
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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 11:56:40 +02:00
Simone 5371ffe48a 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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 11:56:40 +02:00
Simone 934c3fd3f2 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.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 02:51:36 +02:00
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