Skip to content

feat(segkit): add Rust CLI skeleton with testing and CI#50

Merged
abueide merged 3 commits into
chore/ci-workflow-splitfrom
feat/segkit-skeleton
May 1, 2026
Merged

feat(segkit): add Rust CLI skeleton with testing and CI#50
abueide merged 3 commits into
chore/ci-workflow-splitfrom
feat/segkit-skeleton

Conversation

@abueide

@abueide abueide commented May 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Scaffold the segkit Rust CLI — barebones hello-world with clap, ready for incremental implementation
  • Add full CI pipeline: rustfmt, clippy (-D warnings), and cargo test as a new parallel job in pr-checks.yml
  • Add devbox scripts (segkit:build, segkit:test, segkit:clippy, segkit:fmt, segkit:check)
  • Add Rust toolchain (cargo, rustfmt, clippy) to root devbox packages

What's in the skeleton

segkit/
├── src/
│   └── main.rs       # clap CLI that prints version
├── tests/
│   └── cli.rs        # 3 integration tests (no-args, --help, --version)
├── Cargo.toml
└── Cargo.lock

CI changes

  • New "Segkit CLI" job in pr-checks.yml (fmt check + clippy + cargo test)
  • Removes system rustup on Ubuntu runners to avoid conflict with Nix-managed Rust
  • Added to status-check gate

Test plan

  • devbox run segkit:check passes locally (fmt + clippy + 3 tests)
  • devbox run lint passes (treefmt unchanged)
  • CI all green on previous push

🤖 Generated with Claude Code

abueide and others added 3 commits May 1, 2026 15:42
Scaffold the segkit CLI tool — a Rust-based toolkit for Segment SDK
project generation and bug reproduction workflows. This is the
structural skeleton with command parsing, SDK registry, and utility
modules, ready for implementation.

Skeleton structure:
- commands/: init and repro subcommands with clap argument parsing
- sdks/: SDK registry with metadata for Swift, Kotlin, React Native
- utils/: external CLI detection, git ref resolution (ls-remote)

Testing:
- 10 unit tests (registry validation, version sorting, CLI detection)
- 9 integration tests (CLI argument parsing, help output, error cases)

Infrastructure:
- Rust toolchain (cargo, rustfmt, clippy) added to root devbox.json
- treefmt.toml: rustfmt and clippy formatters for segkit/src/**/*.rs
- CI: new "Segkit CLI" job in pr-checks.yml (fmt + clippy + test)
- devbox scripts: segkit:build, segkit:test, segkit:clippy, segkit:fmt,
  segkit:check
- .gitignore: **/target/ for Rust build artifacts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Ubuntu CI runners have a pre-installed ~/.rustup toolchain that
conflicts with the Nix-managed Rust from devbox. When devbox's cargo
invokes clippy/rustfmt, the system rustup intercepts and tries to
sync components, causing file rename errors.

Fixes:
- Remove system rustup in the Segkit CI job before running devbox
- Remove rustfmt/clippy from treefmt.toml — they are project-level
  tools that don't fit treefmt's per-file model and were triggering
  the same rustup conflict in the Lint job. Rust checks now run
  exclusively in the dedicated Segkit CLI CI job.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove all command implementations (init, repro), SDK registry,
and utility modules. Keep only a minimal clap CLI that prints
the version — clean foundation for incremental implementation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@abueide abueide force-pushed the feat/segkit-skeleton branch from cd3298e to 6c3865d Compare May 1, 2026 20:42
@abueide abueide changed the base branch from main to chore/ci-workflow-split May 1, 2026 20:42
@abueide abueide merged commit 9ce2414 into chore/ci-workflow-split May 1, 2026
18 checks passed
@abueide abueide deleted the feat/segkit-skeleton branch May 8, 2026 20:35
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