From 77e5de653f0c4fe4419e2936d31e2c3d0ecb0c77 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Tue, 16 Jan 2018 08:59:42 +1000 Subject: [PATCH 1/4] Dev version bump [Skip CI] --- src/Seq.Api/Seq.Api.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Seq.Api/Seq.Api.csproj b/src/Seq.Api/Seq.Api.csproj index f28982b..c8f5e03 100644 --- a/src/Seq.Api/Seq.Api.csproj +++ b/src/Seq.Api/Seq.Api.csproj @@ -1,7 +1,7 @@ - + Client library for the Seq HTTP API. - 4.2.0 + 4.2.1 Datalust;Contributors netstandard1.3;net452 $(NoWarn);CS1591 @@ -34,4 +34,4 @@ - \ No newline at end of file + From 0beba5e4a43b4124eccb16760c038b03761ed439 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Tue, 16 Jan 2018 09:47:28 +1000 Subject: [PATCH 2/4] Fix build - check dotnet restore return code --- .vscode/launch.json | 28 +++++++++++++++++++++++++ .vscode/tasks.json | 15 +++++++++++++ Build.ps1 | 22 ++++++++++++++----- example/SeqTail/Program.cs | 2 +- example/SeqTail/SeqTail.csproj | 6 +++--- test/Seq.Api.Tests/Seq.Api.Tests.csproj | 6 +++--- 6 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..a792755 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/example/SeqQuery/bin/Debug/netcoreapp1.0/seq-query.dll", + "args": [], + "cwd": "${workspaceFolder}/example/SeqQuery", + // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window + "console": "internalConsole", + "stopAtEntry": false, + "internalConsoleOptions": "openOnSessionStart" + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..d1afa53 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,15 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "taskName": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/example/SeqQuery/SeqQuery.csproj" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/Build.ps1 b/Build.ps1 index 035b540..ff877e2 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -10,6 +10,7 @@ if(Test-Path .\artifacts) { } & dotnet restore --no-cache +if($LASTEXITCODE -ne 0) { exit 1 } $branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL]; $revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL]; @@ -32,6 +33,17 @@ foreach ($src in ls src/*) { Pop-Location } +foreach ($test in ls test/*.Tests) { + Push-Location $test + + echo "build: Testing project in $test" + + & dotnet test -c Release + if($LASTEXITCODE -ne 0) { exit 3 } + + Pop-Location +} + foreach ($test in ls test/*.Benchmarks) { Push-Location $test @@ -43,13 +55,13 @@ foreach ($test in ls test/*.Benchmarks) { Pop-Location } -foreach ($test in ls test/*.Tests) { - Push-Location $test +foreach ($sample in ls example/*) { + Push-Location $sample - echo "build: Testing project in $test" + echo "build: Building sample project in $sample" - & dotnet test -c Release - if($LASTEXITCODE -ne 0) { exit 3 } + & dotnet build -c Release + if($LASTEXITCODE -ne 0) { exit 2 } Pop-Location } diff --git a/example/SeqTail/Program.cs b/example/SeqTail/Program.cs index b3a13b6..1504705 100644 --- a/example/SeqTail/Program.cs +++ b/example/SeqTail/Program.cs @@ -30,7 +30,7 @@ static void Main(string[] args) { Log.Logger = new LoggerConfiguration() .MinimumLevel.Verbose() - .WriteTo.LiterateConsole() + .WriteTo.Console() .CreateLogger(); TaskScheduler.UnobservedTaskException += (s,e) => Log.Fatal(e.Exception, "Unobserved task exception"); diff --git a/example/SeqTail/SeqTail.csproj b/example/SeqTail/SeqTail.csproj index 2405320..c5676ab 100644 --- a/example/SeqTail/SeqTail.csproj +++ b/example/SeqTail/SeqTail.csproj @@ -19,10 +19,10 @@ - + - - + + diff --git a/test/Seq.Api.Tests/Seq.Api.Tests.csproj b/test/Seq.Api.Tests/Seq.Api.Tests.csproj index a59242f..397fd34 100644 --- a/test/Seq.Api.Tests/Seq.Api.Tests.csproj +++ b/test/Seq.Api.Tests/Seq.Api.Tests.csproj @@ -17,9 +17,9 @@ - - - + + + From 5d72e8678f47fcdf563e3b641c26ad917be20960 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Tue, 16 Jan 2018 09:51:04 +1000 Subject: [PATCH 3/4] Ensure non-templated entities can still be created through their resource group's Items link --- .../ResourceGroups/EntityResourceGroup.cs | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Seq.Api/ResourceGroups/EntityResourceGroup.cs b/src/Seq.Api/ResourceGroups/EntityResourceGroup.cs index e1e51da..6bee541 100644 --- a/src/Seq.Api/ResourceGroups/EntityResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/EntityResourceGroup.cs @@ -13,9 +13,21 @@ internal EntityResourceGroup(string name, ISeqConnection connection) : base(name protected async Task GroupCreateAsync(TEntity entity, IDictionary parameters = null) where TEntity : ILinked { - var link = entity.Links.ContainsKey("Create") ? "Create" : "Items"; - var group = await LoadGroupAsync().ConfigureAwait(false); - return await Client.PostAsync(group, link, entity, parameters).ConfigureAwait(false); + ILinked resource; + string link; + + if (entity.Links.ContainsKey("Create")) + { + resource = entity; + link = "Create"; + } + else + { + resource = await LoadGroupAsync().ConfigureAwait(false); + link = "Items"; + } + + return await Client.PostAsync(resource, link, entity, parameters).ConfigureAwait(false); } } -} \ No newline at end of file +} From 06261f09430037c26135d7b9d43d1664bad656b9 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Tue, 16 Jan 2018 09:58:32 +1000 Subject: [PATCH 4/4] Ignore the .vscode folder --- .gitignore | 2 ++ .vscode/launch.json | 28 ---------------------------- .vscode/tasks.json | 15 --------------- 3 files changed, 2 insertions(+), 43 deletions(-) delete mode 100644 .vscode/launch.json delete mode 100644 .vscode/tasks.json diff --git a/.gitignore b/.gitignore index dc64607..4ee83f6 100644 --- a/.gitignore +++ b/.gitignore @@ -250,3 +250,5 @@ paket-files/ # JetBrains Rider .idea/ *.sln.iml + +.vscode/ diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index a792755..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - // Use IntelliSense to find out which attributes exist for C# debugging - // Use hover for the description of the existing attributes - // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md - "version": "0.2.0", - "configurations": [ - { - "name": ".NET Core Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/example/SeqQuery/bin/Debug/netcoreapp1.0/seq-query.dll", - "args": [], - "cwd": "${workspaceFolder}/example/SeqQuery", - // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window - "console": "internalConsole", - "stopAtEntry": false, - "internalConsoleOptions": "openOnSessionStart" - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach", - "processId": "${command:pickProcess}" - } - ] -} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index d1afa53..0000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "taskName": "build", - "command": "dotnet", - "type": "process", - "args": [ - "build", - "${workspaceFolder}/example/SeqQuery/SeqQuery.csproj" - ], - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file