From 13d5f0f3fcab7fd19ca83880a7d79f5338eccf85 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Tue, 25 Jul 2023 13:04:40 -0400 Subject: [PATCH 01/21] [FSSDK-9538] bug: Fix last modified formatting (#361) * Fix non-RFC1123 formatting * Update tests to ensure expected format * Add more accurate assert * Lint fixes (cherry picked from commit 962bd685eaf23b50abbf8d4907f7c63be7dc65c3) --- .../HttpProjectConfigManagerTest.cs | 89 ++++++++++--------- .../Config/HttpProjectConfigManager.cs | 8 +- 2 files changed, 52 insertions(+), 45 deletions(-) diff --git a/OptimizelySDK.Tests/ConfigTest/HttpProjectConfigManagerTest.cs b/OptimizelySDK.Tests/ConfigTest/HttpProjectConfigManagerTest.cs index 1c558f49..884d9b92 100644 --- a/OptimizelySDK.Tests/ConfigTest/HttpProjectConfigManagerTest.cs +++ b/OptimizelySDK.Tests/ConfigTest/HttpProjectConfigManagerTest.cs @@ -14,19 +14,17 @@ * limitations under the License. */ +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; using Moq; using NUnit.Framework; using OptimizelySDK.Config; using OptimizelySDK.Logger; using OptimizelySDK.Tests.NotificationTests; using OptimizelySDK.Tests.Utils; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Net; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; namespace OptimizelySDK.Tests.DatafileManagement_Tests { @@ -39,6 +37,11 @@ public class HttpProjectConfigManagerTest private Mock NotificationCallbackMock = new Mock(); + private const string ExpectedRfc1123DateTime = "Thu, 03 Nov 2022 16:00:00 GMT"; + + private readonly DateTime _pastLastModified = + new DateTimeOffset(new DateTime(2022, 11, 3, 16, 0, 0, DateTimeKind.Utc)).UtcDateTime; + [SetUp] public void Setup() { @@ -54,7 +57,7 @@ public void Setup() public void TestHttpConfigManagerRetrieveProjectConfigByURL() { var t = MockSendAsync(TestData.Datafile); - HttpProjectConfigManager httpManager = new HttpProjectConfigManager.Builder() + var httpManager = new HttpProjectConfigManager.Builder() .WithUrl("https://cdn.optimizely.com/datafiles/QBw9gFM8oTn7ogY9ANCC1z.json") .WithLogger(LoggerMock.Object) .WithPollingInterval(TimeSpan.FromMilliseconds(1000)) @@ -67,7 +70,7 @@ public void TestHttpConfigManagerRetrieveProjectConfigByURL() t.Wait(1000); HttpClientMock.Verify(_ => _.SendAsync( - It.Is(requestMessage => + It.Is(requestMessage => requestMessage.RequestUri.ToString() == "https://cdn.optimizely.com/datafiles/QBw9gFM8oTn7ogY9ANCC1z.json" ))); @@ -77,9 +80,9 @@ public void TestHttpConfigManagerRetrieveProjectConfigByURL() [Test] public void TestHttpConfigManagerWithInvalidStatus() { - var t = MockSendAsync(statusCode: HttpStatusCode.Forbidden); + MockSendAsync(statusCode: HttpStatusCode.Forbidden); - HttpProjectConfigManager httpManager = new HttpProjectConfigManager.Builder() + var httpManager = new HttpProjectConfigManager.Builder() .WithUrl("https://cdn.optimizely.com/datafiles/QBw9gFM8oTn7ogY9ANCC1z.json") .WithLogger(LoggerMock.Object) .WithPollingInterval(TimeSpan.FromMilliseconds(1000)) @@ -102,24 +105,29 @@ public void TestSettingIfModifiedSinceInRequestHeader() statusCode: HttpStatusCode.NotModified, responseContentHeaders: new Dictionary { - { - "Last-Modified", new DateTime(2050, 10, 10).ToString("R") - }, + { "Last-Modified", _pastLastModified.ToString("r") }, } ); var httpManager = new HttpProjectConfigManager.Builder() - .WithDatafile(string.Empty) + .WithSdkKey("QBw9gFM8oTn7ogY9ANCC1z") .WithLogger(LoggerMock.Object) .WithPollingInterval(TimeSpan.FromMilliseconds(1000)) .WithBlockingTimeoutPeriod(TimeSpan.FromMilliseconds(2000)) .WithStartByDefault() .Build(defer: true); - httpManager.LastModifiedSince = new DateTime(2020, 4, 4).ToString("R"); + httpManager.LastModifiedSince = _pastLastModified.ToString("r"); t.Wait(3000); + HttpClientMock.Verify(_ => _.SendAsync( + It.Is(requestMessage => + requestMessage.Headers.IfModifiedSince.HasValue && + requestMessage.Headers.IfModifiedSince.Value.UtcDateTime.ToString("r") == + ExpectedRfc1123DateTime + )), Times.Once); LoggerMock.Verify( - _ => _.Log(LogLevel.DEBUG, "Set If-Modified-Since in request header."), + _ => _.Log(LogLevel.DEBUG, + $"Set If-Modified-Since in request header: {ExpectedRfc1123DateTime}"), Times.AtLeastOnce); httpManager.Dispose(); @@ -129,16 +137,15 @@ public void TestSettingIfModifiedSinceInRequestHeader() public void TestSettingLastModifiedFromResponseHeader() { MockSendAsync( + datafile: TestData.Datafile, statusCode: HttpStatusCode.OK, responseContentHeaders: new Dictionary { - { - "Last-Modified", new DateTime(2050, 10, 10).ToString("R") - }, + { "Last-Modified", _pastLastModified.ToString("r") }, } ); var httpManager = new HttpProjectConfigManager.Builder() - .WithUrl("https://cdn.optimizely.com/datafiles/QBw9gFM8oTn7ogY9ANCC1z.json") + .WithSdkKey("QBw9gFM8oTn7ogY9ANCC1z") .WithLogger(LoggerMock.Object) .WithPollingInterval(TimeSpan.FromMilliseconds(1000)) .WithBlockingTimeoutPeriod(TimeSpan.FromMilliseconds(500)) @@ -146,7 +153,8 @@ public void TestSettingLastModifiedFromResponseHeader() .Build(); LoggerMock.Verify( - _ => _.Log(LogLevel.DEBUG, "Set LastModifiedSince from response header."), + _ => _.Log(LogLevel.DEBUG, + $"Set LastModifiedSince from response header: {ExpectedRfc1123DateTime}"), Times.AtLeastOnce); httpManager.Dispose(); @@ -157,8 +165,7 @@ public void TestHttpClientHandler() { var httpConfigHandler = HttpProjectConfigManager.HttpClient.GetHttpClientHandler(); Assert.IsTrue(httpConfigHandler.AutomaticDecompression == - (System.Net.DecompressionMethods.Deflate | - System.Net.DecompressionMethods.GZip)); + (DecompressionMethods.Deflate | DecompressionMethods.GZip)); } [Test] @@ -166,7 +173,7 @@ public void TestHttpConfigManagerRetrieveProjectConfigGivenEmptyFormatUseDefault { var t = MockSendAsync(TestData.Datafile); - HttpProjectConfigManager httpManager = new HttpProjectConfigManager.Builder() + var httpManager = new HttpProjectConfigManager.Builder() .WithSdkKey("QBw9gFM8oTn7ogY9ANCC1z") .WithFormat("") .WithLogger(LoggerMock.Object) @@ -179,7 +186,7 @@ public void TestHttpConfigManagerRetrieveProjectConfigGivenEmptyFormatUseDefault // Time is given here to avoid hanging-up in any worst case. t.Wait(1000); HttpClientMock.Verify(_ => _.SendAsync( - It.Is(requestMessage => + It.Is(requestMessage => requestMessage.RequestUri.ToString() == "https://cdn.optimizely.com/datafiles/QBw9gFM8oTn7ogY9ANCC1z.json" ))); @@ -191,7 +198,7 @@ public void TestHttpConfigManagerRetrieveProjectConfigBySDKKey() { var t = MockSendAsync(TestData.Datafile); - HttpProjectConfigManager httpManager = new HttpProjectConfigManager.Builder() + var httpManager = new HttpProjectConfigManager.Builder() .WithSdkKey("QBw9gFM8oTn7ogY9ANCC1z") .WithLogger(LoggerMock.Object) .WithPollingInterval(TimeSpan.FromMilliseconds(1000)) @@ -201,7 +208,7 @@ public void TestHttpConfigManagerRetrieveProjectConfigBySDKKey() t.Wait(1000); HttpClientMock.Verify(_ => _.SendAsync( - It.Is(requestMessage => + It.Is(requestMessage => requestMessage.RequestUri.ToString() == "https://cdn.optimizely.com/datafiles/QBw9gFM8oTn7ogY9ANCC1z.json" ))); @@ -214,8 +221,7 @@ public void TestHttpConfigManagerRetrieveProjectConfigByFormat() { var t = MockSendAsync(TestData.Datafile); - HttpProjectConfigManager httpManager = new HttpProjectConfigManager.Builder() - .WithSdkKey("10192104166") + var httpManager = new HttpProjectConfigManager.Builder().WithSdkKey("10192104166") .WithFormat("https://cdn.optimizely.com/json/{0}.json") .WithLogger(LoggerMock.Object) .WithPollingInterval(TimeSpan.FromMilliseconds(1000)) @@ -225,7 +231,7 @@ public void TestHttpConfigManagerRetrieveProjectConfigByFormat() t.Wait(1000); HttpClientMock.Verify(_ => _.SendAsync( - It.Is(requestMessage => + It.Is(requestMessage => requestMessage.RequestUri.ToString() == "https://cdn.optimizely.com/json/10192104166.json" ))); @@ -242,8 +248,7 @@ public void TestHttpProjectConfigManagerDoesntRaiseExceptionForDefaultErrorHandl { var t = MockSendAsync(TestData.Datafile); - HttpProjectConfigManager httpManager = new HttpProjectConfigManager.Builder() - .WithSdkKey("10192104166") + var httpManager = new HttpProjectConfigManager.Builder().WithSdkKey("10192104166") .WithFormat("https://cdn.optimizely.com/json/{0}.json") .WithLogger(LoggerMock.Object) .WithPollingInterval(TimeSpan.FromMilliseconds(1000)) @@ -253,7 +258,7 @@ public void TestHttpProjectConfigManagerDoesntRaiseExceptionForDefaultErrorHandl t.Wait(1000); HttpClientMock.Verify(_ => _.SendAsync( - It.Is(requestMessage => + It.Is(requestMessage => requestMessage.RequestUri.ToString() == "https://cdn.optimizely.com/json/10192104166.json" ))); @@ -272,7 +277,7 @@ public void TestOnReadyPromiseResolvedImmediatelyWhenDatafileIsProvided() var t = MockSendAsync(TestData.SimpleABExperimentsDatafile, TimeSpan.FromMilliseconds(100)); - HttpProjectConfigManager httpManager = new HttpProjectConfigManager.Builder() + var httpManager = new HttpProjectConfigManager.Builder() // Revision - 15 .WithSdkKey("10192104166") .WithDatafile(TestData.Datafile) @@ -302,7 +307,7 @@ public void TestOnReadyPromiseWaitsForProjectConfigRetrievalWhenDatafileIsNotPro var t = MockSendAsync(TestData.SimpleABExperimentsDatafile, TimeSpan.FromMilliseconds(1000)); - HttpProjectConfigManager httpManager = new HttpProjectConfigManager.Builder() + var httpManager = new HttpProjectConfigManager.Builder() .WithSdkKey("QBw9gFM8oTn7ogY9ANCC1z") .WithLogger(LoggerMock.Object) .WithPollingInterval(TimeSpan.FromSeconds(2)) @@ -350,7 +355,7 @@ public void TestHttpConfigManagerDoesNotWaitForTheConfigWhenDeferIsTrue() [Test] public void TestHttpConfigManagerSendConfigUpdateNotificationWhenProjectConfigGetsUpdated() { - var t = MockSendAsync(TestData.Datafile); + MockSendAsync(TestData.Datafile); var httpManager = new HttpProjectConfigManager.Builder() .WithSdkKey("QBw9gFM8oTn7ogY9ANCC1z") @@ -373,7 +378,7 @@ public void TestHttpConfigManagerSendConfigUpdateNotificationWhenProjectConfigGe [Test] public void TestHttpConfigManagerDoesNotSendConfigUpdateNotificationWhenDatafileIsProvided() { - var t = MockSendAsync(TestData.Datafile, TimeSpan.FromMilliseconds(100)); + MockSendAsync(TestData.Datafile, TimeSpan.FromMilliseconds(100)); var httpManager = new HttpProjectConfigManager.Builder() .WithSdkKey("QBw9gFM8oTn7ogY9ANCC1z") @@ -533,7 +538,7 @@ public void TestAuthUrlWhenTokenProvided() t.Wait(2000); HttpClientMock.Verify(_ => _.SendAsync( - It.Is(requestMessage => + It.Is(requestMessage => requestMessage.RequestUri.ToString() == "https://config.optimizely.com/datafiles/auth/QBw9gFM8oTn7ogY9ANCC1z.json" ))); @@ -554,7 +559,7 @@ public void TestDefaultUrlWhenTokenNotProvided() // it's to wait if SendAsync is not triggered. t.Wait(2000); HttpClientMock.Verify(_ => _.SendAsync( - It.Is(requestMessage => + It.Is(requestMessage => requestMessage.RequestUri.ToString() == "https://cdn.optimizely.com/datafiles/QBw9gFM8oTn7ogY9ANCC1z.json" ))); @@ -577,7 +582,7 @@ public void TestAuthenticationHeaderWhenTokenProvided() t.Wait(2000); HttpClientMock.Verify(_ => _.SendAsync( - It.Is(requestMessage => + It.Is(requestMessage => requestMessage.Headers.Authorization.ToString() == "Bearer datafile1" ))); httpManager.Dispose(); @@ -597,7 +602,7 @@ public void TestFormatUrlHigherPriorityThanDefaultUrl() // it's to wait if SendAsync is not triggered. t.Wait(2000); HttpClientMock.Verify(_ => _.SendAsync( - It.Is(requestMessage => + It.Is(requestMessage => requestMessage.RequestUri.ToString() == "http://customformat/QBw9gFM8oTn7ogY9ANCC1z.json" ))); diff --git a/OptimizelySDK/Config/HttpProjectConfigManager.cs b/OptimizelySDK/Config/HttpProjectConfigManager.cs index f27559f5..563cbd5a 100644 --- a/OptimizelySDK/Config/HttpProjectConfigManager.cs +++ b/OptimizelySDK/Config/HttpProjectConfigManager.cs @@ -108,7 +108,8 @@ private string GetRemoteDatafileResponse() if (!string.IsNullOrEmpty(LastModifiedSince)) { request.Headers.Add("If-Modified-Since", LastModifiedSince); - Logger.Log(LogLevel.DEBUG, $"Set If-Modified-Since in request header."); + Logger.Log(LogLevel.DEBUG, + $"Set If-Modified-Since in request header: {LastModifiedSince}"); } if (!string.IsNullOrEmpty(DatafileAccessToken)) @@ -138,8 +139,9 @@ private string GetRemoteDatafileResponse() // Update Last-Modified header if provided. if (result.Content.Headers.LastModified.HasValue) { - LastModifiedSince = result.Content.Headers.LastModified.ToString(); - Logger.Log(LogLevel.DEBUG, $"Set LastModifiedSince from response header."); + LastModifiedSince = result.Content.Headers.LastModified?.UtcDateTime.ToString("r"); + Logger.Log(LogLevel.DEBUG, + $"Set LastModifiedSince from response header: {LastModifiedSince}"); } var content = result.Content.ReadAsStringAsync(); From 711335c52e58ba3b853eb9b29bfcad62ae7c33ee Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Wed, 26 Jul 2023 16:21:58 -0400 Subject: [PATCH 02/21] Update CI to run for release branch --- .github/workflows/csharp.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index 47e69860..340df917 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -2,9 +2,9 @@ name: Continuous Integration on: push: - branches: [ release-3.11.3 ] + branches: [ release-3.11.4 ] pull_request: - branches: [ release-3.11.3 ] + branches: [ release-3.11.4 ] jobs: lintCodebase: @@ -101,7 +101,7 @@ jobs: integration_tests: name: Run Integration Tests needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@cb1c68ba0847f04ea54384c9b4500502c00681e6 + uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@mike/pick-prep-3.11.4 secrets: CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} @@ -109,7 +109,7 @@ jobs: fullstack_production_suite: name: Run Performance Tests needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@cb1c68ba0847f04ea54384c9b4500502c00681e6 + uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@mike/pick-prep-3.11.4 with: FULLSTACK_TEST_REPO: ProdTesting secrets: From 5e2679319f24d2ffca09a3b4ce14f5e05641bc88 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Wed, 26 Jul 2023 16:24:18 -0400 Subject: [PATCH 03/21] Update (fix) assembly versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I can't believe I missed the main project fully 😫 --- OptimizelySDK.DemoApp/Properties/AssemblyInfo.cs | 6 +++--- OptimizelySDK.Net35/Properties/AssemblyInfo.cs | 6 +++--- OptimizelySDK.Net40/Properties/AssemblyInfo.cs | 6 +++--- OptimizelySDK.NetStandard16/Properties/AssemblyInfo.cs | 6 +++--- OptimizelySDK.NetStandard20/Properties/AssemblyInfo.cs | 6 +++--- OptimizelySDK.Tests/Properties/AssemblyInfo.cs | 6 +++--- OptimizelySDK/Properties/AssemblyInfo.cs | 9 +++------ 7 files changed, 21 insertions(+), 24 deletions(-) diff --git a/OptimizelySDK.DemoApp/Properties/AssemblyInfo.cs b/OptimizelySDK.DemoApp/Properties/AssemblyInfo.cs index 95223eb2..3427d947 100644 --- a/OptimizelySDK.DemoApp/Properties/AssemblyInfo.cs +++ b/OptimizelySDK.DemoApp/Properties/AssemblyInfo.cs @@ -35,7 +35,7 @@ // Build Number // Revision // -[assembly: AssemblyVersion("3.11.3.0")] -[assembly: AssemblyFileVersion("3.11.3.0")] -[assembly: AssemblyInformationalVersion("3.11.3")] // Used by Nuget. +[assembly: AssemblyVersion("3.11.4.0")] +[assembly: AssemblyFileVersion("3.11.4.0")] +[assembly: AssemblyInformationalVersion("3.11.4")] // Used by Nuget. diff --git a/OptimizelySDK.Net35/Properties/AssemblyInfo.cs b/OptimizelySDK.Net35/Properties/AssemblyInfo.cs index 763e1bd1..676b6492 100644 --- a/OptimizelySDK.Net35/Properties/AssemblyInfo.cs +++ b/OptimizelySDK.Net35/Properties/AssemblyInfo.cs @@ -35,6 +35,6 @@ // Build Number // Revision // -[assembly: AssemblyVersion("3.11.3.0")] -[assembly: AssemblyFileVersion("3.11.3.0")] -[assembly: AssemblyInformationalVersion("3.11.3")] // Used by Nuget. +[assembly: AssemblyVersion("3.11.4.0")] +[assembly: AssemblyFileVersion("3.11.4.0")] +[assembly: AssemblyInformationalVersion("3.11.4")] // Used by Nuget. diff --git a/OptimizelySDK.Net40/Properties/AssemblyInfo.cs b/OptimizelySDK.Net40/Properties/AssemblyInfo.cs index 1d7137a0..54f5b88a 100644 --- a/OptimizelySDK.Net40/Properties/AssemblyInfo.cs +++ b/OptimizelySDK.Net40/Properties/AssemblyInfo.cs @@ -35,6 +35,6 @@ // Build Number // Revision // -[assembly: AssemblyVersion("3.11.3.0")] -[assembly: AssemblyFileVersion("3.11.3.0")] -[assembly: AssemblyInformationalVersion("3.11.3")] // Used by Nuget. +[assembly: AssemblyVersion("3.11.4.0")] +[assembly: AssemblyFileVersion("3.11.4.0")] +[assembly: AssemblyInformationalVersion("3.11.4")] // Used by Nuget. diff --git a/OptimizelySDK.NetStandard16/Properties/AssemblyInfo.cs b/OptimizelySDK.NetStandard16/Properties/AssemblyInfo.cs index 9ecccade..f90fcb0a 100644 --- a/OptimizelySDK.NetStandard16/Properties/AssemblyInfo.cs +++ b/OptimizelySDK.NetStandard16/Properties/AssemblyInfo.cs @@ -35,6 +35,6 @@ // Build Number // Revision // -[assembly: AssemblyVersion("3.11.3.0")] -[assembly: AssemblyFileVersion("3.11.3.0")] -[assembly: AssemblyInformationalVersion("3.11.3")] // Used by Nuget. +[assembly: AssemblyVersion("3.11.4.0")] +[assembly: AssemblyFileVersion("3.11.4.0")] +[assembly: AssemblyInformationalVersion("3.11.4")] // Used by Nuget. diff --git a/OptimizelySDK.NetStandard20/Properties/AssemblyInfo.cs b/OptimizelySDK.NetStandard20/Properties/AssemblyInfo.cs index 4f7815f6..4629cb23 100644 --- a/OptimizelySDK.NetStandard20/Properties/AssemblyInfo.cs +++ b/OptimizelySDK.NetStandard20/Properties/AssemblyInfo.cs @@ -35,6 +35,6 @@ // Build Number // Revision // -[assembly: AssemblyVersion("3.11.3.0")] -[assembly: AssemblyFileVersion("3.11.3.0")] -[assembly: AssemblyInformationalVersion("3.11.3")] // Used by Nuget. +[assembly: AssemblyVersion("3.11.4.0")] +[assembly: AssemblyFileVersion("3.11.4.0")] +[assembly: AssemblyInformationalVersion("3.11.4")] // Used by Nuget. diff --git a/OptimizelySDK.Tests/Properties/AssemblyInfo.cs b/OptimizelySDK.Tests/Properties/AssemblyInfo.cs index f91d74aa..801bba21 100644 --- a/OptimizelySDK.Tests/Properties/AssemblyInfo.cs +++ b/OptimizelySDK.Tests/Properties/AssemblyInfo.cs @@ -29,6 +29,6 @@ // Build Number // Revision // -[assembly: AssemblyVersion("3.11.3.0")] -[assembly: AssemblyFileVersion("3.11.3.0")] -[assembly: AssemblyInformationalVersion("3.11.3")] // Used by Nuget. +[assembly: AssemblyVersion("3.11.4.0")] +[assembly: AssemblyFileVersion("3.11.4.0")] +[assembly: AssemblyInformationalVersion("3.11.4")] // Used by Nuget. diff --git a/OptimizelySDK/Properties/AssemblyInfo.cs b/OptimizelySDK/Properties/AssemblyInfo.cs index d32e281e..45d1dfa7 100644 --- a/OptimizelySDK/Properties/AssemblyInfo.cs +++ b/OptimizelySDK/Properties/AssemblyInfo.cs @@ -40,9 +40,6 @@ // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.11.2.1")] -[assembly: AssemblyFileVersion("3.11.2.1")] -[assembly: AssemblyInformationalVersion("3.11.1")] // Used by Nuget. +[assembly: AssemblyVersion("3.11.4.0")] +[assembly: AssemblyFileVersion("3.11.4.0")] +[assembly: AssemblyInformationalVersion("3.11.4")] // Used by Nuget. From 0c4fd25052c769402e09c5ad4ebaacb6bbdb17c7 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Wed, 26 Jul 2023 16:26:31 -0400 Subject: [PATCH 04/21] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3a777ff..8b6c9f94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Optimizely C# SDK Changelog +## 3.11.4 +July 26, 2023 + +### Bug Fix +- Fix Last-Modified date & time format for If-Modified-Since ([#361](https://github.com/optimizely/csharp-sdk/pull/361)). + ## 3.11.3 July 18, 2023 From 581ab67db0cd075634a74e14e10aa3f4bfbe0532 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Wed, 26 Jul 2023 16:27:30 -0400 Subject: [PATCH 05/21] Put back Linq import --- OptimizelySDK/Config/HttpProjectConfigManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OptimizelySDK/Config/HttpProjectConfigManager.cs b/OptimizelySDK/Config/HttpProjectConfigManager.cs index 563cbd5a..ed032b8e 100644 --- a/OptimizelySDK/Config/HttpProjectConfigManager.cs +++ b/OptimizelySDK/Config/HttpProjectConfigManager.cs @@ -18,6 +18,7 @@ using OptimizelySDK.Logger; using OptimizelySDK.Notifications; using System; +using System.Linq; using System.Net; using System.Threading.Tasks; From fa708bd9b5cc42aa18bc854d89f81ef1cb7cad04 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Wed, 26 Jul 2023 16:32:54 -0400 Subject: [PATCH 06/21] Alpha sort imports --- .../ConfigTest/HttpProjectConfigManagerTest.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OptimizelySDK.Tests/ConfigTest/HttpProjectConfigManagerTest.cs b/OptimizelySDK.Tests/ConfigTest/HttpProjectConfigManagerTest.cs index 884d9b92..8a4f831b 100644 --- a/OptimizelySDK.Tests/ConfigTest/HttpProjectConfigManagerTest.cs +++ b/OptimizelySDK.Tests/ConfigTest/HttpProjectConfigManagerTest.cs @@ -14,17 +14,17 @@ * limitations under the License. */ -using System; -using System.Collections.Generic; -using System.Net; -using System.Net.Http; -using System.Threading.Tasks; using Moq; using NUnit.Framework; using OptimizelySDK.Config; using OptimizelySDK.Logger; using OptimizelySDK.Tests.NotificationTests; using OptimizelySDK.Tests.Utils; +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; namespace OptimizelySDK.Tests.DatafileManagement_Tests { From 49dda1e1866f84d00f47fc1dde6fefb4118755d5 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Wed, 26 Jul 2023 17:07:28 -0400 Subject: [PATCH 07/21] Change integration_test.yml branch --- .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 340df917..72549c15 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -101,7 +101,7 @@ jobs: integration_tests: name: Run Integration Tests needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@mike/pick-prep-3.11.4 + uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@release-3.11.4 secrets: CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} @@ -109,7 +109,7 @@ jobs: fullstack_production_suite: name: Run Performance Tests needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@mike/pick-prep-3.11.4 + uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@release-3.11.4 with: FULLSTACK_TEST_REPO: ProdTesting secrets: From 819bc07cf004acf65e460bbad3681eb0e55c02be Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Thu, 27 Jul 2023 11:59:34 -0400 Subject: [PATCH 08/21] Adjust branch & env var --- .github/workflows/csharp.yml | 4 ++-- .github/workflows/integration_test.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index 72549c15..340df917 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -101,7 +101,7 @@ jobs: integration_tests: name: Run Integration Tests needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@release-3.11.4 + uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@mike/pick-prep-3.11.4 secrets: CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} @@ -109,7 +109,7 @@ jobs: fullstack_production_suite: name: Run Performance Tests needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@release-3.11.4 + uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@mike/pick-prep-3.11.4 with: FULLSTACK_TEST_REPO: ProdTesting secrets: diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index eaa54405..cf977685 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -47,7 +47,7 @@ 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 }} + TOKEN: ${{ secrets.CI_USER_TOKEN }} EVENT_MESSAGE: ${{ github.event.message }} HOME: 'home/runner' run: | From c77fd87a9c0d53dc0fde2661a23f6ce90a54d937 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Thu, 27 Jul 2023 16:39:47 -0400 Subject: [PATCH 09/21] Use hash for integration_test.yml --- .github/workflows/csharp.yml | 4 ++-- .github/workflows/integration_test.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index 340df917..83d89998 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -101,7 +101,7 @@ jobs: integration_tests: name: Run Integration Tests needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@mike/pick-prep-3.11.4 + uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@819bc07cf004acf65e460bbad3681eb0e55c02be secrets: CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} @@ -109,7 +109,7 @@ jobs: fullstack_production_suite: name: Run Performance Tests needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@mike/pick-prep-3.11.4 + uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@819bc07cf004acf65e460bbad3681eb0e55c02be with: FULLSTACK_TEST_REPO: ProdTesting secrets: diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index cf977685..eaa54405 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -47,7 +47,7 @@ jobs: PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }} PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} UPSTREAM_SHA: ${{ github.sha }} - TOKEN: ${{ secrets.CI_USER_TOKEN }} + TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} EVENT_MESSAGE: ${{ github.event.message }} HOME: 'home/runner' run: | From f66569961c697235f5f3e5ef8f8f7888cea19090 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Thu, 27 Jul 2023 16:59:48 -0400 Subject: [PATCH 10/21] Remove branch designations --- .github/workflows/csharp.yml | 4 ++-- .github/workflows/integration_test.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index 83d89998..645cc49d 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -101,7 +101,7 @@ jobs: integration_tests: name: Run Integration Tests needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@819bc07cf004acf65e460bbad3681eb0e55c02be + uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml secrets: CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} @@ -109,7 +109,7 @@ jobs: fullstack_production_suite: name: Run Performance Tests needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@819bc07cf004acf65e460bbad3681eb0e55c02be + uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml with: FULLSTACK_TEST_REPO: ProdTesting secrets: diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index eaa54405..130d2d05 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -41,7 +41,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }} EVENT_TYPE: ${{ github.event_name }} GITHUB_CONTEXT: ${{ toJson(github) }} - REPO_SLUG: optimizely/fullstack-sdk-compatibility-suite@b45d804ce7670090341fcbae91f5daa39b03aa94 + # REPO_SLUG: ${{ github.repository }} PULL_REQUEST_SLUG: ${{ github.repository }} UPSTREAM_REPO: ${{ github.repository }} PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }} From 76eee273c2350c47d1257fd4786c1f4ced4088c9 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Thu, 27 Jul 2023 17:04:36 -0400 Subject: [PATCH 11/21] @master needed? --- .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 645cc49d..1df0386a 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -101,7 +101,7 @@ jobs: integration_tests: name: Run Integration Tests needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml + uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@master secrets: CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} @@ -109,7 +109,7 @@ jobs: fullstack_production_suite: name: Run Performance Tests needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml + uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@master with: FULLSTACK_TEST_REPO: ProdTesting secrets: From 9f9766ea31eb5d0345ec7c62ec21d6d551bc92c3 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Thu, 27 Jul 2023 17:39:11 -0400 Subject: [PATCH 12/21] Use before-odp tag for REPO_SLUG --- .github/workflows/integration_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 130d2d05..c868db6e 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -41,7 +41,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }} EVENT_TYPE: ${{ github.event_name }} GITHUB_CONTEXT: ${{ toJson(github) }} - # REPO_SLUG: ${{ github.repository }} + REPO_SLUG: optimizely/fullstack-sdk-compatibility-suite@before-odp PULL_REQUEST_SLUG: ${{ github.repository }} UPSTREAM_REPO: ${{ github.repository }} PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }} From 184b4754f68bcd416952df2fe7427baaeef1c547 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 28 Jul 2023 11:21:02 -0400 Subject: [PATCH 13/21] Skipping steps while iterating --- .github/workflows/csharp.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index 1df0386a..852849b5 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -8,6 +8,7 @@ on: jobs: lintCodebase: + if: ${{ false }} # intentionally skipping runs-on: ubuntu-latest name: Lint Codebase steps: @@ -26,6 +27,7 @@ jobs: netFrameworksAndUnitTest: name: Build Framework & Run Unit Tests + if: ${{ false }} # intentionally skipping needs: [ lintCodebase ] runs-on: windows-2019 # required version for Framework 4.0 env: @@ -54,6 +56,7 @@ jobs: netStandard16: name: Build Standard 1.6 + if: ${{ false }} # intentionally skipping needs: [ netFrameworksAndUnitTest ] runs-on: windows-2022 env: @@ -77,6 +80,7 @@ jobs: netStandard20: name: Build Standard 2.0 + if: ${{ false }} # intentionally skipping needs: [ netFrameworksAndUnitTest ] runs-on: windows-2022 env: @@ -101,15 +105,16 @@ 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@mike/pick-prep-3.11.4 secrets: CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} fullstack_production_suite: name: Run Performance Tests + if: ${{ false }} # intentionally skipping needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@master + uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@mike/pick-prep-3.11.4 with: FULLSTACK_TEST_REPO: ProdTesting secrets: From 49ac94e15eb6eb443a9aadf417cc815b0f7cabdb Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 28 Jul 2023 11:23:08 -0400 Subject: [PATCH 14/21] Trigger on push for now too --- .github/workflows/csharp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index 852849b5..2f4c5d88 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -2,7 +2,7 @@ name: Continuous Integration on: push: - branches: [ release-3.11.4 ] + branches: [ release-3.11.4, mike/pick-prep-3.11.4 ] pull_request: branches: [ release-3.11.4 ] From 12ff8fbd47855d85e3b6e47461b24a573af92cb9 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 28 Jul 2023 11:25:25 -0400 Subject: [PATCH 15/21] Focus on executing FSC --- .github/workflows/csharp.yml | 200 +++++++++++++++++------------------ 1 file changed, 98 insertions(+), 102 deletions(-) diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index 2f4c5d88..12251c00 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -7,116 +7,112 @@ on: branches: [ release-3.11.4 ] jobs: - lintCodebase: - if: ${{ false }} # intentionally skipping - runs-on: ubuntu-latest - name: Lint Codebase - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - # Full git history is needed to get a proper list of changed files - fetch-depth: 0 - - name: Run Super-Linter - uses: github/super-linter@v4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VALIDATE_ALL_CODEBASE: false - DEFAULT_BRANCH: master - VALIDATE_CSHARP: true +# lintCodebase: +# runs-on: ubuntu-latest +# name: Lint Codebase +# steps: +# - name: Checkout code +# uses: actions/checkout@v3 +# with: +# # Full git history is needed to get a proper list of changed files +# fetch-depth: 0 +# - name: Run Super-Linter +# uses: github/super-linter@v4 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# VALIDATE_ALL_CODEBASE: false +# DEFAULT_BRANCH: master +# VALIDATE_CSHARP: true - netFrameworksAndUnitTest: - name: Build Framework & Run Unit Tests - if: ${{ false }} # intentionally skipping - needs: [ lintCodebase ] - runs-on: windows-2019 # required version for Framework 4.0 - env: - REPO_SLUG: ${{ github.repository }} - BUILD_NUMBER: ${{ github.run_id }} - ATTEMPT_NUM: ${{ github.run_attempt }} - RUN_NUMBER: ${{ github.run_number }} - EVENT_TYPE: ${{ github.event_name }} - CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} - steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1 - - name: Setup NuGet - uses: NuGet/setup-nuget@v1 - - name: Restore NuGet packages - run: nuget restore ./OptimizelySDK.NETFramework.sln - - name: Build & strongly name assemblies - run: msbuild /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(pwd)/keypair.snk /p:Configuration=Release ./OptimizelySDK.NETFramework.sln - - name: Install & Run NUnit tests - run: | - nuget install NUnit.Console -Version 3.15.2 -DirectDownload -OutputDirectory . - # https://docs.nunit.org/articles/nunit/running-tests/Console-Command-Line.html - ./NUnit.ConsoleRunner.3.15.2\tools\nunit3-console.exe /timeout 10000 /process Separate ./OptimizelySDK.Tests/bin/Release/OptimizelySDK.Tests.dll +# netFrameworksAndUnitTest: +# name: Build Framework & Run Unit Tests +# needs: [ lintCodebase ] +# runs-on: windows-2019 # required version for Framework 4.0 +# env: +# REPO_SLUG: ${{ github.repository }} +# BUILD_NUMBER: ${{ github.run_id }} +# ATTEMPT_NUM: ${{ github.run_attempt }} +# RUN_NUMBER: ${{ github.run_number }} +# EVENT_TYPE: ${{ github.event_name }} +# CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} +# steps: +# - name: Checkout code +# uses: actions/checkout@v3 +# - name: Add msbuild to PATH +# uses: microsoft/setup-msbuild@v1 +# - name: Setup NuGet +# uses: NuGet/setup-nuget@v1 +# - name: Restore NuGet packages +# run: nuget restore ./OptimizelySDK.NETFramework.sln +# - name: Build & strongly name assemblies +# run: msbuild /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(pwd)/keypair.snk /p:Configuration=Release ./OptimizelySDK.NETFramework.sln +# - name: Install & Run NUnit tests +# run: | +# nuget install NUnit.Console -Version 3.15.2 -DirectDownload -OutputDirectory . +# # https://docs.nunit.org/articles/nunit/running-tests/Console-Command-Line.html +# ./NUnit.ConsoleRunner.3.15.2\tools\nunit3-console.exe /timeout 10000 /process Separate ./OptimizelySDK.Tests/bin/Release/OptimizelySDK.Tests.dll - netStandard16: - name: Build Standard 1.6 - if: ${{ false }} # intentionally skipping - needs: [ netFrameworksAndUnitTest ] - runs-on: windows-2022 - env: - REPO_SLUG: ${{ github.repository }} - BUILD_NUMBER: ${{ github.run_id }} - ATTEMPT_NUM: ${{ github.run_attempt }} - RUN_NUMBER: ${{ github.run_number }} - EVENT_TYPE: ${{ github.event_name }} - CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} - steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Setup .NET - uses: actions/setup-dotnet@v2 - with: - dotnet-version: 3.1.x - - 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 +# netStandard16: +# name: Build Standard 1.6 +# needs: [ netFrameworksAndUnitTest ] +# runs-on: windows-2022 +# env: +# REPO_SLUG: ${{ github.repository }} +# BUILD_NUMBER: ${{ github.run_id }} +# ATTEMPT_NUM: ${{ github.run_attempt }} +# RUN_NUMBER: ${{ github.run_number }} +# EVENT_TYPE: ${{ github.event_name }} +# CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} +# steps: +# - name: Checkout code +# uses: actions/checkout@v3 +# - name: Setup .NET +# uses: actions/setup-dotnet@v2 +# with: +# dotnet-version: 3.1.x +# - 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 - netStandard20: - name: Build Standard 2.0 - if: ${{ false }} # intentionally skipping - needs: [ netFrameworksAndUnitTest ] - runs-on: windows-2022 - env: - REPO_SLUG: ${{ github.repository }} - BUILD_NUMBER: ${{ github.run_id }} - ATTEMPT_NUM: ${{ github.run_attempt }} - RUN_NUMBER: ${{ github.run_number }} - EVENT_TYPE: ${{ github.event_name }} - CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} - steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Setup .NET - uses: actions/setup-dotnet@v2 - with: - dotnet-version: 3.1.x - - 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 +# netStandard20: +# name: Build Standard 2.0 +# needs: [ netFrameworksAndUnitTest ] +# runs-on: windows-2022 +# env: +# REPO_SLUG: ${{ github.repository }} +# BUILD_NUMBER: ${{ github.run_id }} +# ATTEMPT_NUM: ${{ github.run_attempt }} +# RUN_NUMBER: ${{ github.run_number }} +# EVENT_TYPE: ${{ github.event_name }} +# CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} +# steps: +# - name: Checkout code +# uses: actions/checkout@v3 +# - name: Setup .NET +# uses: actions/setup-dotnet@v2 +# with: +# dotnet-version: 3.1.x +# - 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 integration_tests: name: Run Integration Tests - needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] +# needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@mike/pick-prep-3.11.4 secrets: CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} - fullstack_production_suite: - name: Run Performance Tests - if: ${{ false }} # intentionally skipping - needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@mike/pick-prep-3.11.4 - with: - FULLSTACK_TEST_REPO: ProdTesting - secrets: - CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} - TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} +# fullstack_production_suite: +# name: Run Performance Tests +# if: ${{ false }} # intentionally skipping +# needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] +# uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@mike/pick-prep-3.11.4 +# with: +# FULLSTACK_TEST_REPO: ProdTesting +# secrets: +# CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} +# TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} From 5a1cc4cf028d0ef87f08a73876a3ea013bb62eb7 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 28 Jul 2023 11:26:55 -0400 Subject: [PATCH 16/21] Use commit hash --- .github/workflows/csharp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index 12251c00..ac553258 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -101,7 +101,7 @@ jobs: integration_tests: name: Run Integration Tests # needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@mike/pick-prep-3.11.4 + uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@12ff8fbd47855d85e3b6e47461b24a573af92cb9 secrets: CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} From 798e6d8c4ce28ac962cee0ee61d741dbd27b30db Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 28 Jul 2023 11:29:08 -0400 Subject: [PATCH 17/21] Update TOKEN --- .github/workflows/integration_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index c868db6e..89d55d0d 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -47,7 +47,7 @@ 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 }} + TOKEN: ${{ secrets.CI_USER_TOKEN }} EVENT_MESSAGE: ${{ github.event.message }} HOME: 'home/runner' run: | From 54a6b2c6b4ebaabed5eef028d1976f12750af58f Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 28 Jul 2023 11:32:59 -0400 Subject: [PATCH 18/21] Use commit hash for FSC --- .github/workflows/integration_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 89d55d0d..eaa54405 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -41,13 +41,13 @@ jobs: GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }} EVENT_TYPE: ${{ github.event_name }} GITHUB_CONTEXT: ${{ toJson(github) }} - REPO_SLUG: optimizely/fullstack-sdk-compatibility-suite@before-odp + REPO_SLUG: optimizely/fullstack-sdk-compatibility-suite@b45d804ce7670090341fcbae91f5daa39b03aa94 PULL_REQUEST_SLUG: ${{ github.repository }} UPSTREAM_REPO: ${{ github.repository }} PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }} PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} UPSTREAM_SHA: ${{ github.sha }} - TOKEN: ${{ secrets.CI_USER_TOKEN }} + TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} EVENT_MESSAGE: ${{ github.event.message }} HOME: 'home/runner' run: | From f27d3ecc8813e4f8f3a61388c777ce0e4249b67b Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 28 Jul 2023 11:44:24 -0400 Subject: [PATCH 19/21] Remove has and test --- .github/workflows/integration_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index eaa54405..6b6965b2 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -41,7 +41,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }} EVENT_TYPE: ${{ github.event_name }} GITHUB_CONTEXT: ${{ toJson(github) }} - REPO_SLUG: optimizely/fullstack-sdk-compatibility-suite@b45d804ce7670090341fcbae91f5daa39b03aa94 + REPO_SLUG: optimizely/fullstack-sdk-compatibility-suite PULL_REQUEST_SLUG: ${{ github.repository }} UPSTREAM_REPO: ${{ github.repository }} PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }} From 4bb80a1e499cb35db778341b0758b87b62aacc3a Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 28 Jul 2023 11:55:25 -0400 Subject: [PATCH 20/21] Testing call to trigger-script-with-status-update.sh --- .github/workflows/csharp.yml | 4 ++-- .github/workflows/integration_test.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index ac553258..33ef552f 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -2,7 +2,7 @@ name: Continuous Integration on: push: - branches: [ release-3.11.4, mike/pick-prep-3.11.4 ] + branches: [ release-3.11.4 ] pull_request: branches: [ release-3.11.4 ] @@ -101,7 +101,7 @@ jobs: integration_tests: name: Run Integration Tests # needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] - uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@12ff8fbd47855d85e3b6e47461b24a573af92cb9 + uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@mike/pick-prep-3.11.4 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 6b6965b2..6361ceb4 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -41,7 +41,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }} EVENT_TYPE: ${{ github.event_name }} GITHUB_CONTEXT: ${{ toJson(github) }} - REPO_SLUG: optimizely/fullstack-sdk-compatibility-suite + # REPO_SLUG: ${{ github.repository }} PULL_REQUEST_SLUG: ${{ github.repository }} UPSTREAM_REPO: ${{ github.repository }} PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }} @@ -52,4 +52,4 @@ jobs: HOME: 'home/runner' run: | echo "$GITHUB_CONTEXT" - home/runner/travisci-tools/trigger-script-with-status-update.sh + home/runner/travisci-tools/trigger-script-with-status-update.sh before-odp From 74f09f7bd783a7df316e4b4130f161b7841f4eff Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 28 Jul 2023 12:11:41 -0400 Subject: [PATCH 21/21] Re-enable all the jobs --- .github/workflows/csharp.yml | 195 ++++++++++++------------- .github/workflows/integration_test.yml | 2 + 2 files changed, 99 insertions(+), 98 deletions(-) diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index 33ef552f..340df917 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -7,112 +7,111 @@ on: branches: [ release-3.11.4 ] jobs: -# lintCodebase: -# runs-on: ubuntu-latest -# name: Lint Codebase -# steps: -# - name: Checkout code -# uses: actions/checkout@v3 -# with: -# # Full git history is needed to get a proper list of changed files -# fetch-depth: 0 -# - name: Run Super-Linter -# uses: github/super-linter@v4 -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# VALIDATE_ALL_CODEBASE: false -# DEFAULT_BRANCH: master -# VALIDATE_CSHARP: true + lintCodebase: + runs-on: ubuntu-latest + name: Lint Codebase + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + # Full git history is needed to get a proper list of changed files + fetch-depth: 0 + - name: Run Super-Linter + uses: github/super-linter@v4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_ALL_CODEBASE: false + DEFAULT_BRANCH: master + VALIDATE_CSHARP: true -# netFrameworksAndUnitTest: -# name: Build Framework & Run Unit Tests -# needs: [ lintCodebase ] -# runs-on: windows-2019 # required version for Framework 4.0 -# env: -# REPO_SLUG: ${{ github.repository }} -# BUILD_NUMBER: ${{ github.run_id }} -# ATTEMPT_NUM: ${{ github.run_attempt }} -# RUN_NUMBER: ${{ github.run_number }} -# EVENT_TYPE: ${{ github.event_name }} -# CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} -# steps: -# - name: Checkout code -# uses: actions/checkout@v3 -# - name: Add msbuild to PATH -# uses: microsoft/setup-msbuild@v1 -# - name: Setup NuGet -# uses: NuGet/setup-nuget@v1 -# - name: Restore NuGet packages -# run: nuget restore ./OptimizelySDK.NETFramework.sln -# - name: Build & strongly name assemblies -# run: msbuild /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(pwd)/keypair.snk /p:Configuration=Release ./OptimizelySDK.NETFramework.sln -# - name: Install & Run NUnit tests -# run: | -# nuget install NUnit.Console -Version 3.15.2 -DirectDownload -OutputDirectory . -# # https://docs.nunit.org/articles/nunit/running-tests/Console-Command-Line.html -# ./NUnit.ConsoleRunner.3.15.2\tools\nunit3-console.exe /timeout 10000 /process Separate ./OptimizelySDK.Tests/bin/Release/OptimizelySDK.Tests.dll + netFrameworksAndUnitTest: + name: Build Framework & Run Unit Tests + needs: [ lintCodebase ] + runs-on: windows-2019 # required version for Framework 4.0 + env: + REPO_SLUG: ${{ github.repository }} + BUILD_NUMBER: ${{ github.run_id }} + ATTEMPT_NUM: ${{ github.run_attempt }} + RUN_NUMBER: ${{ github.run_number }} + EVENT_TYPE: ${{ github.event_name }} + CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1 + - name: Setup NuGet + uses: NuGet/setup-nuget@v1 + - name: Restore NuGet packages + run: nuget restore ./OptimizelySDK.NETFramework.sln + - name: Build & strongly name assemblies + run: msbuild /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(pwd)/keypair.snk /p:Configuration=Release ./OptimizelySDK.NETFramework.sln + - name: Install & Run NUnit tests + run: | + nuget install NUnit.Console -Version 3.15.2 -DirectDownload -OutputDirectory . + # https://docs.nunit.org/articles/nunit/running-tests/Console-Command-Line.html + ./NUnit.ConsoleRunner.3.15.2\tools\nunit3-console.exe /timeout 10000 /process Separate ./OptimizelySDK.Tests/bin/Release/OptimizelySDK.Tests.dll -# netStandard16: -# name: Build Standard 1.6 -# needs: [ netFrameworksAndUnitTest ] -# runs-on: windows-2022 -# env: -# REPO_SLUG: ${{ github.repository }} -# BUILD_NUMBER: ${{ github.run_id }} -# ATTEMPT_NUM: ${{ github.run_attempt }} -# RUN_NUMBER: ${{ github.run_number }} -# EVENT_TYPE: ${{ github.event_name }} -# CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} -# steps: -# - name: Checkout code -# uses: actions/checkout@v3 -# - name: Setup .NET -# uses: actions/setup-dotnet@v2 -# with: -# dotnet-version: 3.1.x -# - 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 + netStandard16: + name: Build Standard 1.6 + needs: [ netFrameworksAndUnitTest ] + runs-on: windows-2022 + env: + REPO_SLUG: ${{ github.repository }} + BUILD_NUMBER: ${{ github.run_id }} + ATTEMPT_NUM: ${{ github.run_attempt }} + RUN_NUMBER: ${{ github.run_number }} + EVENT_TYPE: ${{ github.event_name }} + CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 3.1.x + - 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 -# netStandard20: -# name: Build Standard 2.0 -# needs: [ netFrameworksAndUnitTest ] -# runs-on: windows-2022 -# env: -# REPO_SLUG: ${{ github.repository }} -# BUILD_NUMBER: ${{ github.run_id }} -# ATTEMPT_NUM: ${{ github.run_attempt }} -# RUN_NUMBER: ${{ github.run_number }} -# EVENT_TYPE: ${{ github.event_name }} -# CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} -# steps: -# - name: Checkout code -# uses: actions/checkout@v3 -# - name: Setup .NET -# uses: actions/setup-dotnet@v2 -# with: -# dotnet-version: 3.1.x -# - 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 + netStandard20: + name: Build Standard 2.0 + needs: [ netFrameworksAndUnitTest ] + runs-on: windows-2022 + env: + REPO_SLUG: ${{ github.repository }} + BUILD_NUMBER: ${{ github.run_id }} + ATTEMPT_NUM: ${{ github.run_attempt }} + RUN_NUMBER: ${{ github.run_number }} + EVENT_TYPE: ${{ github.event_name }} + CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 3.1.x + - 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 integration_tests: name: Run Integration Tests -# needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] + needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@mike/pick-prep-3.11.4 secrets: CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} -# fullstack_production_suite: -# name: Run Performance Tests -# if: ${{ false }} # intentionally skipping -# needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] -# uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@mike/pick-prep-3.11.4 -# with: -# FULLSTACK_TEST_REPO: ProdTesting -# 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@mike/pick-prep-3.11.4 + 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 6361ceb4..6540da3f 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -52,4 +52,6 @@ jobs: HOME: 'home/runner' run: | echo "$GITHUB_CONTEXT" + # Adding the FSC branch that does not include tests for ODP (before-odp) + # Remember to also disable the ODP_SERVER and ATS_API features in app-dot home/runner/travisci-tools/trigger-script-with-status-update.sh before-odp