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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track const config values in analytics #10120

Merged
merged 17 commits into from Feb 17, 2022
Merged

Conversation

edgao
Copy link
Contributor

@edgao edgao commented Feb 4, 2022

What

Closes #9618

How

JobTracker now uses the config spec to determine which values are const, and inserts them into the event metadata appropriately.

Notably:

  • Nested config objects will recursively pull the schema out of the properties field
  • oneOf schemas are manually matched against the config. This is pretty inefficient - a deeply-nested config with many oneOfs would match the "leaf" nodes many times. But that doesn't seem likely to actually happen.

Recommended reading order

  1. JobTracker - take a look at mergeMaps, flatten, and then the two configToMetadata methods. Then read the rest of the file
  2. JobTrackerTest + example_config.json / example_config_schema.json - start with testConfigToMetadata; everything else is just to fix the mocked ConfigRepository objects

馃毃 User Impact 馃毃

Nope

@github-actions github-actions bot added area/platform issues related to the platform area/scheduler labels Feb 4, 2022
@edgao edgao force-pushed the edgao/analytics_const_tracking branch from d58a337 to f3e8b8b Compare February 5, 2022 00:14
@edgao edgao temporarily deployed to more-secrets February 5, 2022 00:17 Inactive
@edgao edgao temporarily deployed to more-secrets February 5, 2022 00:22 Inactive
@edgao edgao marked this pull request as ready for review February 5, 2022 00:49
Comment on lines 231 to 232
// Note: this doesn't handle additionalProperties, so if a config contains properties that are not
// explicitly declared in the schema, they will be ignored.
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be worth reporting the names of additionalProperties not declared in the schema instead of ignoring them?

If we studied the metadata sent to segment on those, we could have a sense of what's missing in the connector specs maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

realized that I might as well just handle additionalProperties in a smarter way, can you take a look at this? e74066d#diff-8ef120819d2dd157a1e8d1838a49917772872273fefb9719b56aa303174581abL235-R261

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM!

@edgao edgao temporarily deployed to more-secrets February 9, 2022 01:14 Inactive
@edgao edgao merged commit 07e2232 into master Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/platform issues related to the platform area/scheduler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Analytics should track value of const fields in connector configurations
2 participants