Skip to content

feat: content-type headers, CLI tests, and spec promotion#19

Merged
woutervanranst merged 2 commits into
masterfrom
quilted-tire
Mar 24, 2026
Merged

feat: content-type headers, CLI tests, and spec promotion#19
woutervanranst merged 2 commits into
masterfrom
quilted-tire

Conversation

@woutervanranst

@woutervanranst woutervanranst commented Mar 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Set HTTP Content-Type headers on all blob uploads so chunk types (large/tar/thin/filetree/snapshot/chunk-index) are distinguishable from the Azure portal without inspecting custom metadata. Added ContentTypes constants class, IsEncrypted property on IEncryptionService, and wired content-type through all 6 upload call sites.
  • Added Arius.Cli.Tests project with TUnit/NSubstitute/Shouldly for testing CLI command parsing, option validation, and DI wiring without Azure credentials.
  • Documented blob storage structure in README with container layout explanation and Mermaid diagram.
  • Promoted all delta specs to main specs from the archived arius-core-foundation change: created main specs for blob-storage, encryption, archive-pipeline, ls-command, restore-pipeline, and added progress display requirements to the existing cli spec.

Content-Type mapping

Blob type Encrypted Plaintext
Large chunk application/aes256cbc+gzip application/gzip
Tar chunk application/aes256cbc+tar+gzip application/tar+gzip
Thin pointer text/plain; charset=utf-8 text/plain; charset=utf-8
Filetree application/json application/json
Snapshot application/aes256cbc+gzip application/gzip
Chunk index application/aes256cbc+gzip application/gzip

Test results

All 133 tests pass (68 core + 3 architecture + 17 CLI + 45 integration).

Summary by CodeRabbit

  • Documentation

    • Added comprehensive specifications for archive pipeline, restore pipeline, blob storage architecture, encryption behavior, CLI progress reporting, and list command functionality.
    • Added detailed Blob Storage Structure documentation describing virtual-directory layout, Merkle tree relationships, and manifest formats with visual flowcharts and examples.
  • Chores

    • Updated internal blob upload mechanisms to properly track content-type metadata for stored artifacts and enhanced encryption-state detection for configuration validation.

…cture

Add contentType parameter to IBlobStorageService.UploadAsync so each
blob type gets a descriptive HTTP Content-Type header (e.g.
application/aes256cbc+tar+gzip for encrypted tar bundles, text/plain
for thin pointers). This makes chunk types identifiable without
inspecting custom metadata.

Add IsEncrypted property to IEncryptionService to cleanly select
encrypted vs plaintext content-type variants.

Add ContentTypes constants class and wire content-type through all six
upload call sites (large, tar, thin, snapshot, filetree, chunk-index).

Add blob storage structure section to README with a mermaid diagram
explaining the container layout, each prefix's purpose, and how
snapshots, file trees, chunks, and the chunk index relate.
@codecov

codecov Bot commented Mar 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.23%. Comparing base (938de21) to head (7a1440d).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #19      +/-   ##
==========================================
+ Coverage   77.08%   77.23%   +0.15%     
==========================================
  Files          21       21              
  Lines        2199     2214      +15     
  Branches      234      239       +5     
==========================================
+ Hits         1695     1710      +15     
  Misses        446      446              
  Partials       58       58              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai

coderabbitai Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR introduces comprehensive specification documentation for the Arius archive and restore pipelines, blob storage architecture, encryption model, and CLI requirements. It extends the blob storage interface to support explicit content-type metadata, adds encryption state detection to services, and threads content-type values through archive/restore operations and service implementations.

Changes

Cohort / File(s) Summary
Documentation & Specifications
README.md, openspec/specs/archive-pipeline/spec.md, openspec/specs/blob-storage/spec.md, openspec/specs/cli/spec.md, openspec/specs/encryption/spec.md, openspec/specs/ls-command/spec.md, openspec/specs/restore-pipeline/spec.md
Added comprehensive markdown specifications and documentation for blob storage structure, archive/restore pipelines, encryption behavior, CLI requirements, and the ls command. Covers end-to-end workflows, container layout expectations, content addressing, rehydration strategy, and user-facing progress/confirmation interactions.
Content-Type Support Infrastructure
src/Arius.Core/Storage/BlobConstants.cs, src/Arius.Core/Storage/IBlobStorageService.cs, src/Arius.AzureBlob/AzureBlobStorageService.cs
Introduced ContentTypes static class defining MIME type constants for different blob categories (large/tar/thin chunks, filetrees, snapshots, chunk-index shards) with encryption variants. Extended IBlobStorageService.UploadAsync interface with optional contentType parameter; implemented in Azure backend with HTTP header assignment.
Encryption Service Enhancement
src/Arius.Core/Encryption/IEncryptionService.cs, src/Arius.Core/Encryption/PassphraseEncryptionService.cs, src/Arius.Core/Encryption/PlaintextPassthroughService.cs
Added IsEncrypted read-only boolean property to IEncryptionService interface and both implementations, exposing whether real AES-256-CBC encryption or plaintext passthrough is active.
Content-Type Usage in Pipelines
src/Arius.Core/Archive/ArchivePipelineHandler.cs, src/Arius.Core/ChunkIndex/ChunkIndexService.cs, src/Arius.Core/FileTree/TreeService.cs, src/Arius.Core/Snapshot/SnapshotService.cs
Threaded explicit content-type values through blob uploads based on encryption state and blob category: large/tar chunks use encryption-dependent types, thin blobs use plaintext type, filetrees use JSON type, snapshots and chunk-index shards use encryption-aware types.
Test Fixture Updates
src/Arius.Core.Tests/FileTree/TreeServiceTests.cs, src/Arius.Integration.Tests/Pipeline/CrashRecoveryTests.cs
Updated test stub method signatures (FakeBlobService and FaultingBlobService) to match the new UploadAsync parameter list with optional contentType parameter positioned before overwrite.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the three main changes: addition of content-type headers to blob uploads, introduction of CLI tests, and promotion of specification documents.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch quilted-tire

Comment @coderabbitai help to get the list of available commands and usage tips.

@woutervanranst woutervanranst merged commit 255b5fc into master Mar 24, 2026
7 of 8 checks passed
@woutervanranst woutervanranst deleted the quilted-tire branch March 24, 2026 16:19
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.

1 participant