Files
coralogix__cx-cli/contributing/development.md
Yonatan Beker 36ab13781e docs: add DP validation guidelines, rename contributor dir, skip CI for docs-only PRs (#66)
## Summary

- **DataPrime validation guidelines**: Added a "Validating a DataPrime
query" section to `skills/shared/dataprime-reference.md` (synced to
cx-alerts, cx-create-dashboard, cx-telemetry-querying); clarified that
DataPrime verification uses a fixed `now-15m` window (not the
dashboard's `$RANGE`), and detailed pass/hard-fail/soft-fail semantics
including `keypath does not exist` handling
- **Rename `contributor/` → `contributing/`**: Renamed the directory for
consistency and updated all references across CLAUDE.md,
CONTRIBUTING.md, and `.claude/skills/add-skill/SKILL.md`
- **Skip CI for docs-only changes**: Added `paths-ignore` to build,
lint, and test workflows so PRs touching only `skills/`, `docs/`,
`contributing/`, or `*.md` files don't trigger Rust CI

---------

Co-authored-by: Niv Hertz <46317590+niv-hertz@users.noreply.github.com>
2026-05-05 12:07:52 +00:00

2.0 KiB

Development

Build and test

cargo build                         # Dev build
cargo build --release               # Release build (stripped, LTO)
cargo fmt                           # Format code
cargo clippy                        # Lint
cargo test                          # Run all tests
cargo test -- --ignored             # Run integration tests (system keyring required)
cargo run -- <args>                 # Run CLI in dev mode

Rust toolchain is pinned to 1.94.1 via rust-toolchain.toml.

Before submitting a PR, verify:

  • cargo fmt --check is clean
  • cargo clippy produces no warnings
  • cargo test passes

End-to-end tests

The tests/e2e/ suite invokes the compiled cx binary against a real Coralogix test team, sanity-checking every command and subcommand. All e2e tests are #[ignore]d, so the default cargo test run skips them.

Set credentials one of two ways:

# Option A - environment
export CX_API_KEY=cxtp_...
export CX_REGION=stg1

# Option B - .env file in the repo root (gitignored)
cp .env.example .env
# edit values

Then run:

cargo test --test e2e -- --ignored --test-threads=1

Tests skip gracefully (with a [e2e] skipping ... log line) when credentials are absent, or when the test team has no data for a discovery step (e.g. no alerts to fetch). The suite is read-only against the test team - mutating commands (alerts create, alerts enable/disable) are intentionally not covered.

CI runs the suite on every push to master and via manual workflow_dispatch (see .github/workflows/e2e.yml).

DataPrime documentation bundle

The cx dataprime subcommands read command and function help from assets/dataprime_docs.yaml, which is compiled into the binary at build time via include_str! in src/commands/dataprime/mod.rs. Nothing is loaded from disk at runtime.

Architecture

See architecture.md for the execution flow, command archetypes, error handling, and module map.