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
For EXP-3625: Hook up getCoenrollingFeatureIds to NimbusBuilder #5718
For EXP-3625: Hook up getCoenrollingFeatureIds to NimbusBuilder #5718
Conversation
6aafe9a
to
74d995a
Compare
I'm not quite sure if we need these methods on the |
Swift tests are in https://github.com/mozilla/application-services/blob/main/megazords/ios-rust/MozillaTestServices/MozillaTestServicesTests/ There aren’t any specific tests for |
I don't think so. There's no functional reason to have them exposed to the apps. There are tests for the |
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 you should likely remove that test, then land this.
protected fun getCoenrollingFeatureIds(): List<String> = | ||
// This will be changed to use the feature manifest in EXP-3265 | ||
listOf() | ||
protected open fun getCoenrollingFeatureIds(): List<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.
Micronit: I wondered about this. Should this be overridable by subclasses? I'm not sure whether we should or not.
protected open fun getCoenrollingFeatureIds(): List<String> = | |
protected fun getCoenrollingFeatureIds(): List<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.
I personally am leaning towards no considering the FML writes the list out, that being said is there a case where it might be useful for testing (in-apps)?
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 personally am leaning towards no considering the FML writes the list out
I'm not sure I understand?
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 may have misunderstood what the FML does with the coenrolling feature ids but doesn't it write them out to the feature manifest kt/Swift file and that's the method being called here?
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 I'm leaning towards no, too. Why would we ever want to use this specific method to do anything other than pass along the list of IDs?
initialExperiments = bundledExperiments | ||
}.build(appInfo) | ||
val result = dummyNimbus.getCoenrollingFeatureIds() | ||
assertEquals(result, listOf<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.
What is this testing? There is no featureManifest
here, so is this just testing that the we're defaulting to an empty list?
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.
On second thoughts: this test doesn't compile: the NimbusBuilder
has getCoenrollingFeatureIds()
but not the NimbusInterface
object.
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 had originally put the getCoenrollingFeatureIds()
in the NimbusInterfface
, but I agree that we don't really want it there 👍 Removing this test.
New issue for building out the tests for swift |
ceda838
to
7e27321
Compare
7e27321
to
4f119a2
Compare
… NimbusBuilder for kotlin
4f119a2
to
b56ca11
Compare
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #5718 +/- ##
=======================================
Coverage 89.86% 89.86%
=======================================
Files 1 1
Lines 148 148
=======================================
Hits 133 133
Misses 15 15 ☔ View full report in Codecov by Sentry. |
b56ca11
to
a1da763
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.
Nice! There's one nit, but this is good work! Well done!
@@ -231,8 +231,7 @@ public class NimbusBuilder { | |||
// swiftlint:enable function_body_length | |||
|
|||
func getCoenrollingFeatureIds() -> [String] { | |||
// This will be changed to use the feature manifest in EXP-3265 | |||
[] | |||
featureManifest != nil ? featureManifest!.getCoenrollingFeatureIds() : [] |
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.
Nit: ??
is the same as the elvis operator.
featureManifest != nil ? featureManifest!.getCoenrollingFeatureIds() : [] | |
featureManifest?.getCoenrollingFeatureIds() ?? [] |
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.
Ahhh perfect!
@@ -187,8 +187,7 @@ abstract class AbstractNimbusBuilder<T : NimbusInterface>(val context: Context) | |||
* use this to pass into the [NimbusInterface] instance. | |||
*/ | |||
protected fun getCoenrollingFeatureIds(): List<String> = | |||
// This will be changed to use the feature manifest in EXP-3265 | |||
listOf() | |||
featureManifest?.getCoenrollingFeatureIds() ?: listOf() |
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.
😻
a1da763
to
c2353d0
Compare
https://mozilla-hub.atlassian.net/browse/EXP-3625
getCoenrollingFeatureIds()
toWe don't care about exposing this method hereNimbusInterface.kt
NimbusBuilder.kt
Same as aboveNimbusApi.swift
NimbusBuilder.swift
Pull Request checklist
[ci full]
to the PR title.Branch builds: add
[firefox-android: branch-name]
to the PR title.