Repository navigation
feat(analytics-events): make events.toml writable without Kotlin - #1547
Merged
bmc08gt merged 6 commits intoSep 24, 2026
Merged
Conversation
…d types An events.toml entry is now an [[event]] with a domain, the event name, and properties typed as text, yes/no, count, decimal, duration or a list name. The generator derives the builder name from the event name, each parameter name from its property key, and the parameter order from where the properties sit. builder, param and order override what is derived. Value enums move to [lists.X] with a description. The old domains.*.events, params and enums shape is gone. Error messages name the event and say what to change in the file.
Every entry is now an [[event]] with a domain, the event name and typed properties. builder is set on the 14 entries whose name doesn't give the builder they had, param on Cash Link Choice, Fiat and Owner Public Key, and order on Grab Bill and Send Cash Link. The value lists move to their own section at the top. The outcome group's comment moves from above [counters] to the group. The header now explains the format to someone who doesn't write Kotlin, with the engineer steps in their own paragraph. The generated sources are byte-identical to the ones the old schema produced.
Eight lists had no description. Each now says which property or event name carries it. The generated enums gain the same text as KDoc; nothing else in the generated sources changes.
EVENTS.md lists every event with a table of its properties: the key, the type in events.toml's own words, whether it's optional, and the list it draws from. Lists, the amount group, drift notes and people counters get sections of their own. Two builders that send one name share a heading, so the name has one anchor to link to. The page is checked in. writeAnalyticsEventsPage rewrites it, and checkAnalyticsEventsPage, now part of flipcashTestDebug, fails with the command to run when the page and events.toml disagree.
The form asks for the event name, when it's sent, its properties with a type word and an example value, the platforms and why it's needed. Its intro says it's optional: anyone can edit events.toml in a pull request instead. It applies an analytics label, which the repo doesn't have yet; GitHub skips a form label that doesn't exist.
This repo is public, and GitHub can't limit an issue template to org members, so anyone could have filed requests through it. To add or change an event, edit events.toml in a pull request; the header says to ask an engineer otherwise. EVENTS.md and its generator no longer mention the form.
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.
Stacked on #1538. The base retargets to
code/cashonce #1538 merges.In #1538,
events.tomlcould only be written by someone who reads Kotlin. Each entry named its builder, typed each parameter as a Kotlin type, and listed properties by parameter. This PR changes the file so anyone who knows what they want to track can add an event.The new entry shape
text,yes/no,count,decimal,duration(milliseconds, with a…Millisparameter), or the name of a list.optional = truemakes the parameter nullable.Domain:prefix dropped. Each parameter name is its key in camelCase.builder,paramandordercover the cases where derivation doesn't fit. Of the 44 events, 14 setbuilder, and 3 properties setparam(choice,price,owner). OnlygrabBillandsendCashLinksetorder.[lists.X]tables, each with a description. The old schema is gone rather than kept alongside.When an entry is wrong, the build stops with a message that names the event and says what to change. For example, a mistyped type word lists the words that are allowed.
What didn't change
The generated Kotlin is byte-identical to what #1538 generates. The one exception is KDoc on the eight lists that had no description before. The 38 event tests and the SharedCoreKit tests are unedited.
EVENTS.md
libs/analytics-events/EVENTS.mdis generated from the catalogue and checked in, so the events can be read on GitHub without reading TOML. It has a table per event (key, type, optional, list), plus the lists, theamountgroup, drift notes and people counters. Two builders that send one name ("Deeplink: Parse") share a heading, so the name has one anchor to link to.checkAnalyticsEventsPageis now part offlipcashTestDebug. It fails when the page andevents.tomldisagree, and the failure message gives the command to regenerate the page.