Skip to content

Support optional people properties in Kotlin generator - #39

Merged
mrstif merged 6 commits into
mainfrom
nc/optional-properties
Oct 13, 2026
Merged

mrstif merged 6 commits into
mainfrom
nc/optional-properties

Conversation

@nunocruz19

@nunocruz19 nunocruz19 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • AnalyticsProperty.innerValue is now Any? instead of Any, so people properties can carry null values.
  • Optional special properties (e.g. WearableAppPlatform?) are generated as innerValue = value?.key instead of value.key, which did not compile for nullable types. This matches how optional event properties are already handled.
  • Optional native types (e.g. Long?) keep innerValue = value.

Generated output example

data class PreviousWearPlatform(
    val value: WearableAppPlatform?,
) : AnalyticsProperty(
    property = AnalyticsProperties.PREVIOUS_WEAR_PLATFORM,
    innerValue = value?.key,
)

Notes

  • Also syncs the csv (~> 3.0) dependency in Gemfile.lock with the gemspec, which the 0.9.0 bump missed.

Test plan

  • kotlin_generator_spec.rb: wear_platform is now optional (WearableAppPlatform?) and generates innerValue = value?.key
  • bundle exec rspec: 121 examples, 0 failures

🤖 Generated with Claude Code

nunocruz19 and others added 3 commits October 13, 2026 11:35
AnalyticsProperty.innerValue is now Any? and optional special
properties are read with value?.key instead of value.key, matching
how optional event properties are already handled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Make the existing wear_platform entry optional instead of adding
new entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also syncs the csv dependency in Gemfile.lock with the gemspec.

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

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.

🟡 Changes recommended

Nullable native and non-null special-property branches need direct test coverage.

1 open finding
What changed in this PR

Adds nullable people-property support to the Kotlin generator.

Changes:

  • Generates nullable values and safe enum-key access.
  • Updates generator coverage and release metadata.
  • Synchronizes the CSV dependency constraint.
File Description
lib/​evva/​kotlin_generator.rb Generates appropriate value accessors.
lib/​evva/​templates/​kotlin/​people_properties.kt Allows nullable property values.
spec/​lib/​evva/​kotlin_generator_spec.rb Covers nullable special properties.
lib/​evva/​version.rb Bumps the release to 0.10.0.
Gemfile.lock Synchronizes version and CSV constraints.
changelog.md Documents nullable Kotlin support.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/evva/kotlin_generator.rb
Releases are cut outside of feature PRs. The changelog entry stays
under Unreleased, and Gemfile.lock keeps the csv (~> 3.0) sync with
the gemspec.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nunocruz19
nunocruz19 marked this pull request as ready for review October 13, 2026 11:18
nunocruz19 and others added 2 commits October 13, 2026 12:20
Adds a non-null enum property (value.key) and makes rounds_with_wear
a nullable native type (value), so every value-fetching path in the
people properties generator is exercised.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nunocruz19
nunocruz19 requested review from mrstif and a balanced review from Copilot October 13, 2026 11:24

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.

🟢 Approval recommended

The focused implementation matches existing event-generation behavior and is adequately covered by generator tests.

1 open finding

🧠 Review effort: Balanced

@mrstif
mrstif merged commit 5007998 into main Oct 13, 2026
7 checks passed
@mrstif
mrstif deleted the nc/optional-properties branch October 13, 2026 11:29
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