Skip to content

Commit 36364eb

Browse files
authored
Merge pull request #344 from datalust/dev
2024.3 Release
2 parents 16f8d4d + 2678561 commit 36364eb

34 files changed

+555
-88
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ dlldata.c
4646
project.lock.json
4747
project.fragment.lock.json
4848
artifacts/
49-
**/Properties/launchSettings.json
5049

5150
*_i.c
5251
*_p.c

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 2024.2.{build}
1+
version: 2024.3.{build}
22
skip_tags: true
33
image:
44
- Visual Studio 2022

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": "8.0.203"
3+
"version": "8.0.204"
44
}
55
}

src/Roastery/Data/Database.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using Serilog;
1010
using Serilog.Events;
1111
using SerilogTracing;
12-
using SerilogTracing.Instrumentation;
1312

1413
namespace Roastery.Data;
1514

src/Roastery/Web/RequestLoggingMiddleware.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using Serilog.Context;
66
using Serilog.Events;
77
using SerilogTracing;
8-
using SerilogTracing.Instrumentation;
98

109
namespace Roastery.Web;
1110

src/SeqCli/Cli/CommandMetadata.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ namespace SeqCli.Cli;
1616

1717
public class CommandMetadata : ICommandMetadata
1818
{
19-
public string Name { get; set; } = null!;
19+
public required string Name { get; set; }
2020
public string? SubCommand { get; set; }
21-
public string HelpText { get; set; } = null!;
21+
public required string HelpText { get; set; }
2222
public string? Example { get; set; }
2323
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
using System;
2+
using System.Linq;
3+
using System.Threading.Tasks;
4+
using SeqCli.Cli.Features;
5+
using SeqCli.Connection;
6+
using SeqCli.Util;
7+
using Serilog;
8+
9+
namespace SeqCli.Cli.Commands.App;
10+
11+
[Command("app", "uninstall", "Uninstall an app package",
12+
Example = "seqcli app uninstall --package-id 'Seq.App.JsonArchive'")]
13+
// ReSharper disable once UnusedType.Global
14+
class UninstallCommand : Command
15+
{
16+
readonly SeqConnectionFactory _connectionFactory;
17+
18+
string? _packageId, _id;
19+
readonly ConnectionFeature _connection;
20+
21+
public UninstallCommand(SeqConnectionFactory connectionFactory)
22+
{
23+
_connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));
24+
25+
Options.Add(
26+
"package-id=",
27+
"The package id of the app package to uninstall",
28+
packageId => _packageId = ArgumentString.Normalize(packageId));
29+
30+
Options.Add(
31+
"i=|id=",
32+
"The id of a single app package to uninstall",
33+
t => _id = ArgumentString.Normalize(t));
34+
35+
_connection = Enable<ConnectionFeature>();
36+
}
37+
38+
protected override async Task<int> Run()
39+
{
40+
if (_packageId == null && _id == null)
41+
{
42+
Log.Error("A `package-id` or `id` must be specified");
43+
return 1;
44+
}
45+
46+
var connection = _connectionFactory.Connect(_connection);
47+
48+
var toRemove = _id != null ? [await connection.Apps.FindAsync(_id)]
49+
: (await connection.Apps.ListAsync())
50+
.Where(app => _packageId == app.Package.PackageId)
51+
.ToArray();
52+
53+
if (!toRemove.Any())
54+
{
55+
Log.Error("No matching API key was found");
56+
return 1;
57+
}
58+
59+
foreach (var app in toRemove)
60+
await connection.Apps.RemoveAsync(app);
61+
62+
return 0;
63+
}
64+
}

src/SeqCli/Cli/Commands/AppInstance/CreateCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public CreateCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config
5252

5353
Options.Add(
5454
"stream:",
55-
"Stream incoming events to this app instance as they're ingested; optionally accepts a signal expression limiting which events should be streamed",
55+
"Stream incoming events to this app instance as they're ingested; optionally accepts a signal expression limiting which events should be streamed, for example `signal-1,signal-2`",
5656
s =>
5757
{
5858
_streamIncomingEvents = true;
@@ -116,4 +116,4 @@ bool ValidateSettingName(string settingName)
116116

117117
return 0;
118118
}
119-
}
119+
}

src/SeqCli/Cli/Commands/Bench/QueryBenchCase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ namespace SeqCli.Cli.Commands.Bench;
1818

1919
class QueryBenchCase
2020
{
21-
public string Id { get; set; } = null!;
22-
public string Query { get; set; } = null!;
21+
public required string Id { get; set; }
22+
public required string Query { get; set; }
2323
public string? SignalExpression { get; set; }
2424

2525
// Not used programmatically at this time.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// Copyright © Datalust Pty Ltd and Contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
using System;
16+
using System.Threading.Tasks;
17+
using Seq.Api.Model.Signals;
18+
using SeqCli.Cli.Features;
19+
using SeqCli.Config;
20+
using SeqCli.Connection;
21+
using SeqCli.Signals;
22+
using SeqCli.Syntax;
23+
using SeqCli.Util;
24+
using Serilog;
25+
26+
namespace SeqCli.Cli.Commands.ExpressionIndex;
27+
28+
[Command("expressionindex", "create", "Create an expression index",
29+
Example = "seqcli expressionindex create --expression \"ServerName\"")]
30+
class CreateCommand : Command
31+
{
32+
readonly SeqConnectionFactory _connectionFactory;
33+
34+
readonly ConnectionFeature _connection;
35+
readonly OutputFormatFeature _output;
36+
37+
string? _expression;
38+
39+
public CreateCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
40+
{
41+
_connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));
42+
43+
Options.Add(
44+
"e=|expression=",
45+
"The expression to index",
46+
v => _expression = ArgumentString.Normalize(v));
47+
48+
_connection = Enable<ConnectionFeature>();
49+
_output = Enable(new OutputFormatFeature(config.Output));
50+
}
51+
52+
protected override async Task<int> Run()
53+
{
54+
var connection = _connectionFactory.Connect(_connection);
55+
56+
if (string.IsNullOrEmpty(_expression))
57+
{
58+
Log.Error("An `expression` must be specified");
59+
return 1;
60+
}
61+
62+
var index = await connection.ExpressionIndexes.TemplateAsync();
63+
index.Expression = _expression;
64+
index = await connection.ExpressionIndexes.AddAsync(index);
65+
66+
_output.WriteEntity(index);
67+
68+
return 0;
69+
}
70+
}

0 commit comments

Comments
 (0)