-
Notifications
You must be signed in to change notification settings - Fork 289
Add Remote Config conditions to template #489
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
Conversation
f0b1306
to
1a878a1
Compare
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.
Looks great. Just a few nits.
* @param name A non-null, non-empty, and unique name of this condition. | ||
* @param expression A non-null and non-empty expression of this condition. | ||
*/ | ||
public Condition(@NonNull String name, @NonNull String expression) { |
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.
I think we need a constructor that accepts the color as well.
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.
Added a constructor with color. Should we amend the API proposal as well?
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.
Feel free to include a note. Looks like an oversight if it's not already there.
src/test/java/com/google/firebase/remoteconfig/FirebaseRemoteConfigClientImplTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/google/firebase/remoteconfig/FirebaseRemoteConfigClientImplTest.java
Outdated
Show resolved
Hide resolved
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.
It's getting there. Lets add some more tests, and clean up the implementation logic a bit.
* @param name A non-null, non-empty, and unique name of this condition. | ||
* @param expression A non-null and non-empty expression of this condition. | ||
*/ | ||
public Condition(@NonNull String name, @NonNull String expression) { |
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.
Feel free to include a note. Looks like an oversight if it's not already there.
* @param expression A non-null and non-empty expression of this condition. | ||
* @param tagColor A non-null tag color of this condition. | ||
*/ | ||
public Condition(@NonNull String name, @NonNull String expression, @NonNull TagColor tagColor) { |
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.
TagColor should be nullable.
src/test/java/com/google/firebase/remoteconfig/FirebaseRemoteConfigClientImplTest.java
Show resolved
Hide resolved
fc3ca65
to
128838e
Compare
128838e
to
6d2a377
Compare
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.
Thanks. LGTM!
|
||
import org.junit.Test; | ||
|
||
public class ConditionTest { |
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.
I think this could be a good place to add more Condition class specific tests (constructors, getter, setters etc). But feel free to add them in future PRs.
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.
Good call. This makes me wonder... should we add test classes for all other types, too?
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 sense to me.
Hi @egilmorez! Please take a look at the docs when you get a chance. Thank you! |
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.
LG! Possible nits about clarifying color/display.
* | ||
* @param name A non-null, non-empty, and unique name of this condition. | ||
* @param expression A non-null and non-empty expression of this condition. | ||
* @param tagColor A tag color of this condition. |
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.
I wonder if we might even want to clarify that this affects how the condition is displayed in the parameter list in the Firebase console. That's true, right? Outside the console, it is irrelevant?
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.
Ah kind of like you did for the setter below. Do you agree it would be good in both places? For creating and setting; not so much for getting I think.
-
The color associated with this condition for display purposes in the Firebase Console.
- Not specifying this value results in the console picking an arbitrary color to associate
- with the condition.
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.
Good call! I updated the docs here. Thanks!
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.
Thanks Lahiru!
Related Issue: #446