Repository navigation
Add signing operation coordination infrastructure - #1066
Conversation
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It adds substantial new concurrency coordination and snapshot-lifetime logic that warrants careful human review despite strong unit test coverage.
Review tier: Lite
Findings: 1
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
test/Sign.Core.Test/TestInfrastructure/TestDirectory.cs — CreateFile takes a parameter named relativePath but currently does not enforce that it is actually… |
|
src/Sign.Core/SigningOperationCoordinator.cs — The artifact-unavailable detection mixes || and && without parentheses, which is easy to misread… |
What changed in this PR
This PR introduces new internal coordination infrastructure in Sign.Core to canonicalize signing-source identities and to deduplicate concurrent signing operations by sharing a single owner operation/result (plus snapshot-based materialization). It also adds focused unit tests to validate identity semantics, concurrency behavior, snapshot materialization, and disposal/cleanup.
Changes:
- Added
SigningSourceIdentityto provide canonical identities for physical paths and recursively nested container entries. - Added
SigningOperationCoordinator+SigningOperationResultto coordinate same-identity operations and materialize immutable snapshot outputs safely. - Added new unit-test coverage (including concurrency and disposal scenarios) and a small temp-directory test helper.
| File | Description |
|---|---|
| test/Sign.Core.Test/TestInfrastructure/TestDirectory.cs | Adds a disposable temp directory helper for coordinator/identity tests. |
| test/Sign.Core.Test/SigningSourceIdentityTests.cs | Adds unit tests for physical path canonicalization and container entry normalization. |
| test/Sign.Core.Test/SigningOperationCoordinatorTests.cs | Adds extensive coverage for coordination, shared failures, self-await prevention, snapshot materialization, and cleanup. |
| src/Sign.Core/SigningSourceIdentity.cs | Implements canonical, comparable identities for physical files and nested container entries. |
| src/Sign.Core/SigningOperationResult.cs | Implements snapshot-based materialization plus snapshot lifetime management and cleanup behavior. |
| src/Sign.Core/SigningOperationCoordinator.cs | Implements invocation-scoped deduplication/coordination for same-identity signing operations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
a259f23 to
bff564d
Compare
bff564d to
50744a8
Compare
50744a8 to
409d184
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: be91288d-5106-4c59-a1fa-c5353dccb828
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: be91288d-5106-4c59-a1fa-c5353dccb828
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: be91288d-5106-4c59-a1fa-c5353dccb828
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: be91288d-5106-4c59-a1fa-c5353dccb828
784e94f to
e3e9c32
Compare
Implement IAsyncDisposable with a single shared disposal task so concurrent and repeated DisposeAsync calls await the same in-flight operations and observe the same outcome, including snapshot cleanup failures. Remove the snapshot leases, move SigningOperationFile to its own file, and replace the ConcurrentDictionary with a Dictionary that is only accessed under the coordinator lock. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: be91288d-5106-4c59-a1fa-c5353dccb828
|
@kartheekp-ms I pushed
Nothing calls this code in production yet, so there's no behavior change. |





Part of #1049.
Summary
IAsyncDisposable: disposal rejects new work, waits for every in-flight operation, then deletes the snapshots. Concurrent and repeatedDisposeAsynccalls share one disposal and see the same outcome, including any cleanup failure.Behavior
This infrastructure is dormant: nothing registers it with dependency injection or calls it from dispatch, signing formats, containers, or the CLI. A later PR in the ClickOnce implementation sequence will activate it.
Testing
dotnet build .\sign.slndotnet test .\sign.sln --no-build1,060 tests passed and 1 test was skipped.
I also compared the latest NuGet.org release (
0.9.1-beta.26431.1) against a Release build of this branch. The standard signing matrix and extra scenarios aimed at this PR behaved the same on both, including signatures, timestamps, which files changed, and temp-file cleanup.