Skip to content

feat(telemetry): auto-enable for repos owned by an allowed org (v0.15.0) - #72

Merged
minarc merged 1 commit into
mainfrom
feat/telemetry-auto-enable-org
Jun 17, 2026
Merged

minarc merged 1 commit into
mainfrom
feat/telemetry-auto-enable-org

Conversation

@minarc

@minarc minarc commented Jun 17, 2026 •

Copy link
Copy Markdown
Contributor

What

Per-project telemetry now auto-enables when the project's repo is owned by an allowed GitHub org (the same GET /user/orgs set used for repo-scoped filtering). Previously every project required an explicit /skillmeter:telemetry enable.

Resolution is centralized in a pure resolveTelemetryGate(optIn, repoOrgOwned) helper (logger.js), reused by both the generic runHook gate and session_start.js so they can't drift:

opt-in setting repo owned by allowed org result
false (explicit disable) any ❌ off — always respected
true (explicit enable) any ✅ on (still subject to repo-scope)
unset (default) yes ✅ auto-enabled
unset (default) no ❌ off (nudge banner as before)

The machine-global kill-switch still overrides everything.

Consent note (please review)

This shifts org-owned repos from opt-in → opt-out (telemetry on by default, user can /skillmeter:telemetry disable). Safeguards: explicit disable always wins; SessionStart prints telemetry auto-enabled — repo owned by allowed org; global kill-switch unaffected. Worth a privacy/legal sign-off before release.

Verification

  • node -c on changed scripts; git diff --check clean
  • Unit test of resolveTelemetryGate — 5/5 (disable-wins, explicit enable, auto-org, non-org skip)
  • E2E (uploads black-holed, no data sent): non-org /tmp → unchanged "not configured"; org repo + unset → SessionStart "auto-enabled", PostToolUse "auto-enabled → logged"

Version

0.14.0 → 0.15.0 (feat, matching the prior feat's minor bump).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Per-project telemetry opt-in with auto-enable for allowed organization repositories.
  • Documentation

    • Added documentation for telemetry opt-in behavior, including supported states and global override mechanism.

Per-project telemetry now resolves in three states via a shared
resolveTelemetryGate() helper so all hooks (and SessionStart) stay in sync:
- explicit disable → off (always respected)
- explicit enable  → on (still subject to the repo-scope filter)
- unset (default)  → auto-enable when the repo's remote belongs to an
                     allowed GitHub org; otherwise stays off

SessionStart surfaces this ("telemetry auto-enabled — repo owned by allowed
org"); run /skillmeter:telemetry disable to opt a matching project out.
Non-org and non-git directories are unchanged. The machine-global
kill-switch still overrides everything.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

Adds resolveTelemetryGate(optIn, repoOrgOwned) to logger.js, which maps opt-in state and repo org ownership into a {capture, mode} decision. This gate replaces simpler boolean checks in both runHook and session_start.js checkOptIn, enabling auto-enable for allowed-org repos. README documents the three states; plugin version bumps to 0.15.0.

Changes

Per-project telemetry gate

Layer / File(s) Summary
resolveTelemetryGate helper and export
skillmeter/scripts/logger.js
Introduces the pure resolveTelemetryGate(optIn, repoOrgOwned) function returning {capture, mode} with four modes (opted_out, opted_in, auto_org, not_enabled), and adds it to module.exports.
runHook and session_start integration
skillmeter/scripts/logger.js, skillmeter/scripts/session_start.js
Wires resolveTelemetryGate into runHook by computing repoScopeDecision earlier and replacing the getTelemetryOptIn !== true check; replaces explicit optIn === true/false branches in session_start.js checkOptIn with a unified gate call, with distinct stderr messages for auto_org vs manual activation.
Documentation and version bump
skillmeter/README.md, skillmeter/.claude-plugin/plugin.json
Adds a README section describing the three telemetry resolution states and global kill-switch override; bumps plugin manifest version from 0.14.0 to 0.15.0.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐇 Hoppity-hop through the telemetry gate,
Three little modes decide capture or wait —
opted_in, auto_org, or quietly still,
The org-owned repos get their auto-enable thrill!
README now tells you just what to expect,
And 0.15.0 ships with full effect. 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and clearly summarizes the main change: auto-enabling telemetry for repos owned by allowed organizations, with the version bump included.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/telemetry-auto-enable-org

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 OpenGrep (1.22.0)

OpenGrep fatal error (exit code 2):
┌──────────────┐
│ Opengrep CLI │
└──────────────┘

�[32m✔�[39m �[1mOpengrep OSS�[0m
�[32m✔�[39m Basic security coverage for first-party code vulnerabilities.

�[1m Loading rules from local config...�[0m
[00.19][ERROR]: Error: exception Glob.Lexer.Syntax_error("malformed glob pattern: missing ']'")
Raised at Glob__Lexer.syntax_error in file "libs/glob/Lexer.mll", line 8, characters 2-26
Called from Glob__Lexer.__ocaml_lex_token_rec in file "libs/glob/Lexer.mll", line 29, characters 26-53
Cal


Comment @coderabbitai help to get the list of available commands and usage tips.

@minarc
minarc merged commit 2ea51c1 into main Jun 17, 2026
1 check was pending
@minarc
minarc deleted the feat/telemetry-auto-enable-org branch June 17, 2026 03:36
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