feat(abstractions/storage): define IObjectStore port#69
Merged
Conversation
There was a problem hiding this comment.
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
IObjectStoreinterface and supporting models (ObjectInfo,ObjectMetadata,ListOptions/ListPage,ObjectStream,PresignedAction). - Added
StorageErrorsstandardized 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 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; |
4869762 to
aad24c7
Compare
2 tasks
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Defines
IObjectStoreport in a newCompendium.Abstractions.Storageassembly. Unblockscompendium-adapter-s3/azure-blob/gcsper ADR-0006.Surface
IObjectStore(PutAsync/GetAsync/DeleteAsync/ExistsAsync/ListAsync/GetPresignedUrlAsync) — all returningResult<T>.ObjectInfo,ObjectMetadata,ListOptions,ListPagerecords.ObjectStream(sealedIDisposable+IAsyncDisposablewrappingStream+ObjectInfo).PresignedActionenum (Get,Put).StorageErrorsfactories:NotFound,AccessDenied,InvalidBucket,Throttled,ContentTooLarge,ConflictExists.Coverage
Compendium.Abstractions.Storage: 100 % line / 100 % branchCompendium.Abstractions.Storage.Tests: 44 tests, all greenTest plan
dotnet buildgreendotnet testgreen (44/44)