Skip to content

Add signing operation coordination infrastructure - #1066

Open
dtivel wants to merge 1 commit into
dtivel/clickonce-safe-stagingfrom
dtivel/signing-operation-coordinator
Open

Add signing operation coordination infrastructure#1066
dtivel wants to merge 1 commit into
dtivel/clickonce-safe-stagingfrom
dtivel/signing-operation-coordinator

Conversation

@dtivel

@dtivel dtivel commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add canonical signing-source identities for physical files and recursively nested container entries.
  • Add invocation-scoped coordination so duplicate source claims share one owner operation, result, or failure.
  • Retain immutable snapshots for successful operations and support atomic materialization into multiple layouts.
  • Add disposal-aware snapshot lifetime management and direct self-await protection.
  • Add focused coverage for identity semantics, concurrency, shared failures, reentrancy, materialization, and cleanup.

Behavior

This infrastructure remains dormant. It is not registered with dependency injection or integrated with dispatch, signing formats, containers, or CLI behavior. Activation is deferred to a later PR in the ClickOnce implementation sequence.

Testing

  • dotnet build .\sign.sln --no-restore
  • dotnet test .\sign.sln --no-build --no-restore

993 tests passed and 1 test was skipped.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be91288d-5106-4c59-a1fa-c5353dccb828
@dtivel
dtivel requested a review from a team as a code owner September 6, 2026 14:49
@dtivel
dtivel changed the base branch from main to dtivel/clickonce-safe-staging September 6, 2026 14:49
@dtivel
dtivel requested review from kartheekp-ms and a lite review from Copilot September 6, 2026 14:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity · 1 Low severity

New issues introduced by this change (2)
Severity Finding
Medium severity test/​Sign.Core.Test/​TestInfrastructure/​TestDirectory.cs — CreateFile takes a parameter named relativePath but currently does not enforce that it is actually…
Low severity 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 SigningSourceIdentity to provide canonical identities for physical paths and recursively nested container entries.
  • Added SigningOperationCoordinator + SigningOperationResult to 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.

Comment on lines +25 to +27
string path = Path.Combine(FullPath, relativePath);
Directory.CreateDirectory(Path.GetDirectoryName(path)!);
File.WriteAllText(path: path, contents: contents);
Comment on lines +82 to +89
Exception primaryException =
exception is FileNotFoundException ||
exception is DirectoryNotFoundException &&
!File.Exists(artifact.FullName)
? new InvalidOperationException(
message: "The signed artifact is unavailable.",
innerException: exception)
: exception;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants