Skip to content

feat(cli): telemetry data-schema+ post-create git init - #10

Merged
chaibuilder-dev merged 2 commits into
mainfrom
feat/cli-telemetry-enhancements
Jul 23, 2026
Merged

feat(cli): telemetry data-schema+ post-create git init#10
chaibuilder-dev merged 2 commits into
mainfrom
feat/cli-telemetry-enhancements

Conversation

@outeredgelab-ankita

Copy link
Copy Markdown
Contributor

Summary

Two changes, one commit each:

Telemetry data & schema

  • Structured error code on every *:finish:error (e.g. MIGRATION_FAILED), propagated to the terminal <cmd>:failed outcome too.
  • Persistent anonymous distinct_id in ~/.config/chaibuilder/id; run_id stays per-run.
  • is_ci in event properties.
  • Command-outcome events <cmd>:done / <cmd>:failed for create/new/switch/check_env.
  • duration_ms on step finishes and outcomes.

New dimensions ride in properties; distinct_id/run_id reuse existing top-level fields — no ingestion-endpoint change required. Persistent id is skipped for opted-out users.

Post-create git init

  • After the app is set up, offers to git init + commit feat: chaibuilder starter setup.
  • Only prompts when git is installed; decline/cancel is a skip and never fails create.
  • Falls back to an inline identity only for the git field(s) not configured.
  • Never stages .env secrets (independent of the template .gitignore); cleans up a half-init .git on failure.
  • Tracked via create:git_init:* events.

Testing

  • 111 unit tests, tsc clean, build clean.
  • cli-e2e: 38/38 — real scaffold → real git init/commit, secrets excluded, telemetry contract asserted end-to-end.

… durations

- Structured `code` on every *:finish:error (errorCode by step; e.g. MIGRATION_FAILED);
  the code is propagated to the terminal <cmd>:failed outcome event too.
- Persistent anonymous distinct_id in ~/.config/chaibuilder/id; run_id stays per-run.
- is_ci carried in event properties.
- Command-outcome events <cmd>:done / <cmd>:failed for create/new/switch/check_env.
- duration_ms on step finishes and on outcome events.

New dimensions ride in `properties`; distinct_id/run_id reuse existing top-level
fields, so no ingestion-endpoint change is required. Persistent id is skipped for
opted-out users. Unifies runSteps cancel handling so a cancel is neither done nor failed.
New initGit step, run after the app is set up:
- Only prompts when git is installed; decline/cancel is a skip and never fails create.
- On confirm: git init + add -A + commit "feat: chaibuilder starter setup",
  supplying a fallback identity only for the field(s) git has none configured for.
- Never stages env secrets (git reset -- .env), independent of the template .gitignore.
- Cleans up a half-initialized .git if the commit fails.
- Telemetry: create:git_init:start / finish:success (committed|declined) /
  finish:error (code GIT_INIT_FAILED), each with duration_ms.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The job was not started because recent GitHub Actions payments have failed or your spending limit needs to be increased.

@chaibuilder-dev
chaibuilder-dev merged commit a1e9e84 into main Jul 23, 2026
1 check failed
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.

3 participants