Skip to content

feat(abstractions/storage): define IObjectStore port#69

Merged
Pomdapis merged 1 commit into
mainfrom
feat/port-iobjectstore
May 10, 2026
Merged

feat(abstractions/storage): define IObjectStore port#69
Pomdapis merged 1 commit into
mainfrom
feat/port-iobjectstore

Conversation

@Pomdapis
Copy link
Copy Markdown
Contributor

Summary

Defines IObjectStore port in a new Compendium.Abstractions.Storage assembly. Unblocks compendium-adapter-s3 / azure-blob / gcs per ADR-0006.

Surface

  • IObjectStore (PutAsync / GetAsync / DeleteAsync / ExistsAsync / ListAsync / GetPresignedUrlAsync) — all returning Result<T>.
  • ObjectInfo, ObjectMetadata, ListOptions, ListPage records.
  • ObjectStream (sealed IDisposable + IAsyncDisposable wrapping Stream + ObjectInfo).
  • PresignedAction enum (Get, Put).
  • StorageErrors factories: NotFound, AccessDenied, InvalidBucket, Throttled, ContentTooLarge, ConflictExists.

Coverage

Compendium.Abstractions.Storage: 100 % line / 100 % branch
Compendium.Abstractions.Storage.Tests: 44 tests, all green

Test plan

  • dotnet build green
  • dotnet test green (44/44)
  • Coverage ≥ 90 %
  • CI green

Copilot AI review requested due to automatic review settings May 10, 2026 20:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Defines a new Compendium.Abstractions.Storage abstractions assembly that introduces an IObjectStore port plus supporting models/errors, along with a new unit test project for the assembly.

Changes:

  • Added IObjectStore interface and supporting models (ObjectInfo, ObjectMetadata, ListOptions/ListPage, ObjectStream, PresignedAction).
  • Added StorageErrors standardized error factories for object-store operations.
  • Added a new unit test project and updated the solution to include the new projects.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/Unit/Compendium.Abstractions.Storage.Tests/StorageErrorsTests.cs Adds unit tests for StorageErrors factory methods.
tests/Unit/Compendium.Abstractions.Storage.Tests/Models/PresignedActionTests.cs Adds unit tests for PresignedAction enum values and behavior.
tests/Unit/Compendium.Abstractions.Storage.Tests/Models/ObjectStreamTests.cs Adds unit tests for ObjectStream construction and disposal semantics.
tests/Unit/Compendium.Abstractions.Storage.Tests/Models/ObjectMetadataTests.cs Adds unit tests for ObjectMetadata record defaults/equality.
tests/Unit/Compendium.Abstractions.Storage.Tests/Models/ObjectInfoTests.cs Adds unit tests for ObjectInfo record behavior.
tests/Unit/Compendium.Abstractions.Storage.Tests/Models/ListOptionsTests.cs Adds unit tests for ListOptions and ListPage.
tests/Unit/Compendium.Abstractions.Storage.Tests/GlobalUsings.cs Adds global usings for the storage test project.
tests/Unit/Compendium.Abstractions.Storage.Tests/Compendium.Abstractions.Storage.Tests.csproj Introduces the new test project and its dependencies.
src/Abstractions/Compendium.Abstractions.Storage/StorageErrors.cs Adds standardized storage error factories.
src/Abstractions/Compendium.Abstractions.Storage/Models/PresignedAction.cs Adds enum for presigned URL actions.
src/Abstractions/Compendium.Abstractions.Storage/Models/ObjectStream.cs Adds a disposable wrapper for object content stream + metadata.
src/Abstractions/Compendium.Abstractions.Storage/Models/ObjectMetadata.cs Adds upload metadata record.
src/Abstractions/Compendium.Abstractions.Storage/Models/ObjectInfo.cs Adds object descriptor record.
src/Abstractions/Compendium.Abstractions.Storage/Models/ListOptions.cs Adds list options + list page record types.
src/Abstractions/Compendium.Abstractions.Storage/IObjectStore.cs Defines the IObjectStore port interface.
src/Abstractions/Compendium.Abstractions.Storage/GlobalUsings.cs Adds global using for Compendium.Core.Results.
src/Abstractions/Compendium.Abstractions.Storage/Compendium.Abstractions.Storage.csproj Introduces the new abstractions project and references.
Compendium.sln Adds the new projects to the solution (but also removes other existing projects).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Compendium.sln
Comment on lines 108 to 117
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compendium.Application.Tests", "tests\Unit\Compendium.Application.Tests\Compendium.Application.Tests.csproj", "{4F876BBF-5817-4488-AD7C-1F4348DDCD15}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compendium.Adapters.Redis.Tests", "tests\Unit\Compendium.Adapters.Redis.Tests\Compendium.Adapters.Redis.Tests.csproj", "{C63EF05F-7C94-449F-92D1-51E3367395D1}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compendium.Adapters.AspNetCore.Tests", "tests\Unit\Compendium.Adapters.AspNetCore.Tests\Compendium.Adapters.AspNetCore.Tests.csproj", "{84C5728A-8843-4FFF-B2AB-98AF3838D820}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compendium.Adapters.Shared.Tests", "tests\Unit\Compendium.Adapters.Shared.Tests\Compendium.Adapters.Shared.Tests.csproj", "{3BFB6A86-8972-4003-9C52-7DFD5D956BAF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compendium.Testing.Tests", "tests\Unit\Compendium.Testing.Tests\Compendium.Testing.Tests.csproj", "{E5232EFA-E06C-4975-B5A7-91A241D029CB}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compendium.Adapters.PostgreSQL.Tests", "tests\Unit\Compendium.Adapters.PostgreSQL.Tests\Compendium.Adapters.PostgreSQL.Tests.csproj", "{3E6C387D-A84B-43A8-AAF5-B7A9494C57CE}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compendium.Abstractions.Identity.Tests", "tests\Unit\Compendium.Abstractions.Identity.Tests\Compendium.Abstractions.Identity.Tests.csproj", "{0EDEE2DC-46FE-404B-9615-B6E3F756DF75}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compendium.Abstractions.Billing.Tests", "tests\Unit\Compendium.Abstractions.Billing.Tests\Compendium.Abstractions.Billing.Tests.csproj", "{A3257DCF-9F77-4CEE-8FE5-7E8C569F0B17}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compendium.Abstractions.Email.Tests", "tests\Unit\Compendium.Abstractions.Email.Tests\Compendium.Abstractions.Email.Tests.csproj", "{BAD4540D-5310-4623-9441-0328DD43879B}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compendium.Abstractions.Tests", "tests\Unit\Compendium.Abstractions.Tests\Compendium.Abstractions.Tests.csproj", "{071D6168-7960-4B44-83A0-6A73312EE034}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compendium.Abstractions.Storage", "src\Abstractions\Compendium.Abstractions.Storage\Compendium.Abstractions.Storage.csproj", "{3ECD1E4E-6139-4D5E-A65C-8B7BB7F59F7F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compendium.Abstractions.Storage.Tests", "tests\Unit\Compendium.Abstractions.Storage.Tests\Compendium.Abstractions.Storage.Tests.csproj", "{DF5C2B6B-4612-48F8-8822-9D0CB94C414E}"
EndProject
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Compendium.Abstractions\Compendium.Abstractions.csproj" />
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\Abstractions\Compendium.Abstractions.Storage\Compendium.Abstractions.Storage.csproj" />

global using Xunit;
global using FluentAssertions;
global using NSubstitute;
@Pomdapis Pomdapis force-pushed the feat/port-iobjectstore branch from 4869762 to aad24c7 Compare May 10, 2026 21:26
@Pomdapis Pomdapis merged commit 1ed25f5 into main May 10, 2026
5 checks passed
@Pomdapis Pomdapis deleted the feat/port-iobjectstore branch May 10, 2026 21:34
Pomdapis added a commit that referenced this pull request May 18, 2026
… e263abc6) (#110)

## Summary

Fixes VK bug `e263abc6` — \`Compendium.Abstractions.Storage\` was added
by PR #69 then accidentally lost in the squash + a subsequent sln edit,
so the assembly never shipped to nuget despite PR #69 claiming 44 tests
at 100% coverage.

This commit restores the 17 files from \`4869762\` (the original
feature-branch tip) verbatim and re-adds the two \`.sln\` entries.

## Files restored

\`\`\`
src/Abstractions/Compendium.Abstractions.Storage/
  Compendium.Abstractions.Storage.csproj
  GlobalUsings.cs
  IObjectStore.cs
Models/ListOptions.cs, ObjectInfo.cs, ObjectMetadata.cs,
ObjectStream.cs, PresignedAction.cs
  StorageErrors.cs

tests/Unit/Compendium.Abstractions.Storage.Tests/
  Compendium.Abstractions.Storage.Tests.csproj
  GlobalUsings.cs

Models/{ListOptions,ObjectInfo,ObjectMetadata,ObjectStream,PresignedAction}Tests.cs
  StorageErrorsTests.cs
\`\`\`

## Verification

- \`dotnet build src/Abstractions/Compendium.Abstractions.Storage\` → 0
warnings, 0 errors.
- \`dotnet test tests/Unit/Compendium.Abstractions.Storage.Tests\` →
**44/44 green** (100% line + branch coverage on the surface).
- \`Compendium.sln\` lists both projects under Abstractions/Tests
solution folders.
- Full sln build still green; no regression in existing tests.

## What unlocks

- After merge → tag \`v1.0.2\` →
\`Compendium.Abstractions.Storage@1.0.2\` ships to nuget (along with all
other Compendium.* at 1.0.2; mechanical re-tag).
- Follow-up PR on \`compendium-adapter-s3\` removes its inlined
\`IObjectStore\` types and binds \`<PackageReference
Include=\"Compendium.Abstractions.Storage\" Version=\"1.0.2\" />\`.
- \`compendium-adapter-azure-blob\` (POM-519) +
\`compendium-adapter-gcs\` (POM-520) are now unblocked.

## Test plan

- [ ] CI green.
- [ ] Visual check of restored files matches \`git show 4869762\` (it
does — `git checkout 4869762 -- ...`).

Co-authored-by: sacha <sacha@scojhconsult.com>
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