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

Diff ABT Experiments for real-time RC #11398

Closed
wants to merge 35 commits into from
Closed

Diff ABT Experiments for real-time RC #11398

wants to merge 35 commits into from

Conversation

qdpham13
Copy link
Contributor

@qdpham13 qdpham13 commented Jun 5, 2023

Adds diffing logic between experiments fetched via real-time and experiments active on the device. The config keys that have been affected by the differences will be added to ConfigUpdate. Testing below:

  1. Created experiments with https://docs.google.com/document/d/1MXxUg1JSBbh3m_Qy4tGPrGs3-Nh8FAwKmg5ZWOKQ3J8/edit

  2. Add experiments to configs using Management API, example: https://rpc.corp.google.com/rpc/builder?rpcId=15352346049097272373

2.1) Add/Remove Experiment to Config Key.
2.2) Replace experiment in Config Key
2.3) Create new param with experiment attached

  1. See changes in SDK

@google-oss-bot
Copy link

1 Warning
⚠️ Did you forget to add a changelog entry? (Add #no-changelog to the PR description to silence this warning.)

Generated by 🚫 Danger

@qdpham13 qdpham13 requested review from karenyz and danasilver June 5, 2023 23:36
@google-oss-bot
Copy link

google-oss-bot commented Jun 5, 2023

Coverage Report 1

Affected Products

  • FirebaseRemoteConfig-iOS-FirebaseRemoteConfig.framework

    Overall coverage changed from 71.00% (0cdd7b1) to 71.46% (607d9ba) by +0.46%.

    FilenameBase (0cdd7b1)Merge (607d9ba)Diff
    RCNConfigContent.m81.90%85.64%+3.74%

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/3DmHzsIzqv.html


- (FIRRemoteConfigUpdate *)getConfigUpdateForNamespace:(NSString *)FIRNamespace
withExperimentChanges:
(NSMutableSet<NSString *> *)changedExperimentKeys {
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of doing the diffing elsewhere and passing in the changed keys, could we not read the experiment metadata directly from the dbManager here and do the diffing in this method?

feels unnecessary to have to explicitly pass in the experiment-related keys to getConfigUpdateForNamespace, when the diffing logic can be self-contained within RCNConfigContent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My thinking is that all experiment logic lives in RCNConfigExperiments including in-memory copies of active and fetched experiments so why not do the diffing where all of the experiments already are so that we don't need to load all of the data elsewhere to do the same thing. Plus where it's called in Fetch allows us to easily pass in the keys after getting the diffs from experiments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But I could go either way

Copy link
Contributor

Choose a reason for hiding this comment

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

I get that it works as-is, but you are having the Fetch class partially compute the results, then pass it to the Config class, just to have it passed back. Fetch doesn't/shouldn't need to know the details of how the ConfigUpdate is computed, otherwise in the future if we decide different metadata is needed (which will likely happen soon), fetch (or anywhere else we call this method) may need to be updated

@qdpham13 qdpham13 requested a review from karenyz June 6, 2023 01:11
@paulb777
Copy link
Member

Please close, merge, or comment. We plan to close stale PRs on November 28, 2023.

@qdpham13 qdpham13 closed this Nov 14, 2023
@firebase firebase locked and limited conversation to collaborators Dec 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants