Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
prepare 5.7.0 release (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
eli-darkly authored Sep 13, 2019
1 parent 7697fbf commit 4ab5903
Show file tree
Hide file tree
Showing 66 changed files with 4,299 additions and 2,450 deletions.
82 changes: 70 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,83 @@
version: 2
version: 2.1

workflows:
version: 2
test:
jobs:
- test-1.1
- test-2.0
- test-netcore-1-1
- test-netcore-2-0
- test-windows-netframework-4-5

orbs:
win: circleci/[email protected]

jobs:
test-1.1:
test-netcore-1-1:
docker:
- image: microsoft/dotnet:1.1-sdk
steps:
- checkout
- run: dotnet restore
- run: dotnet build src/LaunchDarkly.ServerSdk -f netstandard1.4
- run: dotnet build src/LaunchDarkly.ServerSdk -f netstandard1.6
- run: dotnet test test/LaunchDarkly.ServerSdk.Tests/LaunchDarkly.ServerSdk.Tests.csproj -f netcoreapp1.1
test-2.0:
- restore_cache:
keys:
- netcore11-deps-{{ checksum "src/LaunchDarkly.ServerSdk/LaunchDarkly.ServerSdk.csproj" }}-{{ checksum "test/LaunchDarkly.ServerSdk.Tests/LaunchDarkly.ServerSdk.Tests.csproj" }}
- run:
name: install project dependencies
command: dotnet restore
- save_cache:
key: netcore11-deps-{{ checksum "src/LaunchDarkly.ServerSdk/LaunchDarkly.ServerSdk.csproj" }}-{{ checksum "test/LaunchDarkly.ServerSdk.Tests/LaunchDarkly.ServerSdk.Tests.csproj" }}
paths:
- /root/.nuget/packages
- run:
name: build SDK for .NET Standard 1.4
command: dotnet build src/LaunchDarkly.ServerSdk -f netstandard1.4
- run:
name: build SRC for .NET Standard 1.6
command: dotnet build src/LaunchDarkly.ServerSdk -f netstandard1.6
- run:
name: run tests in .NET Core 1.1
command: dotnet test test/LaunchDarkly.ServerSdk.Tests/LaunchDarkly.ServerSdk.Tests.csproj -f netcoreapp1.1

test-netcore-2-0:
docker:
- image: microsoft/dotnet:2.0-sdk-jessie
steps:
- checkout
- run: dotnet restore
- run: dotnet build src/LaunchDarkly.ServerSdk -f netstandard2.0
- run: dotnet test test/LaunchDarkly.ServerSdk.Tests/LaunchDarkly.ServerSdk.Tests.csproj -f netcoreapp2.0
- restore_cache:
keys:
- netcore20-deps-{{ checksum "src/LaunchDarkly.ServerSdk/LaunchDarkly.ServerSdk.csproj" }}-{{ checksum "test/LaunchDarkly.ServerSdk.Tests/LaunchDarkly.ServerSdk.Tests.csproj" }}
- run:
name: install project dependencies
command: dotnet restore
- save_cache:
key: netcore20-deps-{{ checksum "src/LaunchDarkly.ServerSdk/LaunchDarkly.ServerSdk.csproj" }}-{{ checksum "test/LaunchDarkly.ServerSdk.Tests/LaunchDarkly.ServerSdk.Tests.csproj" }}
paths:
- /root/.nuget/packages
- run:
name: build SDK for .NET Standard 2.0
command: dotnet build src/LaunchDarkly.ServerSdk -f netstandard2.0
- run:
name: run tests in .NET Core 2.0
command: dotnet test test/LaunchDarkly.ServerSdk.Tests/LaunchDarkly.ServerSdk.Tests.csproj -f netcoreapp2.0

test-windows-netframework-4-5:
executor:
name: win/vs2019
shell: powershell.exe
steps:
- checkout
- restore_cache:
keys:
- net45-deps-{{ checksum "src/LaunchDarkly.ServerSdk/LaunchDarkly.ServerSdk.csproj" }}-{{ checksum "test/LaunchDarkly.ServerSdk.Tests/LaunchDarkly.ServerSdk.Tests.csproj" }}
- run:
name: install project dependencies
command: dotnet restore
- save_cache:
key: net45-deps-{{ checksum "src/LaunchDarkly.ServerSdk/LaunchDarkly.ServerSdk.csproj" }}-{{ checksum "test/LaunchDarkly.ServerSdk.Tests/LaunchDarkly.ServerSdk.Tests.csproj" }}
paths:
- C:\Users\circleci\.nuget\packages
- run:
name: build SDK for .NET Framework 4.5
command: dotnet build src/LaunchDarkly.ServerSdk -f net45
- run:
name: run tests in .NET Framework 4.6
command: dotnet test test/LaunchDarkly.ServerSdk.Tests/LaunchDarkly.ServerSdk.Tests.csproj -f net46
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@

All notable changes to the LaunchDarkly .NET Server-Side SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).

## [5.7.0] - 2019-09-12
This release includes new types and deprecations that correspond to upcoming changes in version 6.0.0. Developers are encouraged to start adopting these changes in their code now so that migrating to 6.0.0 in the future will be easier. Most of these changes are related to the use of mutable types, which are undesirable in a concurrent environment. `User` and `Configuration` are currently mutable types; they will be made immutable in the future, so there are now builders for them. Arbitrary JSON values are currently represented with the `Newtonsoft.Json` type `JToken`, which is mutable (if it contains an array or a JSON object); the new type `LdValue` is safer, and will eventually completely replace `JToken` in the public API.

Also, generated HTML documentation for all of the SDK's public types, properties, and methods is now available online at https://launchdarkly.github.io/dotnet-server-sdk/. Currently this will only show the latest released version.

### Added:
- `Configuration.Builder` provides a fluent builder pattern for constructing `Configuration` objects. This is now the preferred method for building a user, rather than using `ConfigurationExtension` methods like `WithStartWaitTime()` that modify the existing configuration object.
- `Configuration.EventCapacity` and `Configuration.EventFlushInterval` (new names for `EventQueueCapacity` and `EventQueueFrequency`, for consistency with other LaunchDarkly SDKs).
- `User.Builder` provides a fluent builder pattern for constructing `User` objects. This is now the preferred method for building a user, rather than setting `User` properties directly or using `UserExtension` methods like `AndName()` that modify the existing user object.
- `User.IPAddress` is equivalent to `User.IpAddress`, but has the standard .NET capitalization for two-letter acronyms.
- The new `LdValue` type is a better alternative to using `JToken`, `JValue`, `JArray`, etc. for arbitrary JSON values (such as the return value of `JsonVariation`, or a custom attribute for a user).
- There is now more debug-level logging for stream connection state changes.
- XML documentation comments are now included in the package for all target frameworks. Previously they were only included for .NET Standard 1.4.

### Changed:
- Calls to flag evaluation methods such as `BoolVariation` are now somewhat more efficient because they no longer convert the default value to a `JToken` internally; also, user attributes no longer need to be converted to `JToken` internally when evaluating flag rules. If flag evaluations are very frequent, this reduces the number of ephemeral objects created on the heap.

### Fixed:
- Due to the default parsing behavior of `Newtonsoft.Json`, strings in the date/time format "1970-01-01T00:00:01Z" or "1970-01-01T00:00:01.001Z" would not be considered equal to an identical string in a flag rule.

### Deprecated:
- All `ConfigurationExtension` methods are now deprecated.
- `Configuration.SamplingInterval`. The intended use case for the `SamplingInterval` feature was to reduce analytics event network usage in high-traffic applications. This feature is being deprecated in favor of summary counters, which are meant to track all events.
- `Configuration.EventQueueCapacity` and `Configuration.EventQueueFrequency` (see new names above).
- `User` constructors (use `User.WithKey` or `User.Builder`).
- `User.IpAddress` (use `IPAddress`).
- All `UserExtension` methods are now deprecated. The setters for all `User` properties should also be considered deprecated, although C# does not allow these to be marked with `[Obsolete]`.
- `IBaseConfiguration` and `ICommonLdClient` interfaces.
- The `InMemoryFeatureStore` constructor. Use `Components.InMemoryFeatureStore`.

## [5.6.5] - 2019-05-30
### Fixed:
- If streaming is disabled, polling requests could stop working if the client ever received an HTTP error from LaunchDarkly. This bug was introduced in the 5.6.3 release.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Building the code locally in the default Debug configuration does not sign the a

Check out our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](https://docs.launchdarkly.com/docs/dotnet-sdk-reference).

The authoritative description of all types, properties, and methods is in the [generated API documentation](https://launchdarkly.github.io/dotnet-server-sdk/).

## Testing

We run integration tests for all our SDKs using a centralized test harness. This approach gives us the ability to test for consistency across SDKs, as well as test networking behavior in a long-running application. These tests cover each method in the SDK, and verify that event sending, flag evaluation, stream reconnection, and other aspects of the SDK all behave correctly.
Expand Down
41 changes: 0 additions & 41 deletions azure-pipelines.yml

This file was deleted.

7 changes: 7 additions & 0 deletions docs/launchdarkly.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

/* LaunchDarkly additions to default Sandcastle styles */

/* hide search box because it is PHP-based and can't work in Github Pages */
form#SearchForm {
display: none;
}
97 changes: 97 additions & 0 deletions docs/project.shfbproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- The configuration and platform will be used to determine which assemblies to include from solution and
project documentation sources -->
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0555bc4c-d824-4f83-a272-6bcac93347a1}</ProjectGuid>
<SHFBSchemaVersion>2017.9.26.0</SHFBSchemaVersion>
<!-- AssemblyName, Name, and RootNamespace are not used by SHFB but Visual Studio adds them anyway -->
<AssemblyName>Documentation</AssemblyName>
<RootNamespace>Documentation</RootNamespace>
<Name>Documentation</Name>
<!-- SHFB properties -->
<FrameworkVersion>.NET Framework 4.5</FrameworkVersion>
<OutputPath>.\build\html</OutputPath>
<HtmlHelpName>Documentation</HtmlHelpName>
<Language>en-US</Language>
<DocumentationSources>
<!-- note that the LaunchDarkly.CommonSdk files must be copied to this location by build-docs.ps1 -->
<DocumentationSource sourceFile="..\src\LaunchDarkly.ServerSdk\bin\Debug\net45\LaunchDarkly.ServerSdk.xml" />
<DocumentationSource sourceFile="..\src\LaunchDarkly.ServerSdk\bin\Debug\net45\LaunchDarkly.ServerSdk.dll" />
<DocumentationSource sourceFile="..\src\LaunchDarkly.ServerSdk\bin\Debug\net45\LaunchDarkly.CommonSdk.xml" />
<DocumentationSource sourceFile="..\src\LaunchDarkly.ServerSdk\bin\Debug\net45\LaunchDarkly.CommonSdk.dll" />
</DocumentationSources>
<HelpTitle>LaunchDarkly Server-Side SDK for .NET $(LD_RELEASE_VERSION)</HelpTitle>
<HelpFileVersion>1.0.0.0</HelpFileVersion>
<RootNamespaceContainer>True</RootNamespaceContainer>
<NamespaceGrouping>False</NamespaceGrouping>
<NamingMethod>MemberName</NamingMethod>
<MaximumGroupParts>2</MaximumGroupParts>
<Preliminary>False</Preliminary>
<SdkLinkTarget>Blank</SdkLinkTarget>
<HelpFileFormat>Website</HelpFileFormat>
<SyntaxFilters>C#, Visual Basic</SyntaxFilters>
<PresentationStyle>VS2013</PresentationStyle>
<CleanIntermediates>True</CleanIntermediates>
<KeepLogFile>True</KeepLogFile>
<DisableCodeBlockComponent>False</DisableCodeBlockComponent>
<IndentHtml>False</IndentHtml>
<BuildAssemblerVerbosity>OnlyWarningsAndErrors</BuildAssemblerVerbosity>
<SaveComponentCacheCapacity>100</SaveComponentCacheCapacity>
<NamespaceSummaries>
<NamespaceSummaryItem name="LaunchDarkly.Client" isDocumented="True" xmlns="" />
<NamespaceSummaryItem name="LaunchDarkly.Client.Files" isDocumented="True" xmlns="" />
<NamespaceSummaryItem name="LaunchDarkly.Client.Utils" isDocumented="True" xmlns="" />
<NamespaceSummaryItem name="LaunchDarkly.Common" isDocumented="True" xmlns="" />
</NamespaceSummaries>
</PropertyGroup>
<!-- There are no properties for these groups. AnyCPU needs to appear in order for Visual Studio to perform
the build. The others are optional common platform types that may appear. -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Win32' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Win32' ">
</PropertyGroup>
<!-- Import the SHFB build targets -->
<Import Project="$(SHFBROOT)\SandcastleHelpFileBuilder.targets" />
<!-- The pre-build and post-build event properties must appear *after* the targets file import in order to be
evaluated correctly. -->
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging">
<HintPath>..\src\LaunchDarkly.ServerSdk\bin\Debug\net45\Common.Logging.dll</HintPath>
</Reference>
<Reference Include="Common.Logging.Core">
<HintPath>..\src\LaunchDarkly.ServerSdk\bin\Debug\net45\Common.Logging.Core.dll</HintPath>
</Reference>
<Reference Include="LaunchDarkly.Cache">
<HintPath>..\src\LaunchDarkly.ServerSdk\bin\Debug\net45\LaunchDarkly.Cache.dll</HintPath>
</Reference>
<Reference Include="LaunchDarkly.EventSource">
<HintPath>..\src\LaunchDarkly.ServerSdk\bin\Debug\net45\LaunchDarkly.EventSource.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\src\LaunchDarkly.ServerSdk\bin\Debug\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
77 changes: 77 additions & 0 deletions scripts/build-docs.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

#
# This script builds HTML documentation for the SDK using Sandcastle Help File Builder. It assumes that
# the Sandcastle software is already installed on the host. The Sandcastle GUI is not required, only the
# core tools and the SandcastleBuilderUtils package that provides the MSBuild targets.
#
# The script takes no parameters; it infers the project version by looking at the .csproj file. It starts
# by building the project in Debug configuration.
#
# Since some public APIs are provided by the LaunchDarkly.CommonSdk package, the Sandcastle project is
# configured to merge that package's documentation into this one, which requires some special file
# copying as seen below.
#

# Terminate the script if any PowerShell command fails
$ErrorActionPreference = "Stop"

# Terminate the script if any external command fails
function ExecuteOrFail {
[CmdletBinding()]
param(
[Parameter(Position=0,Mandatory=1)][scriptblock]$cmd,
[Parameter(Position=1,Mandatory=0)][string]$errorMessage = ("Error executing command {0}" -f $cmd)
)
& $cmd
if ($lastexitcode -ne 0) {
throw ($errorMessage)
}
}

ExecuteOrFail { dotnet clean }
ExecuteOrFail { dotnet build src\LaunchDarkly.ServerSdk\LaunchDarkly.ServerSdk.csproj -f net45 }

# Building the SDK causes the assemblies for all its package dependencies to be copied into bin\Debug\net45.
# The .shfbproj is configured to expect them to be there. However, we also need the XML documentation file
# for LaunchDarkly.CommonSdk, which isn't automatically copied. We can get it out of the NuGet package
# cache, but first we need to determine what version of it we're using.
$match = Select-String `
-Path src\LaunchDarkly.ServerSdk\LaunchDarkly.ServerSdk.csproj `
-Pattern "<PackageReference.*""LaunchDarkly.CommonSdk"".*""([^""]*)"""
if ($match.Matches.Length -ne 1) {
throw "Could not find LaunchDarkly.CommonSdk version in project file"
}
$commonSdkVersion = $match.Matches[0].Groups[1].Value
Copy-Item `
-Path $HOME\.nuget\packages\launchdarkly.commonsdk\$commonSdkVersion\lib\net45\LaunchDarkly.CommonSdk.xml `
-Destination src\LaunchDarkly.ServerSdk\bin\Debug\net45

if (Test-Path docs\build) {
Remove-Item -Path docs\build -Recurse -Force
}

$match = Select-String `
-Path src\LaunchDarkly.ServerSdk\LaunchDarkly.ServerSdk.csproj `
-Pattern "<Version>([^<]*)</Version>"
if ($match.Matches.Length -ne 1) {
throw "Could not find SDK version string in project file"
}
$sdkVersion = $match.Matches[0].Groups[1].Value

[System.Environment]::SetEnvironmentVariable("LD_RELEASE_VERSION", $sdkVersion, "Process")

try
{
Push-Location
Set-Location docs
ExecuteOrFail { msbuild project.shfbproj }
}
finally
{
Pop-Location
}

# Add our own stylesheet overrides. You're supposed to be able to put customized stylesheets in
# ./styles (relative to the project file) and have them be automatically copied in, but that
# doesn't seem to work, so we'll just modify the CSS file after building.
Get-Content docs\launchdarkly.css | Add-Content docs\build\html\styles\branding-Website.css
Loading

0 comments on commit 4ab5903

Please sign in to comment.