From 7e4809a2258012264a7857d598b68fe60d0a06fc Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 10 Mar 2023 11:14:58 -0500 Subject: [PATCH 01/10] [FSSDK-8962] Update branding names --- README.md | 6 ++---- pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5995611..dd9e842 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,8 @@ [![Pub](https://img.shields.io/pub/v/optimizely_flutter_sdk.svg)](https://pub.dev/packages/optimizely_flutter_sdk) [![Coverage Status](https://coveralls.io/repos/github/optimizely/optimizely-flutter-sdk/badge.svg?branch=master)](https://coveralls.io/github/optimizely/optimizely-flutter-sdk?branch=master) -This project is a starting point for a Flutter -[plug-in package](https://flutter.dev/developing-packages/), -a specialized package that includes platform-specific implementation code for -Android and/or iOS. +This project is the official release for a Flutter +[plug-in package](https://flutter.dev/developing-packages/) to support Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts. It is a specialized package that includes platform-specific implementation code for Android and/or iOS. ## Getting Started diff --git a/pubspec.yaml b/pubspec.yaml index ac0b6f6..a7ad36a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: optimizely_flutter_sdk -description: This repository houses the Flutter SDK for use with Optimizely Full Stack and Optimizely Rollouts. +description: This repository houses the Flutter SDK for use with Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts. version: 1.0.0-beta homepage: https://github.com/optimizely/optimizely-flutter-sdk From af6cf76476d32a7b0d0683e3be2adf15915812c5 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 10 Mar 2023 12:44:49 -0500 Subject: [PATCH 02/10] [FSSDK-8962] Add CONTRIBUTING.md --- CONTRIBUTING.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..1fd41f7 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,45 @@ +# Contributing to the Optimizely Flutter SDK +We welcome contributions and feedback! All contributors must sign our [Contributor License Agreement (CLA)](https://docs.google.com/a/optimizely.com/forms/d/e/1FAIpQLSf9cbouWptIpMgukAKZZOIAhafvjFCV8hS00XJLWQnWDFtwtA/viewform) to be eligible to contribute. Please read the [README](README.md) to set up your development environment, then read the guidelines below for information on submitting your code. + +## Development process + +1. Fork the repository and create your branch from master. +2. Please follow the [commit message guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines) for each commit message. +3. Make sure to add tests! +4. `git push` your changes to GitHub. +5. Open a PR from your fork into the master branch of the original repo. +6. Make sure that all unit tests are passing and that there are no merge conflicts between your branch and `master`. +7. Open a pull request from `YOUR_NAME/branch_name` to `master`. +8. A repository maintainer will review your pull request and, if all goes well, squash and merge it! + +## Pull request acceptance criteria + +* **All code must have test coverage.** We use Open Cover. Changes in functionality should have accompanying unit tests. Bug fixes should have accompanying regression tests. +* Tests are located in `OptimizelySDK.Tests` with one file per class. + +## License + +All contributions are under the CLA mentioned above. For this project, Optimizely uses the Apache 2.0 license, and so asks that by contributing your code, you agree to license your contribution under the terms of the [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0). Your contributions should also include the following header: + +``` +/** + * Copyright YEAR, Optimizely, Inc. and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +``` + +The YEAR above should be the year of the contribution. If work on the file has been done over multiple years, list each year in the section above. Example: Optimizely writes the file and releases it in 2014. No changes are made in 2015. Change made in 2016. YEAR should be �2014, 2016�. + +## Contact +If you have questions, please contact developers@optimizely.com. \ No newline at end of file From 3587b091e3bf21f2bc16f4c7271fc7fb243e863c Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 10 Mar 2023 12:46:50 -0500 Subject: [PATCH 03/10] [FSSDK-8962] Update README.md --- README.md | 71 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 59 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index dd9e842..0f45768 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,15 @@ [![Pub](https://img.shields.io/pub/v/optimizely_flutter_sdk.svg)](https://pub.dev/packages/optimizely_flutter_sdk) [![Coverage Status](https://coveralls.io/repos/github/optimizely/optimizely-flutter-sdk/badge.svg?branch=master)](https://coveralls.io/github/optimizely/optimizely-flutter-sdk?branch=master) -This project is the official release for a Flutter -[plug-in package](https://flutter.dev/developing-packages/) to support Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts. It is a specialized package that includes platform-specific implementation code for Android and/or iOS. +This repository houses the Flutter SDK for use with Optimizely Feature Experimentation and Optimizely Full Stack (legacy). -## Getting Started +Optimizely Feature Experimentation is an A/B testing and feature management tool for product development teams that enables you to experiment at every step. Using Optimizely Feature Experimentation allows for every feature on your roadmap to be an opportunity to discover hidden insights. Learn more at [Optimizely.com](https://www.optimizely.com/products/experiment/feature-experimentation/), or see the [developer documentation](https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs/welcome). -### Using the SDK -Refer to the [Flutter SDK developer documentation](https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs/install-sdk-flutter) for instructions on getting started with using the SDK. +Optimizely Rollouts is [free feature flags](https://www.optimizely.com/free-feature-flagging/) for development teams. You can easily roll out and roll back features in any application without code deploys, mitigating risk for every feature on your roadmap. + +## Get Started + +Refer to the [Flutter SDK's developer documentation](https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs/flutter-sdk) for detailed instructions on getting started with using the SDK. ### Requirements @@ -22,23 +24,27 @@ On the iOS platform, the SDK requires a minimum version of 10.0. Other Flutter platforms are not currently supported by this SDK. -### Installing the SDK +### Install the SDK + +### Packages To add the flutter-sdk to your project dependencies, include the following in your app's pubspec.yaml: ``` - optimizely_flutter_sdk: ^1.0.0-beta + optimizely_flutter_sdk: ^1.0.1-beta ``` -Then, import the package in your application code: +Then run ``` - import 'package:optimizely_flutter_sdk/optimizely_flutter_sdk.dart'; +flutter pub get ``` -## Usage +### Configuration options + +{{ List any configuration options, if the SDK has any (for example, Agent's configuration can be overwritten by a yaml config file) }} -### Instantiation +## Use the Flutter SDK A sample code for SDK initialization: @@ -47,6 +53,14 @@ A sample code for SDK initialization: var response = await flutterSDK.initializeClient(); ``` +### Initialization + +Then, import the package in your application code: + +``` + import 'package:optimizely_flutter_sdk/optimizely_flutter_sdk.dart'; +``` + ### Feature Rollouts ``` import 'package:optimizely_flutter_sdk/optimizely_flutter_sdk.dart'; @@ -66,7 +80,40 @@ A sample code for SDK initialization: var decideReponse = await user!.decide("binary_feature"); ``` -## Testing in Terminal +## SDK Development + +### Unit Tests 1. To run [unit tests](https://docs.flutter.dev/cookbook/testing/unit/introduction) using terminal, simply use the following command: `flutter test test/optimizely_flutter_sdk_test.dart` + +### Contributing + +Please see [CONTRIBUTING](CONTRIBUTING.md). + + +### Other Optimizely SDKs + +- Agent - https://github.com/optimizely/agent + +- Android - https://github.com/optimizely/android-sdk + +- C# - https://github.com/optimizely/csharp-sdk + +- Flutter - https://github.com/optimizely/optimizely-flutter-sdk + +- Go - https://github.com/optimizely/go-sdk + +- Java - https://github.com/optimizely/java-sdk + +- JavaScript - https://github.com/optimizely/javascript-sdk + +- PHP - https://github.com/optimizely/php-sdk + +- Python - https://github.com/optimizely/python-sdk + +- React - https://github.com/optimizely/react-sdk + +- Ruby - https://github.com/optimizely/ruby-sdk + +- Swift - https://github.com/optimizely/swift-sdk From bc677f565032c091cc6ccbcd9c163750dda3b9d8 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 10 Mar 2023 13:09:35 -0500 Subject: [PATCH 04/10] [FSSDK-8962] PR review requested changes --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 0f45768..785df04 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ # Optimizely Flutter SDK [![Apache 2.0](https://img.shields.io/github/license/nebula-plugins/gradle-extra-configurations-plugin.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![Build Status](https://github.com/optimizely/optimizely-flutter-sdk/actions/workflows/flutter.yml/badge.svg?branch=master)](https://github.com/optimizely/optimizely-flutter-sdk/actions) -[![Pub](https://img.shields.io/pub/v/optimizely_flutter_sdk.svg)](https://pub.dev/packages/optimizely_flutter_sdk) -[![Coverage Status](https://coveralls.io/repos/github/optimizely/optimizely-flutter-sdk/badge.svg?branch=master)](https://coveralls.io/github/optimizely/optimizely-flutter-sdk?branch=master) + This repository houses the Flutter SDK for use with Optimizely Feature Experimentation and Optimizely Full Stack (legacy). @@ -40,10 +39,6 @@ Then run flutter pub get ``` -### Configuration options - -{{ List any configuration options, if the SDK has any (for example, Agent's configuration can be overwritten by a yaml config file) }} - ## Use the Flutter SDK A sample code for SDK initialization: From 81d467c819b2839712772f7cb4ebaf811a86ac73 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 10 Mar 2023 13:13:11 -0500 Subject: [PATCH 05/10] [FSSDK-8962] Update Pod::Spec homepage link --- ios/optimizely_flutter_sdk.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/optimizely_flutter_sdk.podspec b/ios/optimizely_flutter_sdk.podspec index 195d857..15d0f02 100644 --- a/ios/optimizely_flutter_sdk.podspec +++ b/ios/optimizely_flutter_sdk.podspec @@ -7,7 +7,7 @@ Pod::Spec.new do |s| s.name = 'optimizely_flutter_sdk' s.version = '0.0.1' s.summary = 'Optimizely experiment framework for iOS' - s.homepage = "https://docs.developers.optimizely.com/full-stack/docs" + s.homepage = "https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs" s.license = { :type => "Apache License, Version 2.0", :file => "../LICENSE" } s.author = { "Optimizely" => "support@optimizely.com" } s.source = { :path => '.' } From a990444b805b845ecd188eb30579be1ce09c90fb Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 10 Mar 2023 13:18:52 -0500 Subject: [PATCH 06/10] [FSSDK-8962] Update CONTRIBUTING.md --- CONTRIBUTING.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1fd41f7..f25fd55 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ We welcome contributions and feedback! All contributors must sign our [Contribut ## Pull request acceptance criteria -* **All code must have test coverage.** We use Open Cover. Changes in functionality should have accompanying unit tests. Bug fixes should have accompanying regression tests. +* **All code must have test coverage.** Changes in functionality should have accompanying unit tests. Bug fixes should have accompanying regression tests. * Tests are located in `OptimizelySDK.Tests` with one file per class. ## License @@ -22,21 +22,21 @@ We welcome contributions and feedback! All contributors must sign our [Contribut All contributions are under the CLA mentioned above. For this project, Optimizely uses the Apache 2.0 license, and so asks that by contributing your code, you agree to license your contribution under the terms of the [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0). Your contributions should also include the following header: ``` -/** - * Copyright YEAR, Optimizely, Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/// ************************************************************************** +/// Copyright YEAR, Optimizely, Inc. and contributors * +/// * +/// Licensed under the Apache License, Version 2.0 (the "License"); * +/// you may not use this file except in compliance with the License. * +/// You may obtain a copy of the License at * +/// * +/// https://www.apache.org/licenses/LICENSE-2.0 * +/// * +/// Unless required by applicable law or agreed to in writing, software * +/// distributed under the License is distributed on an "AS IS" BASIS, * +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * +/// See the License for the specific language governing permissions and * +/// limitations under the License. * +///**************************************************************************/ ``` The YEAR above should be the year of the contribution. If work on the file has been done over multiple years, list each year in the section above. Example: Optimizely writes the file and releases it in 2014. No changes are made in 2015. Change made in 2016. YEAR should be �2014, 2016�. From bad8c5d92c1f57eb310031caed53ee89671cdcb5 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 10 Mar 2023 13:29:50 -0500 Subject: [PATCH 07/10] [FSSDK-8962] Restore & reorder badges --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 785df04..fd489c5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # Optimizely Flutter SDK -[![Apache 2.0](https://img.shields.io/github/license/nebula-plugins/gradle-extra-configurations-plugin.svg)](https://www.apache.org/licenses/LICENSE-2.0) +[![Pub Version](https://img.shields.io/pub/v/optimizely_flutter_sdk?color=blueviolet)](https://pub.dev/packages/optimizely_flutter_sdk) [![Build Status](https://github.com/optimizely/optimizely-flutter-sdk/actions/workflows/flutter.yml/badge.svg?branch=master)](https://github.com/optimizely/optimizely-flutter-sdk/actions) - +[![Coverage Status](https://coveralls.io/repos/github/optimizely/optimizely-flutter-sdk/badge.svg?branch=master)](https://coveralls.io/github/optimizely/optimizely-flutter-sdk?branch=master) +[![Pub](https://img.shields.io/pub/v/optimizely_flutter_sdk.svg)](https://pub.dev/packages/optimizely_flutter_sdk) +[![Apache 2.0](https://img.shields.io/github/license/nebula-plugins/gradle-extra-configurations-plugin.svg)](https://www.apache.org/licenses/LICENSE-2.0) This repository houses the Flutter SDK for use with Optimizely Feature Experimentation and Optimizely Full Stack (legacy). From aa5ae01e4eee5185c9a915216d5bf7a5c6f713e4 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 10 Mar 2023 13:34:25 -0500 Subject: [PATCH 08/10] [FSSDK-8962] Remove excess H3; Add code typing --- README.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index fd489c5..5439e6c 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,6 @@ Other Flutter platforms are not currently supported by this SDK. ### Install the SDK -### Packages - To add the flutter-sdk to your project dependencies, include the following in your app's pubspec.yaml: ``` @@ -37,15 +35,15 @@ To add the flutter-sdk to your project dependencies, include the following in yo Then run -``` -flutter pub get +```bash + flutter pub get ``` ## Use the Flutter SDK A sample code for SDK initialization: -``` +```dart var flutterSDK = OptimizelyFlutterSdk("my_sdk_key"); var response = await flutterSDK.initializeClient(); ``` @@ -54,14 +52,12 @@ A sample code for SDK initialization: Then, import the package in your application code: -``` +```dart import 'package:optimizely_flutter_sdk/optimizely_flutter_sdk.dart'; ``` ### Feature Rollouts -``` - import 'package:optimizely_flutter_sdk/optimizely_flutter_sdk.dart'; - +```dart // Also supports eventOptions, datafilePeriodicDownloadInterval, datafileHostOptions and defaultDecideOptions var flutterSDK = OptimizelyFlutterSdk("my_sdk_key"); @@ -81,8 +77,11 @@ Then, import the package in your application code: ### Unit Tests -1. To run [unit tests](https://docs.flutter.dev/cookbook/testing/unit/introduction) using terminal, simply use the following command: -`flutter test test/optimizely_flutter_sdk_test.dart` +1. To run [unit tests](https://docs.flutter.dev/cookbook/testing/unit/introduction) using terminal, simply use the following command + +```bash +flutter test test/optimizely_flutter_sdk_test.dart +``` ### Contributing From 8c9c08d7ccadfacfcea840c7c28ca966c7ed204e Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 10 Mar 2023 13:46:38 -0500 Subject: [PATCH 09/10] [FSSDK-8962] Reorganize sample + other stuff --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 5439e6c..621e0b5 100644 --- a/README.md +++ b/README.md @@ -41,27 +41,28 @@ Then run ## Use the Flutter SDK -A sample code for SDK initialization: +### Initialization + +Import the package in your application code: ```dart - var flutterSDK = OptimizelyFlutterSdk("my_sdk_key"); - var response = await flutterSDK.initializeClient(); + import 'package:optimizely_flutter_sdk/optimizely_flutter_sdk.dart'; ``` -### Initialization - -Then, import the package in your application code: +Instantiate the SDK, adding your SDK Key and initializing the client: ```dart - import 'package:optimizely_flutter_sdk/optimizely_flutter_sdk.dart'; + var flutterSDK = OptimizelyFlutterSdk("your_sdk_key"); + var response = await flutterSDK.initializeClient(); ``` ### Feature Rollouts ```dart + import 'package:optimizely_flutter_sdk/optimizely_flutter_sdk.dart'; + // Also supports eventOptions, datafilePeriodicDownloadInterval, datafileHostOptions and defaultDecideOptions - var flutterSDK = OptimizelyFlutterSdk("my_sdk_key"); + var flutterSDK = OptimizelyFlutterSdk("your_sdk_key"); - // instantiate a client var response = await flutterSDK.initializeClient(); // User attributes are optional and used for targeting and results segmentation @@ -69,7 +70,7 @@ Then, import the package in your application code: "state": "California", "likes_donuts": true }; - var user = await flutterSDK.createUserContext("optimizely end user", attributes); + var user = await flutterSDK.createUserContext("user_id", attributes); var decideReponse = await user!.decide("binary_feature"); ``` @@ -77,7 +78,7 @@ Then, import the package in your application code: ### Unit Tests -1. To run [unit tests](https://docs.flutter.dev/cookbook/testing/unit/introduction) using terminal, simply use the following command +To run [unit tests](https://docs.flutter.dev/cookbook/testing/unit/introduction) using terminal, simply use the following command: ```bash flutter test test/optimizely_flutter_sdk_test.dart @@ -87,7 +88,6 @@ flutter test test/optimizely_flutter_sdk_test.dart Please see [CONTRIBUTING](CONTRIBUTING.md). - ### Other Optimizely SDKs - Agent - https://github.com/optimizely/agent From d8f8ab812653edcf77d176dc50f3ec4be37c9ebc Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 10 Mar 2023 14:23:28 -0500 Subject: [PATCH 10/10] [FSSDK-8962] Remove build & coverage badges --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 621e0b5..9f6b00a 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ # Optimizely Flutter SDK [![Pub Version](https://img.shields.io/pub/v/optimizely_flutter_sdk?color=blueviolet)](https://pub.dev/packages/optimizely_flutter_sdk) -[![Build Status](https://github.com/optimizely/optimizely-flutter-sdk/actions/workflows/flutter.yml/badge.svg?branch=master)](https://github.com/optimizely/optimizely-flutter-sdk/actions) -[![Coverage Status](https://coveralls.io/repos/github/optimizely/optimizely-flutter-sdk/badge.svg?branch=master)](https://coveralls.io/github/optimizely/optimizely-flutter-sdk?branch=master) [![Pub](https://img.shields.io/pub/v/optimizely_flutter_sdk.svg)](https://pub.dev/packages/optimizely_flutter_sdk) [![Apache 2.0](https://img.shields.io/github/license/nebula-plugins/gradle-extra-configurations-plugin.svg)](https://www.apache.org/licenses/LICENSE-2.0) + This repository houses the Flutter SDK for use with Optimizely Feature Experimentation and Optimizely Full Stack (legacy).