Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typed properties for analytics events #823

Merged
merged 75 commits into from
Oct 11, 2018

Conversation

guperrot
Copy link
Member

@guperrot guperrot commented Oct 3, 2018

Feature needs ingestion to be deployed to prod before merge.

@coveralls
Copy link

coveralls commented Oct 3, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling 65405fb on feature/event-typed-properties into 6eaf73b on develop.

@guperrot guperrot changed the title Work in progress for event typed properties Add typed properties for Analytics.trackEvent Oct 4, 2018
* <ul>
* <li>The event name needs to match the [a-zA-Z0-9]((\.(?!(\.|$)))|[_a-zA-Z0-9]){3,99} regular expression.</li>
* <li>The baseData and baseDataType properties are reserved and thus discarded.</li>
* <li>The full event size when encoded in JSON cannot be larger than 1.9MB.</li>
Copy link
Contributor

Choose a reason for hiding this comment

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

The full event size when encoded in JSON to JSON string cannot be larger than 1.9MB.

* For OneCollector:
* <ul>
* <li>The event name needs to match the [a-zA-Z0-9]((\.(?!(\.|$)))|[_a-zA-Z0-9]){3,99} regular expression.</li>
* <li>The baseData and baseDataType properties are reserved and thus discarded.</li>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use "baseData" and "baseDataType"? We need to wrap reserved keyword in quotes.

@guperrot guperrot reopened this Oct 9, 2018
@guperrot guperrot closed this Oct 9, 2018
@guperrot guperrot reopened this Oct 9, 2018
thyeggman
thyeggman previously approved these changes Oct 10, 2018
if (!super.equals(o)) {
return false;
}
if (this == o) return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

I really don't like one-line IF statements. I know it's just the equals method but this makes my skin crawl in a bad way.

Copy link
Member Author

@guperrot guperrot Oct 10, 2018

Choose a reason for hiding this comment

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

This is generated code ;)
For equals/haschode, we just use the IDE to generate or regenerate when we add or remove a field.

if (key.length() > MAX_PROPERTY_ITEM_LENGTH) {
message = String.format("Typed property '%s' : property key length cannot be longer than %s characters. Property key will be truncated.", key, MAX_PROPERTY_ITEM_LENGTH);
AppCenterLog.warn(LOG_TAG, message);
property.setName(key.substring(0, MAX_PROPERTY_ITEM_LENGTH));
Copy link
Contributor

Choose a reason for hiding this comment

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

This should change a copy of the property, not the property itself. Even though they are moved to another array, that array contains references to properties that will be used in other logs as well. (same comment on line 189)

achocron
achocron previously approved these changes Oct 10, 2018
* <p>
* Additional validation rules apply depending on the configured secret.
* <p>
* For AppCenter:
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: AppCenter -> App Center. (Same with OneCollector -> One Collector)

* <p>
* For AppCenter:
* <ul>
* <li>the event name cannot be longer than 256 and is truncated otherwise.</li>
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: these list items should be capitalized (like the ones for OC)

* <p>
* For AppCenter:
* <ul>
* <li>the event name cannot be longer than 256 and is truncated otherwise.</li>
Copy link
Contributor

Choose a reason for hiding this comment

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

Capitalization

* <p>
* Additional validation rules apply depending on the configured secret.
* <p>
* For AppCenter:
Copy link
Contributor

Choose a reason for hiding this comment

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

App Center

* <li>the number of properties per event is limited to 20 (truncated).</li>
* </ul>
* <p>
* For OneCollector:
Copy link
Contributor

Choose a reason for hiding this comment

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

One Collector

* <p>
* Additional validation rules apply depending on the configured secret.
* <p>
* For AppCenter, the name cannot be longer than 256 and is truncated otherwise.
Copy link
Contributor

Choose a reason for hiding this comment

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

App Center

Copy link
Contributor

@achocron achocron left a comment

Choose a reason for hiding this comment

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

Some nit picks

@guperrot
Copy link
Member Author

Ingestion changes are in prod.

@jaeklim jaeklim merged commit e0345f3 into develop Oct 11, 2018
@jaeklim jaeklim deleted the feature/event-typed-properties branch October 11, 2018 22:59
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.

None yet

8 participants