mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 02:11:28 +00:00
* fix(ci): breaking-change-guard handles \${VAR:-default} compose image syntax (REV12)
The sed 's/:.*//' pattern truncated at the first colon in the
\${CCS_IMAGE:-ghcr.io/...} expression, yielding "\${CCS_IMAGE" as the
image name instead of the actual registry path. Any change to the default
image namespace was therefore undetectable.
Introduce extract_image_name() that first strips the \${VAR:-default}
wrapper with a sed -E expression, then strips only the trailing :tag
suffix using a pattern that preserves internal colons (e.g. registry:5000/
owner/repo). Applied to both OLD_RAW and NEW_RAW extraction paths.
* fix(ci): breaking-change-guard runs on ubuntu-latest to cover forked PRs (REV13)
The trusted-author gate (COLLABORATOR|MEMBER|OWNER) caused forked-PR
contributors to bypass the breaking-change check entirely. A forked
contributor could rename services.ccs or change the image namespace
without a feat!/fix! marker and the guard would never run.
This workflow is a documented exception to the self-hosted-first policy:
it performs ONLY pure YAML diff parsing (git show / awk / sed). No build,
install, or arbitrary PR-branch scripts are executed. The checkout uses
persist-credentials: false. There is no untrusted code execution, so
ubuntu-latest is safe and necessary for universal fork coverage.
Update self-hosted-runner-policy.test.ts to:
- Introduce GITHUB_HOSTED_RUNNER_EXCEPTIONS registry with required
justification comments for each entry
- Skip exception workflows in the "keeps active workflows on local runners"
and "gates pull-request workflows" assertions
- Add a new "documented exceptions use github-hosted runners" test that
verifies each exception entry actually uses a GitHub-hosted runner
(prevents stale entries accumulating without cleanup)
CCS Test Suite
Organization
tests/
├── unit/ # Module unit tests (Mocha)
│ ├── glmt/ # Legacy GLMT transformer/internal compatibility tests
│ └── delegation/ # Delegation module tests
├── npm/ # npm package tests (Mocha)
├── native/ # Native installation tests (bash/PowerShell)
│ ├── unix/ # Unix/Linux/macOS tests
│ └── windows/ # Windows PowerShell tests
├── integration/ # Integration + smoke tests
└── shared/ # Shared utilities
├── fixtures/ # Test configuration and environment
├── unit/ # Helper function tests
├── helpers.sh # Bash test utilities
└── test-data.js # Test data for npm tests
Running Tests
bun run test # All automated tests (unit + integration + npm)
bun run test:unit # Unit tests only
bun run test:npm # npm package tests
bun run test:native # Native Unix tests (bash)
Test Categories
Unit Tests (unit/)
Module-level tests using Mocha framework:
unit/glmt/- Legacy transformer internals kept for Cursor translation compatibilityunit/delegation/- Permission mode, session manager, result formatter
npm Tests (npm/)
npm package functionality tests using Mocha:
postinstall.test.js- Postinstall behaviorcli.test.js- CLI argument parsingcross-platform.test.js- Cross-platform compatibilityspecial-commands.test.js- Integration tests
Native Tests (native/)
Installation tests for curl|bash (Unix) and irm|iex (Windows):
native/unix/edge-cases.sh- Unix edge case testsnative/windows/edge-cases.ps1- Windows edge case tests
Integration Tests (integration/)
Integration and smoke coverage for scenarios that exercise multiple layers:
- Automated
*.test.tsfiles run as part ofbun run test:alland CI - Shell and standalone probe scripts remain on-demand for targeted debugging
cursor-daemon-lifecycle.test.ts- local daemon process + HTTP smoke coverageimage-analyzer-hook.test.ts- hook integration coverageglmt-integration-test.sh- legacy GLMT compatibility smoke probesymlink-chain-test.sh- Symlink chain handlingux-integration-test.sh- CLI UX integration
Adding New Tests
- Unit tests: Add to
unit/<module>/for isolated module behavior - npm tests: Add to
npm/for package behavior - Native tests: Add to
native/unix/ornative/windows/ - Integration tests: Add automated cross-layer smoke coverage to
integration/*.test.ts