Skip to content

[Build/CI] Migrate CI scripts from bash to JavaScript with specific, testable improvements #13

@ashleyshaw

Description

@ashleyshaw

Build/CI Summary

Expand and clarify the migration to JavaScript-based CI/automation scripts by listing the mandatory, measurable improvements and explicit outputs the team must deliver.

Specific CI Improvements

  • Replace brittle bash scripts (CI entrypoints, version sync, environment setup and teardown) with maintainable JavaScript tools.
  • Isolate all test and build scripts so they may execute in CI, local dev, or ephemeral environments (no hardcoded paths / platform assumptions).
  • Add robust error handling, clear exit codes, and detailed logging to all scripts for faster diagnosis and more actionable feedback in CI runs.
  • Ensure scripts automatically sanitise/validate all external input and escape outputs (for env, shell, and config writes).
  • Standardise Node.js script entrypoints to support cross-platform use (npx, node, or package.json scripts) and support repo-standard CLI arguments.
  • Script output (esp. build artefacts or logs) must pipe cleanly to CI consumers and commit hooks without formatting/unexpected file writes.
  • Remove dependency on system-installed Unix tools (e.g. sed/awk/grep). If tiny POSIX utility is required, use a vetted Node.js equivalent instead (document justification in code).
  • Where applicable, add dry-run and verbose flags for safe scripting/experimentation in CI or PR checks.
  • Add or update unit/integration tests so scripted steps run in parallel on supported CI runners (Windows/macOS/Linux), with output artefacts and side effects verified in repo-specific test jobs.
  • Update CI docs, CONTRIBUTING, and developer onboarding docs to point only at JS-based scripts, including usage examples and common troubleshooting.

Expected Deliverables

  • All required bash scripts replaced and removed from repo.
  • JavaScript scripts present in /scripts (or similar), following repo structure.
  • All affected CI workflow YAMLs (GitHub Actions, etc) refactored to use new scripts.
  • All scripts pass linting/format checks; tested on all supported CI runners.
  • Documentation updated and verified.
  • Sample logs and artefact outputs attached to PR or referenced in docs.
  • Change summary and rationale documented for reviewer sign-off.

Steps / Checklist

  • Replace all CI bash scripts with JavaScript tools (see above)
  • Enforce script validation (input sanitisation, contextual escaping)
  • Write/expand CI tests to validate outputs, logging, and cross-platform support
  • Refactor all affected workflows and docs to remove obsolete shell script references
  • Documentation updated (usage, troubleshooting, compatibility)
  • PR uses correct branch prefix (ci/ or build/)

Acceptance Criteria

  • All listed CI outputs delivered: scripts, docs, test coverage, logs
  • Bash scripts and workflow shims removed from all automated paths
  • All scripts linted, pass tests, and CI green on all platforms
  • Approach approved by maintainers

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions