Repository navigation
feat(analytics): hierarchical groups support - #176
Draft
tylerjroach wants to merge 20 commits into
Draft
tylerjroach wants to merge 20 commits into
tylerjroach wants to merge 20 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…erarchical groups trackers $add, $append and $merge were warned about and still sent. They now raise Mixpanel::UnsupportedOperationError before anything is sent, like the people operations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y profile API Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…clients The company profile is updated through the existing group methods instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings back the company profile methods in place of inferring the company from $company_id group writes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Identity#to_flag_context puts the ids under the keys flags read, the groups at the top level and the custom properties under custom_properties, so callers do not hand-write $user_id and $company_id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tracker A people update through a tracker bound with for_company used the identity's company and ignored the bound one, so a mismatched identity silently updated the other company's user. The bound tracker now gets its own Mixpanel::People that raises ArgumentError and sends nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…al groups An identity with a user id but no company or device id threw on every call. It is valid to send, like a plain distinct id, so events now send it as given. User profile updates still need the company and fail with the existing company-required error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r SDKs Add Mixpanel::MixpanelIdentity as an alias of Mixpanel::Identity, the name every other SDK uses. Make UnsupportedOperationError and CompanyRequiredError extend MixpanelError so rescuing MixpanelError catches them; they are raised before any send, so they still reach the caller rather than the ErrorHandler. Mark Identity#to_properties and the People/Groups for_company helpers :nodoc:. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Medium impact] The latest update appears safe to merge. Reviews (8) · Last reviewed commit: "fix: copy the company id passed to for_c..." · Reviewed by Greptile |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #176 +/- ##
==========================================
+ Coverage 97.41% 98.23% +0.81%
==========================================
Files 16 17 +1
Lines 889 1131 +242
==========================================
+ Hits 866 1111 +245
+ Misses 23 20 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…hierarchical groups On a for_company tracker, a user profile update for an identity with no company now uses the bound company, which also wins over a $company_id in optional_params. An empty $company_id no longer counts as a company in the CompanyRequiredError check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Exclude "{" from the placeholder capture so a template full of "{" can't
make matching slow (CodeQL polynomial regular expression).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Public docs are the source of truth for hierarchical groups usage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restores master's TypeError for non-Hash input to Groups#update instead of a NoMethodError; output is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… integer ids on hierarchical groups - Exposure events on hierarchical groups keep $user_id when the flag context has no $company_id; the skip rule ($company_id or distinct_id) is unchanged. - Generic people and group updates on hierarchical groups refuse any $-prefixed operation outside $set, $set_once, $unset, $union, $remove and $delete, and allow non-operation keys such as $token and $company_id. - Mixpanel::Identity and for_company accept String and Integer ids and refuse other types with ArgumentError; the bound company is compared as a string. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # lib/mixpanel-ruby/tracker.rb
The bound tracker kept the caller's string, so changing that string later moved the bound company. Copy and freeze it, as Identity does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds hierarchical groups (HG) support: a
MixpanelIdentitycarrying user and company ids, HG-aware profile updates, and company-bound group writes. HG behavior is gated on the SDK's hierarchical groups init flag; projects without it behave as before.Draft, opened for an early automated review. Not ready to merge.
Commits
🤖 Generated with Claude Code