-
Notifications
You must be signed in to change notification settings - Fork 1
Fix/telemetry #13
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
base: main
Are you sure you want to change the base?
Fix/telemetry #13
Conversation
RUBY_TO_API_KEY_MAPPING = T.let({ | ||
'enabled' => 'is_enabled' | ||
}.freeze, | ||
T::Hash[String, String]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in order to be more idiomatic for ruby, while using the required Mastra API prop. I explored putting it directly in the camelized options with an if clause, but if in the future we adapt other API methods that are not idiomatic for Ruby, this way we just add it to the hash.
I'm changing this because before we had the is_enabled, which was the Mastra prop name, but you told me to use enabled to be more idiomatic ( which I think is a good tip tbh ).
Any other approach you think would be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sorry. What I mean is that this feels very complex just for one particular case. When you pass the telemetry settings to the options, couldn't the settings itself know how to serialize themselves (so returning a hash with is_enabled) instead of having the client know about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes hella more sense, yup, ty
🚪 Why?
This Pull Request addresses feedback from a previous PR by refining the implementation and aligning it with requested changes. The goal is to improve code clarity, idiomatic usage, and test coverage.
🔑 What?
This PR introduces the following changes based on reviewer comments:
is_enabled
toenabled
for a more idiomatic Ruby style.contexts
to the telemetry settings specs to improve tests behavior.🏡 Context