From 3abcf563075fd5ba18989b97a7d4d1737e02135a Mon Sep 17 00:00:00 2001 From: Mike Chu <104384559+mikechu-optimizely@users.noreply.github.com> Date: Thu, 7 Nov 2024 15:10:08 -0500 Subject: [PATCH 1/5] [FSSDK-10848] Update Actions tool versions & add workflow dispatch (#377) * ci: bump Actions workflow step versions * test: add workflow dispatch temporarily for testing --- .github/workflows/csharp_release.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/csharp_release.yml b/.github/workflows/csharp_release.yml index cd80b0b2..80461161 100644 --- a/.github/workflows/csharp_release.yml +++ b/.github/workflows/csharp_release.yml @@ -3,6 +3,7 @@ on: release: types: [ published ] # Trigger on published pre-releases and releases + workflow_dispatch: jobs: variables: @@ -33,13 +34,13 @@ jobs: runs-on: windows-2019 # required version for Framework 4.0 steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ needs.variables.outputs.tag }} - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1 + uses: microsoft/setup-msbuild@v2 - name: Setup NuGet - uses: NuGet/setup-nuget@v1 + uses: nuget/setup-nuget@v2 - name: Restore NuGet packages run: nuget restore ./OptimizelySDK.NETFramework.sln - name: Build and strongly name assemblies @@ -57,11 +58,11 @@ jobs: runs-on: windows-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ needs.variables.outputs.tag }} - name: Setup .NET - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v4 - name: Restore dependencies run: dotnet restore OptimizelySDK.NetStandard16/OptimizelySDK.NetStandard16.csproj - name: Build and strongly name assemblies @@ -79,11 +80,11 @@ jobs: runs-on: windows-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ needs.variables.outputs.tag }} - name: Setup .NET - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v4 - name: Restore dependencies run: dotnet restore OptimizelySDK.NetStandard20/OptimizelySDK.NetStandard20.csproj - name: Build and strongly name Standard 2.0 project From 10b8af39c9235338608fa077e9a6c8cbc5cac5cc Mon Sep 17 00:00:00 2001 From: alexjoeyyong <96444887+alexjoeyyong@users.noreply.github.com> Date: Wed, 22 Jan 2025 12:05:02 -0500 Subject: [PATCH 2/5] EC3-1687 Update sonarqube.yml (#378) --- .github/workflows/sonarqube.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index b60e311d..54ba8165 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -9,21 +9,21 @@ jobs: runs-on: windows-latest steps: - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: 1.11 - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Cache SonarCloud packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~\sonar\cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - name: Cache SonarCloud scanner id: cache-sonar-scanner - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: .\.sonar\scanner key: ${{ runner.os }}-sonar-scanner From 666abad0dd6c3df350ed6613f3cc8d59aca224d3 Mon Sep 17 00:00:00 2001 From: Jae Kim <45045038+jaeopt@users.noreply.github.com> Date: Wed, 5 Mar 2025 09:45:10 -0800 Subject: [PATCH 3/5] [FSSDK-11077] clean up travis (#379) --- .github/workflows/csharp.yml | 6 ++---- .github/workflows/integration_test.yml | 11 +++-------- OptimizelySDK.DemoApp/Scripts/README.md | 3 +-- README.md | 2 +- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index b55407af..3e4e0b69 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -103,17 +103,15 @@ jobs: integration_tests: name: Run Integration Tests needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@master + uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@jae/FSSDK-11077 secrets: CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} - TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} fullstack_production_suite: name: Run Performance Tests needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@master + uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@jae/FSSDK-11077 with: FULLSTACK_TEST_REPO: ProdTesting secrets: CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} - TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index cf9a96b3..b56cc881 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -9,8 +9,6 @@ on: secrets: CI_USER_TOKEN: required: true - TRAVIS_COM_TOKEN: - required: true jobs: test: runs-on: ubuntu-latest @@ -19,8 +17,8 @@ jobs: with: # You should create a personal access token and store it in your repository token: ${{ secrets.CI_USER_TOKEN }} - repository: 'optimizely/travisci-tools' - path: 'home/runner/travisci-tools' + repository: 'optimizely/ci-helper-tools' + path: 'home/runner/ci-helper-tools' ref: 'master' - name: set SDK Branch if PR env: @@ -28,14 +26,12 @@ jobs: if: ${{ github.event_name == 'pull_request' }} run: | echo "SDK_BRANCH=$HEAD_REF" >> $GITHUB_ENV - echo "TRAVIS_BRANCH=$HEAD_REF" >> $GITHUB_ENV - name: set SDK Branch if not pull request env: REF_NAME: ${{ github.ref_name }} if: ${{ github.event_name != 'pull_request' }} run: | echo "SDK_BRANCH=$REF_NAME" >> $GITHUB_ENV - echo "TRAVIS_BRANCH=$REF_NAME" >> $GITHUB_ENV - name: Trigger build env: SDK: csharp @@ -51,9 +47,8 @@ jobs: PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }} PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} UPSTREAM_SHA: ${{ github.sha }} - TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} EVENT_MESSAGE: ${{ github.event.message }} HOME: 'home/runner' run: | echo "$GITHUB_CONTEXT" - home/runner/travisci-tools/trigger-script-with-status-update.sh + home/runner/ci-helper-tools/trigger-script-with-status-update.sh diff --git a/OptimizelySDK.DemoApp/Scripts/README.md b/OptimizelySDK.DemoApp/Scripts/README.md index ff1e9551..12510e26 100644 --- a/OptimizelySDK.DemoApp/Scripts/README.md +++ b/OptimizelySDK.DemoApp/Scripts/README.md @@ -7,7 +7,6 @@
-
@@ -34,7 +33,7 @@ to make it possible to position it near a given reference element.
The engine is completely modular and most of its features are implemented as **modifiers**
(similar to middlewares or plugins).
-The whole code base is written in ES2015 and its features are automatically tested on real browsers thanks to [SauceLabs](https://saucelabs.com/) and [TravisCI](https://travis-ci.org/).
+The whole code base is written in ES2015 and its features are automatically tested on real browsers thanks to [SauceLabs](https://saucelabs.com/).
Popper.js has zero dependencies. No jQuery, no LoDash, nothing.
It's used by big companies like [Twitter in Bootstrap v4](https://getbootstrap.com/), [Microsoft in WebClipper](https://github.com/OneNoteDev/WebClipper) and [Atlassian in AtlasKit](https://aui-cdn.atlassian.com/atlaskit/registry/).
diff --git a/README.md b/README.md
index f6b04d5c..9de4ddc7 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Optimizely C# SDK

-[](https://travis-ci.org/optimizely/csharp-sdk)
+
[](https://www.nuget.org/packages/Optimizely.SDK/)
[](http://www.apache.org/licenses/LICENSE-2.0)
From 282b7cf7577d1adf2fedaad33625dab34aea5fa6 Mon Sep 17 00:00:00 2001
From: Jae Kim <45045038+jaeopt@users.noreply.github.com>
Date: Wed, 5 Mar 2025 13:02:26 -0800
Subject: [PATCH 4/5] restore master workflow (#380)
---
.github/workflows/csharp.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml
index 3e4e0b69..0205baa8 100644
--- a/.github/workflows/csharp.yml
+++ b/.github/workflows/csharp.yml
@@ -103,14 +103,14 @@ jobs:
integration_tests:
name: Run Integration Tests
needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ]
- uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@jae/FSSDK-11077
+ uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@master
secrets:
CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }}
fullstack_production_suite:
name: Run Performance Tests
needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ]
- uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@jae/FSSDK-11077
+ uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@master
with:
FULLSTACK_TEST_REPO: ProdTesting
secrets:
From c9d06cdb0b21f455508f4e74f548758aa44b8625 Mon Sep 17 00:00:00 2001
From: Md Junaed Hossain <169046794+junaed-optimizely@users.noreply.github.com>
Date: Wed, 18 Jun 2025 23:08:18 +0600
Subject: [PATCH 5/5] [FSSDK-11450] experimentId + variationId to decision
notification listener (#381)
---
.github/workflows/csharp.yml | 4 +-
OptimizelySDK.Tests/OptimizelyTest.cs | 91 ++++++++++---------
.../OptimizelyUserContextTest.cs | 6 ++
OptimizelySDK/Optimizely.cs | 11 ++-
4 files changed, 63 insertions(+), 49 deletions(-)
diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml
index 0205baa8..1650a685 100644
--- a/.github/workflows/csharp.yml
+++ b/.github/workflows/csharp.yml
@@ -75,7 +75,7 @@ jobs:
- name: Restore dependencies
run: dotnet restore OptimizelySDK.NetStandard16/OptimizelySDK.NetStandard16.csproj
- name: Build & strongly name assemblies
- run: dotnet build OptimizelySDK.NetStandard16/OptimizelySDK.NetStandard16.csproj /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=D:\a\csharp-sdk\csharp-sdk\keypair.snk -c Release
+ run: dotnet build OptimizelySDK.NetStandard16/OptimizelySDK.NetStandard16.csproj /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(pwd)/keypair.snk -c Release
netStandard20:
name: Build Standard 2.0
@@ -98,7 +98,7 @@ jobs:
- name: Restore dependencies
run: dotnet restore OptimizelySDK.NetStandard20/OptimizelySDK.NetStandard20.csproj
- name: Build & strongly name assemblies
- run: dotnet build OptimizelySDK.NetStandard20/OptimizelySDK.NetStandard20.csproj /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=D:\a\csharp-sdk\csharp-sdk\keypair.snk -c Release
+ run: dotnet build OptimizelySDK.NetStandard20/OptimizelySDK.NetStandard20.csproj /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(pwd)/keypair.snk -c Release
integration_tests:
name: Run Integration Tests
diff --git a/OptimizelySDK.Tests/OptimizelyTest.cs b/OptimizelySDK.Tests/OptimizelyTest.cs
index 5dab3aec..0adb57ec 100644
--- a/OptimizelySDK.Tests/OptimizelyTest.cs
+++ b/OptimizelySDK.Tests/OptimizelyTest.cs
@@ -339,6 +339,12 @@ public void TestDecisionNotificationSentWhenSendFlagDecisionsFalseAndFeature()
{
"decisionEventDispatched", true
},
+ {
+ "experimentId", "7718750065"
+ },
+ {
+ "variationId", "7713030086"
+ }
}))), Times.Once);
EventDispatcherMock.Verify(dispatcher => dispatcher.DispatchEvent(It.IsAny