Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

Commit

Permalink
Merge branch 'features/nuget-key'
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielweyer committed Feb 23, 2019
2 parents 33c4c39 + aa00622 commit 01e828b
Show file tree
Hide file tree
Showing 14 changed files with 74 additions and 29 deletions.
5 changes: 2 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://EditorConfig.org
# EditorConfig is awesome: https://EditorConfig.org

root = true

Expand All @@ -23,5 +22,5 @@ indent_size = 4
indent_style = space
indent_size = 2

[tools/packages.config]
[*.sh]
end_of_line = LF
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
tools/packages.config eol=lf
bootstrap.sh eol=lf

*.ps1 linguist-vendored
*.sh linguist-vendored
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ bin/

# Cake

tools/*
!tools/packages.config
tools/
artifacts/

# Build
# Visual Studio

artifacts/
.vs/
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
branches:
feature[/-]:
feature:
mode: ContinuousDeployment
ignore:
sha: []
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

| CI | Status | Platform(s) | Framework(s) | Test Framework(s) |
| --- | --- | --- | --- | --- |
| [AppVeyor][app-veyor] | [![Build Status][app-veyor-shield]][app-veyor] | `Windows` | `nestandard2.0` | `netcoreapp2.2.0` |
| [AppVeyor][app-veyor] | [![Build Status][app-veyor-shield]][app-veyor] | `Windows` | `nestandard2.0` | `netcoreapp2.2.2` |

[Azure Table storage][table-storage] supports a [limited set of data types][supported-types] (namely `byte[]`, `bool`, `DateTime`, `double`, `Guid`, `int`, `long` and `string`). `Unsupported Types` allows to store unsupported data types with some limitations:

Expand Down Expand Up @@ -58,6 +58,30 @@ You will not be able to [filter][filter] the entities using the unsupported type

Each read and write to `Azure Table storage` will trigger the use of `Reflection`. This could be improved by caching the unsupported properties, in this case the scan would happen once per application lifetime.

## Running locally

### Pre-requisites

- [.NET Core SDK v2.2.104][dotnet-sdk] and higher

### Initial setup on Windows

```posh
.\bootstrap.ps1
```

### Initial setup on Linux / OS X

```bash
./bootstrap.sh
```

### Run build script

```bash
dotnet cake build.cake
```

[table-storage]: https://docs.microsoft.com/en-au/azure/cosmos-db/table-storage-overview
[supported-types]: https://docs.microsoft.com/en-us/rest/api/storageservices/understanding-the-table-service-data-model#property-types
[property-limitations]: https://docs.microsoft.com/en-us/rest/api/storageservices/understanding-the-table-service-data-model#property-limitations
Expand All @@ -74,3 +98,4 @@ Each read and write to `Azure Table storage` will trigger the use of `Reflection
[create-storage-account]: https://docs.microsoft.com/en-us/azure/storage/common/storage-quickstart-create-account?tabs=portal
[console-screenshot]: docs/console.png
[storage-screenshot]: docs/storage.png
[dotnet-sdk]: https://dotnet.microsoft.com/download
15 changes: 6 additions & 9 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ branches:
# We'll also build whenever there is a new commit on any branch starting with `features/`
- /features\/.+/
build_script:
- ps: .\build.ps1 -pack
- ps: dotnet cake build.cake --bootstrap
- ps: dotnet cake build.cake --pack
assembly_info:
# We'll version the binaries and the NuGet package in the build script
patch: false
Expand Down Expand Up @@ -50,7 +51,7 @@ deploy:
api_key:
# Encrypted `NuGet.org` token - https://www.nuget.org/account/ApiKeys
# https://www.appveyor.com/docs/deployment/nuget/#provider-settings
secure: Jg1y1vouDaU+CAzM8epKanv9lEGZZ3lpLEEhNMMfX/00V8/P3UtvYnI2aOO32kFx
secure: gO++14gsWVOdYLR/xQcXJNuzWXSeiZ6PCpKWZf0uugkKTtDCAQ8Galxk4QGrSh5p
skip_symbols: false
symbol_server: https://nuget.smbsrc.net/
artifact: packages
Expand All @@ -73,12 +74,8 @@ environment:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# `install` will run before `build_script`
install:
# `dotnet-install.ps1` is available at: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
# `Cake.dll` is targeting `.NET Core` `1.0.9`, so we need to install the latest `1.0.x` runtime
# The runtime is required to run a `.NET Core` application, it's part of the `SDK`
# https://github.com/dotnet/core/blob/master/release-notes/download-archive.md
- ps: .\build\dotnet-install.ps1 -SharedRuntime -Version 1.0.9
# `UnsupportedTypes` is targeting `.NET Core` `2.1`, so we can safely install the latest `SDK`
# Cake build is targeting `.NET Core` `2.2.0`, so we can safely install the latest `SDK`
# The `SDK` is required to restore, build, publish... a `.NET Core` application
# https://www.microsoft.com/net/download/windows
- ps: .\build\dotnet-install.ps1 -Channel Current
- ps: .\build\dotnet-install.ps1 -Channel 2.2 -Version 2.2.104
- ps: dotnet tool install --global Cake.Tool --version 0.31.0
3 changes: 3 additions & 0 deletions bootstrap.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dotnet tool install Cake.Tool --global --version 0.31.0
dotnet cake build.cake --bootstrap
dotnet cake build.cake
3 changes: 3 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dotnet tool install Cake.Tool --global --version 0.31.0
dotnet cake build.cake --bootstrap
dotnet cake build.cake
4 changes: 3 additions & 1 deletion build.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#tool "nuget:?package=GitVersion.CommandLine&version=3.6.5"
#module nuget:?package=Cake.DotNetTool.Module&version=0.1.0

#tool dotnet:?package=GitVersion.Tool&version=4.0.1-beta1-58

var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
Expand Down
13 changes: 11 additions & 2 deletions samples/SampleConsole/Configuration/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
using System.Threading.Tasks;
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.RetryPolicies;
using Microsoft.WindowsAzure.Storage.Table;
using TableStorage.UnsupportedTypes.SampleConsole.Storage;

namespace TableStorage.UnsupportedTypes.SampleConsole.Configuration
Expand All @@ -22,7 +25,13 @@ public static async Task AddStorageAsync(this IServiceCollection services, IConf
var tableClient = storageAccount.CreateCloudTableClient();
var table = tableClient.GetTableReference(nameof(UnsupportedTypesTestTableEntity));

await table.CreateIfNotExistsAsync();
var options = new TableRequestOptions
{
RetryPolicy = new NoRetry(),
ServerTimeout = TimeSpan.FromSeconds(1)
};

await table.CreateIfNotExistsAsync(options, new OperationContext());

services.AddSingleton(table);
}
Expand Down
8 changes: 8 additions & 0 deletions samples/SampleConsole/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"SampleConsole": {
"commandName": "Project"
}
}
}
3 changes: 2 additions & 1 deletion samples/SampleConsole/SampleConsole.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<RuntimeFrameworkVersion>2.2.2</RuntimeFrameworkVersion>
<AssemblyName>TableStorage.UnsupportedTypes.SampleConsole</AssemblyName>
<RootNamespace>TableStorage.UnsupportedTypes.SampleConsole</RootNamespace>
<LangVersion>7.1</LangVersion>
Expand All @@ -22,7 +23,7 @@
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.2.0" />
<PackageReference Include="Serilog" Version="2.7.1" />
<PackageReference Include="Serilog" Version="2.8.0" />
<PackageReference Include="Serilog.Enrichers.Demystify" Version="0.1.0-dev-00016" />
<PackageReference Include="Serilog.Extensions.Logging" Version="2.0.2" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<RuntimeFrameworkVersion>2.2.0</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>2.2.2</RuntimeFrameworkVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.5.3" />
<PackageReference Include="FluentAssertions" Version="5.6.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="WindowsAzure.Storage" Version="9.3.3" />
<PackageReference Include="xunit" Version="2.4.1" />
Expand Down
4 changes: 0 additions & 4 deletions tools/packages.config

This file was deleted.

0 comments on commit 01e828b

Please sign in to comment.