Public Access
Report a host's pinned paths among the fields an edit changed
This commit is contained in:
1 parent
f05deb4fbc
commit
a6a21decbd
3 files changed
+26
-5
No files matched your search
@@ -1020,10 +1020,10 @@ public sealed class ScreenLayoutTests : IAsyncLifetime
|
||||
}
|
||||
|
||||
/// <remarks>
|
||||
/// The FIELDS column is the one that grows: it is a list of names, and a host has fourteen of them —
|
||||
/// eleven until inheritance added "Password prompt", tags added "Tags" and forwards added "Port
|
||||
/// forwards". Measured with an edit that touched several, because one field name fits anywhere. The
|
||||
/// count is stated rather than derived, so
|
||||
/// The FIELDS column is the one that grows: it is a list of names, and a host has fifteen of them —
|
||||
/// eleven until inheritance added "Password prompt", tags added "Tags", forwards added "Port forwards"
|
||||
/// and pinning added "Pinned paths". Measured with an edit that touched several, because one field
|
||||
/// name fits anywhere. The count is stated rather than derived, so
|
||||
/// it has to be recounted against <c>HostKind.Changes</c> whenever a field is added; the literal in
|
||||
/// <c>SeedLogsAsync</c> is the thing that actually keeps the column measured at its worst.
|
||||
/// </remarks>
|
||||
@@ -2252,7 +2252,7 @@ public sealed class ScreenLayoutTests : IAsyncLifetime
|
||||
ItemId = Guid.CreateVersion7(),
|
||||
ItemLabel = "customer-a-production-database",
|
||||
Operation = ActivityOperation.Updated,
|
||||
ChangedFields = "Hostname, Port, Username, Options, Password prompt, Group, Tags, Port forwards",
|
||||
ChangedFields = "Hostname, Port, Username, Options, Password prompt, Group, Tags, Port forwards, Pinned paths",
|
||||
At = new DateTimeOffset(2026, 7, 30, 9, 15, 0, TimeSpan.Zero),
|
||||
DeviceName = "jaap-jan-workstation",
|
||||
},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using DodoSSH.Client.Domain;
|
||||
using DodoSSH.Contracts;
|
||||
|
||||
namespace DodoSSH.Client.Sync.Tests;
|
||||
@@ -53,4 +54,23 @@ public sealed class ItemKindsTests
|
||||
|
||||
reconcilers.Keys.Order().ShouldBe(ItemKinds.SyncedTypes.Order());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AHostEditThatOnlyChangedItsPins_IsReportedAsChangingPinnedPaths()
|
||||
{
|
||||
// Pinned paths were the one host field Changes did not look at, so an edit that only pinned or
|
||||
// unpinned a directory reached the keychain log as an update that changed nothing.
|
||||
var before = new HostSecret
|
||||
{
|
||||
Label = "db-01",
|
||||
Hostname = "db-01.internal",
|
||||
PinnedPaths = PinnedPathList.Create(["/var/log"]),
|
||||
};
|
||||
var after = before with { PinnedPaths = PinnedPathList.Create(["/var/log", "/etc/nginx"]) };
|
||||
|
||||
HostKind.Instance.Changes(before, after).ShouldBe(["Pinned paths"]);
|
||||
HostKind.Instance.Changes(before, before with { PinnedPaths = PinnedPathList.Empty })
|
||||
.ShouldBe(["Pinned paths"]);
|
||||
HostKind.Instance.Changes(before, before with { }).ShouldBeEmpty();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user