Skip to content

Commit 245478f

Browse files
authored
Merge pull request #219 from datalust/dev
2021.4.x Release
2 parents c51b55e + f69a6b3 commit 245478f

28 files changed

+195
-90
lines changed

Build.Docker.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ $IsCIBuild = $null -ne $env:APPVEYOR_BUILD_NUMBER
22
$IsPublishedBuild = ($env:APPVEYOR_REPO_BRANCH -eq "main" -or $env:APPVEYOR_REPO_BRANCH -eq "dev") -and $null -eq $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH
33

44
$version = @{ $true = $env:APPVEYOR_BUILD_VERSION; $false = "99.99.99" }[$env:APPVEYOR_BUILD_VERSION -ne $NULL];
5-
$framework = "net5.0"
5+
$framework = "net6.0"
66
$rid = "linux-x64"
77
$tag = "datalust/seqcli-ci:$version"
88

@@ -14,7 +14,11 @@ function Execute-Tests
1414
cd ./test/SeqCli.EndToEnd/
1515
docker pull datalust/seq:latest
1616
& dotnet run -f $framework -- --docker-server
17-
if ($LASTEXITCODE -ne 0) { exit 1 }
17+
if ($LASTEXITCODE -ne 0)
18+
{
19+
cd ../..
20+
exit 1
21+
}
1822
cd ../..
1923
}
2024

Build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
$ErrorActionPreference = 'Stop'
22

3-
$framework = 'net5.0'
3+
$framework = 'net6.0'
44
$windowsTfmSuffix = '-windows'
55

66
function Clean-Output

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The [Seq](https://datalust.co/seq) client command-line app. Supports logging (`s
66

77
## Getting started
88

9-
Install or unzip the [release for your operating system](https://github.com/datalust/seqcli/releases). Or, if you have `dotnet` installed, `seqcli` can be installed as a global tool using:
9+
The Seq installer for Windows includes `seqcli`. Otherwise, download the [release for your operating system](https://github.com/datalust/seqcli/releases). Or, if you have `dotnet` installed, `seqcli` can be installed as a global tool using:
1010

1111
```
1212
dotnet tool install --global seqcli
@@ -27,6 +27,8 @@ The API key will be stored in your `SeqCli.json` configuration file; on Windows,
2727
docker run --rm datalust/seqcli:latest <command> [<args>]
2828
```
2929

30+
To connect to Seq in a docker container on the local machine use the machine's IP address (not localhost) or specify [docker host networking](https://docs.docker.com/network/host/) with `--net host`.
31+
3032
Use Docker networks and volumes to make local files and other containers accessible to `seqcli` within its container.
3133

3234
## Commands
@@ -152,7 +154,7 @@ seqcli apikey create -t 'Test API Key' -p Environment=Test
152154
| `--filter=VALUE` | A filter to apply to incoming events |
153155
| `--minimum-level=VALUE` | The minimum event level/severity to accept; the default is to accept all events |
154156
| `--use-server-timestamps` | Discard client-supplied timestamps and use server clock values |
155-
| `--permissions=VALUE` | The permissions to delegate to the API key; the default is `Ingest` |
157+
| `--permissions=VALUE` | A comma-separated list of permissions to delegate to the API key; valid permissions are `Ingest` (default), `Read`, `Setup`, and `Write` |
156158
| `--connect-username=VALUE` | A username to connect with, useful primarily when setting up the first API key |
157159
| `--connect-password=VALUE` | When `connect-username` is specified, a corresponding password |
158160
| `--connect-password-stdin` | When `connect-username` is specified, read the corresponding password from `STDIN` |
@@ -459,7 +461,7 @@ Begin demotion of the current leader node.
459461
Example:
460462

461463
```
462-
seqcli node demote -v --wait
464+
seqcli node demote --verbose --wait
463465
```
464466

465467
| Option | Description |
@@ -740,6 +742,7 @@ seqcli signal create -t 'Exceptions' -f "@Exception is not null"
740742
| `-t`, `--title=VALUE` | A title for the signal |
741743
| `--description=VALUE` | A description for the signal |
742744
| `-f`, `--filter=VALUE` | Filter to associate with the signal |
745+
| `-c`, `--column=VALUE` | Column to associate with the signal; this argument can be used multiple times |
743746
| `--group=VALUE` | An explicit group name to associate with the signal; the default is to infer the group from the filter |
744747
| `--no-group` | Specify that no group should be inferred; the default is to infer the group from the filter |
745748
| `--protected` | Specify that the signal is editable only by administrators |

appveyor.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
version: 2021.3.{build}
1+
version: 2021.4.{build}
22
skip_tags: true
33
image:
4-
- Visual Studio 2019
4+
- Visual Studio 2022
55
- Ubuntu1804
66
environment:
77
DOCKER_TOKEN:
@@ -19,13 +19,13 @@ for:
1919
-
2020
matrix:
2121
only:
22-
- image: Visual Studio 2019
22+
- image: Visual Studio 2022
2323

2424
install:
25-
- ps: ./Setup.ps1
25+
- pwsh: ./Setup.ps1
2626

2727
build_script:
28-
- ps: ./Build.ps1 -shortver "$($env:APPVEYOR_BUILD_VERSION)"
28+
- pwsh: ./Build.ps1 -shortver "$($env:APPVEYOR_BUILD_VERSION)"
2929

3030
deploy:
3131

@@ -53,4 +53,4 @@ for:
5353
- ./setup.sh
5454

5555
build_script:
56-
- ps: $env:PATH = "$env:HOME/.dotnetcli:$env:PATH"; ./Build.Docker.ps1 -shortver "$($env:APPVEYOR_BUILD_VERSION)"
56+
- pwsh: $env:PATH = "$env:HOME/.dotnetcli:$env:PATH"; ./Build.Docker.ps1 -shortver "$($env:APPVEYOR_BUILD_VERSION)"

dockerfiles/seqcli/Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
# based on: https://github.com/dotnet/dotnet-docker/blob/master/2.0/runtime-deps/jessie/amd64/Dockerfile
22

3-
FROM ubuntu:18.04
3+
FROM ubuntu:20.04
44

55
RUN apt-get update \
66
&& apt-get install -y --no-install-recommends \
77
ca-certificates \
8-
liblmdb-dev \
98
libc6 \
109
libgcc1 \
1110
libgssapi-krb5-2 \
12-
libicu60 \
11+
libicu66 \
1312
liblttng-ust0 \
14-
libssl1.0.0 \
13+
libssl1.1 \
1514
libstdc++6 \
1615
zlib1g \
1716
&& rm -rf /var/lib/apt/lists/*
1817

19-
COPY dockerfiles/seqcli/run.sh /run.sh
20-
COPY src/SeqCli/bin/Release/net5.0/linux-x64/publish /bin/seqcli
18+
COPY src/SeqCli/bin/Release/net6.0/linux-x64/publish /bin/seqcli
2119

22-
ENTRYPOINT ["/run.sh"]
20+
ENTRYPOINT ["/bin/seqcli/seqcli"]
2321

2422
LABEL Description="seqcli" Vendor="Datalust Pty Ltd"

dockerfiles/seqcli/run.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "5.0.400"
3+
"version": "6.0.100"
44
}
55
}

src/Roastery/Roastery.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net5.0</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
</PropertyGroup>
77

src/SeqCli/Apps/Definitions/AppDefinition.cs

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,41 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#nullable enable
16+
1517
using System.Collections.Generic;
18+
using Newtonsoft.Json;
1619

1720
namespace SeqCli.Apps.Definitions
1821
{
1922
// ReSharper disable all
2023
class AppDefinition
2124
{
25+
public AppDefinition(string name)
26+
{
27+
Name = name;
28+
}
29+
2230
public string Name { get; set; }
23-
public string Description { get; set; }
31+
32+
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
33+
public string? Description { get; set; }
34+
35+
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
2436
public bool AllowReprocessing { get; set; }
25-
public string Executable { get; set; }
26-
public string Arguments { get; set; }
37+
38+
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
39+
public string? Executable { get; set; }
40+
41+
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
42+
public string? Arguments { get; set; }
43+
2744
public List<string> Capabilities { get; set; } = new List<string>();
28-
public Dictionary<string, AppPlatformDefinition> Platform { get; set; }
29-
public Dictionary<string, AppSettingDefinition> Settings { get; set; }
45+
46+
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
47+
public Dictionary<string, AppPlatformDefinition>? Platform { get; set; }
48+
49+
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
50+
public Dictionary<string, AppSettingDefinition>? Settings { get; set; }
3051
}
3152
}

src/SeqCli/Apps/Definitions/AppMetadataReader.cs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
using System.Reflection;
2020
using Seq.Apps;
2121

22+
#nullable enable
23+
2224
namespace SeqCli.Apps.Definitions
2325
{
2426
static class AppMetadataReader
@@ -31,16 +33,15 @@ public static AppDefinition ReadFromSeqAppType(Type seqAppType)
3133
if (declared == null)
3234
throw new ArgumentException($"The provided type '{seqAppType}' is not marked with [SeqApp].");
3335

34-
var app = new AppDefinition
36+
var app = new AppDefinition(declared.Name)
3537
{
36-
Name = declared.Name,
3738
Description = declared.Description,
3839
AllowReprocessing = declared.AllowReprocessing,
3940
Settings = GetAvailableSettings(seqAppType),
4041
Capabilities = GetCapabilities(seqAppType),
4142
Platform = new Dictionary<string, AppPlatformDefinition>
4243
{
43-
["hosted-dotnet"] = new AppPlatformDefinition
44+
["hosted-dotnet"] = new()
4445
{
4546
SeqAppTypeName = seqAppType.FullName
4647
}
@@ -68,29 +69,30 @@ static Dictionary<string, AppSettingDefinition> GetAvailableSettings(Type mainRe
6869
p => p.pi.Name,
6970
p => new AppSettingDefinition
7071
{
71-
DisplayName = p.attr!.DisplayName,
72+
DisplayName = Normalize(p.attr!.DisplayName),
7273
IsOptional = p.attr.IsOptional,
73-
HelpText = p.attr.HelpText,
74+
HelpText = Normalize(p.attr.HelpText),
7475
InputType = p.attr.InputType == SettingInputType.Unspecified ?
7576
GetSettingType(p.pi.PropertyType) :
7677
(AppSettingType)Enum.Parse(typeof(AppSettingType), p.attr.InputType.ToString()),
7778
IsInvocationParameter = p.attr.IsInvocationParameter,
78-
AllowedValues = TryGetAllowedValues(p.pi.PropertyType)
79+
AllowedValues = TryGetAllowedValues(p.pi.PropertyType),
80+
Syntax = Normalize(p.attr.Syntax)
7981
});
8082
}
8183

82-
static readonly HashSet<Type> IntegerTypes = new HashSet<Type>
84+
static readonly HashSet<Type> IntegerTypes = new()
8385
{
8486
typeof(short), typeof(ushort), typeof(int), typeof(uint),
8587
typeof(long), typeof(ulong)
8688
};
8789

88-
static readonly HashSet<Type> DecimalTypes = new HashSet<Type>
90+
static readonly HashSet<Type> DecimalTypes = new()
8991
{
9092
typeof(float), typeof(double), typeof(decimal)
9193
};
9294

93-
static readonly HashSet<Type> BooleanTypes = new HashSet<Type>
95+
static readonly HashSet<Type> BooleanTypes = new()
9496
{
9597
typeof(bool)
9698
};
@@ -114,7 +116,7 @@ internal static AppSettingType GetSettingType(Type type)
114116
return AppSettingType.Text;
115117
}
116118

117-
internal static AppSettingValue[] TryGetAllowedValues(Type type)
119+
internal static AppSettingValue[]? TryGetAllowedValues(Type type)
118120
{
119121
var targetType = Nullable.GetUnderlyingType(type) ?? type;
120122

@@ -130,5 +132,10 @@ from name in Enum.GetNames(targetType)
130132

131133
return values.ToArray();
132134
}
135+
136+
static string? Normalize(string? s)
137+
{
138+
return string.IsNullOrWhiteSpace(s) ? null : s;
139+
}
133140
}
134141
}

0 commit comments

Comments
 (0)