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

Remove scope method from the provider interface #402

Merged
9 commits merged into from
Mar 13, 2017
Merged

Conversation

ghost
Copy link

@ghost ghost commented Mar 11, 2017

@peter-edge mentioned, that using Scope in Provider is very clumsy and we actually don't really need every Provider to implement Scope method, Get should be enough. Users can either use ScopedProvider to create a new scope for a provider or we can add this functionality to the Value. Users can simply call:
config.Get("yarpc").Get("http").Get("port")
instead of
config.Scope("yarpc").Scope("http").Get("port")

@ghost ghost requested a review from bufdev March 11, 2017 08:11
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 91.276% when pulling a33fe48 on alsam-removeConfigScope into d171cfb on alsam-ifaceConfig.

Copy link
Contributor

@ascandella ascandella left a comment

Choose a reason for hiding this comment

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

Huh. Did Scope() used to do something else? Or was it always equivalent to Get()?

CHANGELOG.md Outdated
@@ -1,6 +1,7 @@
# Changelog

## v1.0.0-beta3 (unreleased)
* Remove `Scope` method from the `config.Provider` interface.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe mention why briefly? "because it was unused" or whatever

Copy link
Contributor

Choose a reason for hiding this comment

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

Also this is potentially [BREAKING] right, since people could be calling Scope() in their code?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 91.273% when pulling 6e9a162 on alsam-removeConfigScope into d171cfb on alsam-ifaceConfig.

@ghost
Copy link
Author

ghost commented Mar 12, 2017

Scope supposed to return a provider that appends a prefix to the current provider. We implemented it for every provider differently, but I've changed to use the scoped provider underneath everywhere a couple month ago, and with addition of Get method to Value, we can simply remove the repeated code and method from the interface.

Copy link
Contributor

@madhuravi madhuravi left a comment

Choose a reason for hiding this comment

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

Nice!! Scope always bothered me here, Get is much nicer.

@ghost ghost force-pushed the alsam-ifaceConfig branch from 87d2352 to 4e92ff9 Compare March 13, 2017 21:21
@ghost ghost changed the base branch from alsam-ifaceConfig to master March 13, 2017 22:00
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 91.229% when pulling 8c59350 on alsam-removeConfigScope into 2c88d6f on master.

@ghost ghost merged commit 5653f52 into master Mar 13, 2017
@ghost ghost deleted the alsam-removeConfigScope branch March 13, 2017 22:35
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants