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

Make the name of the client property in config files more generic. #3071

Merged
merged 1 commit into from
Feb 19, 2016

Conversation

dllh
Copy link
Member

@dllh dllh commented Feb 4, 2016

This lets us reuse the value in places besides its current use in Tracks without just using the Tracks-specific name, which would ultimately become confusing and inaccurate.

The use case that led me to propose this change is that we'd like to be able to send information to the REST API about the client software when fetching information about live chat, so that we can send back info that will route desktop user chats differently than web user chats. Rather than adding some kind of janky user agent or oauth app id check to the REST API, I'd like to send a parameter along with the request that will tell the API how to respond.

Since this client property already exists, I thought I'd rename it to genericize it rather than adding another property with the same value.

I tested by running loading some screens within the client and confirming that Tracks pings landed with the client event property intact.

Of course, now that I look back at blame for the config files to see who to ping for review, I see that @mjangda made pretty much the exact opposite commit in the pre-oss repo (renaming client to tracks_client_prop to be more explicit). Since we now have another use for this property, maybe it's time to be more general now. :)

@dllh dllh added Framework [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 4, 2016
@dllh dllh self-assigned this Feb 4, 2016
@mjangda
Copy link
Member

mjangda commented Feb 4, 2016

My only worry would be someone deciding to change the value without realizing how it's used and breaking all our Tracks events.

Plus, client_prop might be better named as client_slug?

@dllh
Copy link
Member Author

dllh commented Feb 5, 2016

We sure wouldn't want to break all our Tracks events. Do you think the worry there makes it worth adding a new config item that duplicates the values in the current property? Or should we trust people not to blindly change values without considering the ramifications?

I'm not married to client_prop, though client_slug to me implies that there's something like client_title or a similar value as well. I prefer your client_slug to client_prop but wonder if we shouldn't just go back to the original client instead. Or maybe client_do_not_change_value_lightly. ;)

This lets us reuse the value in places besides its current use in Tracks
without just using the Tracks-specific name, which would ultimately
become confusing and inaccurate.
@dllh dllh force-pushed the update/client-prop-name branch from 4ecd891 to 86014ff Compare February 16, 2016 15:28
@dllh
Copy link
Member Author

dllh commented Feb 16, 2016

I've updated to use client_slug instead of client_prop. I'm not too worried about anybody changing the value without realizing how it's used, though maybe I'm not being cautious enough (surely somebody would check for references before changing a name like this).

We could add a new config item if we really want to be safe, but it seems to me like overkill and redundant redundancy. @mjangda what do you think?

@dllh
Copy link
Member Author

dllh commented Feb 19, 2016

Chatted with @robfelty from the data team a bit about this in Slack, and he didn't seem too worried about the risk.

@blowery
Copy link
Contributor

blowery commented Feb 19, 2016

I think this is fine. Code looks good. Makes me wish even more for something like JSON+Comments or YAML for config files.

Might rebase this, as it has a pretty old base?

@blowery
Copy link
Contributor

blowery commented Feb 19, 2016

Code works. Assuming the rebase is clean, 🚢

@blowery blowery added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 19, 2016
dllh added a commit that referenced this pull request Feb 19, 2016
Make the name of the client property in config files more generic.
@dllh dllh merged commit 578e823 into master Feb 19, 2016
@apeatling apeatling deleted the update/client-prop-name branch March 17, 2016 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants