Skip to content

Phase 4: CLI sh+ps1 pair, delete last bash, Windows CI, docs sweep#17

Merged
karlkauc merged 2 commits into
mainfrom
feat/cli-pair-windows-ci
May 16, 2026
Merged

Phase 4: CLI sh+ps1 pair, delete last bash, Windows CI, docs sweep#17
karlkauc merged 2 commits into
mainfrom
feat/cli-pair-windows-ci

Conversation

@karlkauc

Copy link
Copy Markdown
Contributor

Why

Phase 4 of 4 — completes the standalone & cross-platform initiative. Removes the last bash plumbing, gives the CLI examples a Windows counterpart, and adds a windows-latest CI job that actually proves the whole point: every example runs on a clean Windows box with no bash and no prior tool step.

What changed

  • tools/fetch-schema.sh deleted — the last bash plumbing script. CI materialises the cache cross-platform via python -m fundsxml_schema (the Phase-2 module); the Python venv install moved ahead of it and the duplicate venv step removed.
  • CLI pair (didactic, self-resolving):
    • XSD_Validation/cli/validate.sh rewritten as POSIX sh (no bash-isms) — resolves the schema itself ($FUNDSXML_SCHEMA_DIR.schema-cache/curl -L 302 + xmldsig sibling) then xmllint.
    • new XSD_Validation/cli/validate.ps1 — Windows: xmllint if present, else the built-in .NET System.Xml.Schema.
    • XML_Signature/cli/sign-verify-xmlsec1.sh → POSIX sh; new sign-verify.ps1 forwards to the .NET example on Windows.
  • XSD_Validation/powershell/Validate-FundsXml.ps1 now self-resolves too (was the last thing pinned to fetch-schema.sh).
  • GenerateTestKey.java also emits test-signing-key.pem (PKCS#8, pure JDK from the loaded PKCS#12) — closes the Phase-1-deferred openssl/PEM gap so the xmlsec1/signxml reference examples have a cross-platform key source. Verified the PEM is a valid key.
  • CI: new windows-smoke job (windows-latest, pwsh) — Python, Java (mvnw.cmd), .NET, the PowerShell CLI, and a DB round-trip, all standalone & self-resolving on Windows. New ubuntu CLI step exercises validate.sh (positive + negative).
  • Docs swept end-to-end: every FundsXML_Files/** README, Data_Binding_JSON, Database_Integration, XSD_Validation, CONTRIBUTING, root README, .github templates — all moved off fetch-schema.sh onto the in-language resolvers / python -m fundsxml_schema.

The only .sh files left are the two didactic CLI examples, each paired with a .ps1. No bash prerequisite anywhere.

Verification

Locally: validate.sh under dash (cache-hit / $FUNDSXML_SCHEMA_DIR / negative exit 1 / cold download); GenerateTestKey emits a test-signing-key.pem that openssl pkey accepts; python -m fundsxml_schema caching; ci.yml parses (jobs validate + windows-smoke). The windows-smoke job itself is exercised by CI on this PR (first real Windows run).

With this merged, all 4 phases are done: every example is standalone and cross-platform (Windows + Linux/macOS), using each language's idiomatic build system.

🤖 Generated with Claude Code

karlkauc and others added 2 commits May 16, 2026 09:25
Final phase of the standalone/cross-platform initiative.

- tools/fetch-schema.sh DELETED (the last bash plumbing). CI now
  materialises the cache cross-platform via `python -m fundsxml_schema`
  (Phase-2 module); the Python venv install moved before it and the
  duplicate venv step removed.
- XSD_Validation/cli/validate.sh rewritten as POSIX sh (no bash-isms):
  self-resolving 3-step schema (env -> .schema-cache -> curl -L 302 +
  xmldsig sibling) then xmllint. New validate.ps1 Windows counterpart
  (xmllint if present, else the built-in .NET System.Xml.Schema).
- XML_Signature/cli/sign-verify-xmlsec1.sh -> POSIX sh; new
  sign-verify.ps1 (forwards to the .NET example on Windows).
- XSD_Validation/powershell/Validate-FundsXml.ps1 now self-resolves too
  (was the last thing pinned to fetch-schema.sh).
- GenerateTestKey.java also emits test-signing-key.pem (PKCS#8, pure JDK
  via the loaded PKCS#12) — closes the Phase-1-deferred openssl/PEM gap so
  the xmlsec1 / signxml reference examples have a cross-platform key
  source. Verified the PEM is a valid private key.
- CI: new `windows-smoke` job (windows-latest, pwsh) proving Python, Java
  (mvnw.cmd), .NET, the PowerShell CLI and a DB round-trip all run
  standalone & self-resolving on Windows. New ubuntu CLI step exercises
  validate.sh (positive + negative).
- Docs swept end-to-end: every FundsXML_Files README, Data_Binding_JSON,
  Database_Integration, XSD_Validation, CONTRIBUTING, root README,
  .github templates, CLAUDE.md — all off fetch-schema.sh onto the
  in-language resolvers / `python -m fundsxml_schema`.

Only `.sh` remaining: the two didactic CLI examples, each paired with a
`.ps1`. No bash prerequisite anywhere; every example is standalone and
cross-platform.

Verified locally: validate.sh under dash (cache/env/negative/cold),
GenerateTestKey emits a valid PEM key, `python -m fundsxml_schema`
caching, ci.yml is well-formed YAML (validate + windows-smoke jobs).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
GitHub's pwsh wrapper exits each step with the last $LASTEXITCODE. The
negative (must-fail) cases leave it at 1, so steps failed even though the
logic succeeded (positive VALID + negative correctly INVALID, both shown
in the log). End each windows-smoke step with an explicit 'exit 0'.

The ubuntu 'validate' job was already green; only the new windows-smoke
job was affected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@karlkauc karlkauc merged commit 11cbc79 into main May 16, 2026
4 checks passed
@karlkauc karlkauc deleted the feat/cli-pair-windows-ci branch May 16, 2026 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant