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

Enforce declaredMethods order when evaluating FFs #4193

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

aitorvs
Copy link
Collaborator

@aitorvs aitorvs commented Feb 19, 2024

Task/Issue URL: https://app.asana.com/0/488551667048375/1206628523510268/f

Description

See task for full context explanation

Steps to test this PR

Test

  • install from this branch and launch the app
  • go to app settings -> developer settings -> override privacy remote config URL
  • toggle "use custom URL" on and enter https://jsonblob.com/api/jsonBlob/1126094951384629248
  • tap on force reloading
  • Use AS (or Flipper) to see the contents of the share prefs com.duckduckgo.feature.toggle.androidBrowserConfig
  • take note of the hash
    -- repeat 3 times --
  • force close the app and re-launch
  • Use AS (or Flipper) to see the contents of the share prefs com.duckduckgo.feature.toggle.androidBrowserConfig
  • verify the hash is the same
    -- END repeat 3 times --
  • take note of the sate (enabled/disabled) of the androidBrowserConfig sub-features
  • Go to https://www.jsonblob.com/1126094951384629248 and modify the hash of androidBrowserConfig
  • force close the app and re-launch
  • verify the hash is the same
  • Go to https://www.jsonblob.com/1126094951384629248 and increase the version
  • force close the app and re-launch
  • verify the hash is different this time, and take note of it
  • verify the state of the sub-features has not change
  • Apply the following patch and rebuild / re-install / re-launch the app
Index: app/src/main/java/com/duckduckgo/app/pixels/remoteconfig/AndroidBrowserConfigFeature.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/src/main/java/com/duckduckgo/app/pixels/remoteconfig/AndroidBrowserConfigFeature.kt b/app/src/main/java/com/duckduckgo/app/pixels/remoteconfig/AndroidBrowserConfigFeature.kt
--- a/app/src/main/java/com/duckduckgo/app/pixels/remoteconfig/AndroidBrowserConfigFeature.kt	(revision 5fe8bd5216708fbbe945832377600bc90233eb24)
+++ b/app/src/main/java/com/duckduckgo/app/pixels/remoteconfig/AndroidBrowserConfigFeature.kt	(date 1707729280159)
@@ -59,4 +59,7 @@
      */
     @Toggle.DefaultValue(false)
     fun optimizeTrackerEvaluation(): Toggle
+
+    @Toggle.DefaultValue(false)
+    fun testFlag(): Toggle
 }
  • verify the androidBrowserConfig_testFlag is now present in the com.duckduckgo.feature.toggle.androidBrowserConfig and its enable value is most likely true (rolloutThreshold < 98)
  • verify the hash has changed

@aitorvs
Copy link
Collaborator Author

aitorvs commented Feb 19, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @aitorvs and the rest of your teammates on Graphite Graphite

@CrisBarreiro
Copy link
Contributor

CrisBarreiro commented Feb 20, 2024

@aitorvs I'm stuck at verify the hash is different this time, and take note of it, I changed the hash for the jsonblob, but the hash on sharedPrefs wasn't updated. It was only after forcing config to be reloaded in developer settings that the hash was finally updated

@aitorvs
Copy link
Collaborator Author

aitorvs commented Feb 20, 2024

@aitorvs I'm stuck at verify the hash is different this time, and take note of it, I changed the hash for the jsonblob, but the hash on sharedPrefs wasn't updated. It was only after forcing config to be reloaded in developer settings that the hash was finally updated

I had missed a test step, just added it and also expanded the verifications to double check something else.

Copy link
Contributor

@CrisBarreiro CrisBarreiro left a comment

Choose a reason for hiding this comment

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

Looks good and works as expected!

@aitorvs aitorvs merged commit 53f2ea0 into develop Feb 21, 2024
8 checks passed
@aitorvs aitorvs deleted the feature/aitor/ff/enforce_declaredMethods_order branch February 21, 2024 09:29
joshliebe pushed a commit that referenced this pull request Mar 11, 2024
Task/Issue URL: https://app.asana.com/0/488551667048375/1206628523510268/f

### Description
See [task](https://app.asana.com/0/488551667048375/1206628523510268/f) for full context explanation

### Steps to test this PR

_Test_
- [x] install from this branch and launch the app
- [x] go to app settings -> developer settings -> override privacy remote config URL
- [x] toggle "use custom URL" on and enter `https://jsonblob.com/api/jsonBlob/1126094951384629248`
- [x] tap on force reloading
- [x] Use AS (or Flipper) to see the contents of the share prefs `com.duckduckgo.feature.toggle.androidBrowserConfig`
- [x] take note of the `hash`
-- repeat 3 times --
- [x] force close the app and re-launch
- [x] Use AS (or Flipper) to see the contents of the share prefs `com.duckduckgo.feature.toggle.androidBrowserConfig`
- [x] verify the `hash` is the same
-- END repeat 3 times --
- [x] take note of the sate (enabled/disabled) of the `androidBrowserConfig` sub-features
- [x] Go to https://www.jsonblob.com/1126094951384629248 and modify the `hash` of `androidBrowserConfig`
- [x] force close the app and re-launch
- [x] verify the `hash` is the same
- [x] Go to https://www.jsonblob.com/1126094951384629248 and increase the version
- [x] force close the app and re-launch
- [x] verify the `hash` is different this time, and take note of it
- [x] verify the state of the sub-features has not change
- [x] Apply the following patch and rebuild / re-install / re-launch the app
```kotlin
Index: app/src/main/java/com/duckduckgo/app/pixels/remoteconfig/AndroidBrowserConfigFeature.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/src/main/java/com/duckduckgo/app/pixels/remoteconfig/AndroidBrowserConfigFeature.kt b/app/src/main/java/com/duckduckgo/app/pixels/remoteconfig/AndroidBrowserConfigFeature.kt
--- a/app/src/main/java/com/duckduckgo/app/pixels/remoteconfig/AndroidBrowserConfigFeature.kt	(revision 5fe8bd5)
+++ b/app/src/main/java/com/duckduckgo/app/pixels/remoteconfig/AndroidBrowserConfigFeature.kt	(date 1707729280159)
@@ -59,4 +59,7 @@
      */
     @Toggle.DefaultValue(false)
     fun optimizeTrackerEvaluation(): Toggle
+
+    @Toggle.DefaultValue(false)
+    fun testFlag(): Toggle
 }
```
- [x] verify the `androidBrowserConfig_testFlag` is now present in the `com.duckduckgo.feature.toggle.androidBrowserConfig` and its `enable` value is most likely `true` (`rolloutThreshold` < `98`)
- [x] verify the `hash` has changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants