Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f64e59f
little fix
dundich May 26, 2026
c35ad10
~
dundich May 28, 2026
add525c
refactor classes
dundich Jun 25, 2026
806e3fd
improve configuration
dundich Jun 25, 2026
c14a381
improve SaWorkQueue
dundich Jun 25, 2026
b81d661
impove outbox
dundich Jun 25, 2026
6f39479
imrove Cron
dundich Jun 26, 2026
cbb1bae
improve media
dundich Jun 26, 2026
9278055
improve media
dundich Jun 26, 2026
1ca30dc
sa ffmpeg
dundich Jun 26, 2026
820b5ff
improve s3
dundich Jun 26, 2026
3f3e122
improve Sa.Data.PostgreSql
dundich Jun 26, 2026
f1294b0
improve part
dundich Jun 26, 2026
b6640af
improve sa.outbox.pg
dundich Jun 26, 2026
57ae3ed
settings
dundich Jun 29, 2026
8b8b55d
big outbox setting refactoring
dundich Jun 29, 2026
679924a
fix outbox
dundich Jun 29, 2026
6e6fbda
refactor delivery builder + xml summary
dundich Jun 30, 2026
6b69cf2
default settings
dundich Jun 30, 2026
c5fa2b5
ConsumerGroupId as key for consumer
dundich Jun 30, 2026
065a158
added IOutboxConsumerManager
dundich Jun 30, 2026
86b29d1
tests
dundich Jun 30, 2026
cf4cb86
refactoring
dundich Jun 30, 2026
c2a97d5
CancellationTokenSource не освобождались при удалении читателя
dundich Jun 30, 2026
6f256b3
rename PostponeAt to PostponeDelay — clarify TimeSpan semantics
dundich Jun 30, 2026
0577684
~ readme
dundich Jul 1, 2026
56e79c8
docs: add XML documentation to all public API in Sa.HybridFileStorage…
dundich Jul 1, 2026
ef4c0ea
Hybrid storage full refactoring
dundich Jul 1, 2026
4cc7cc4
tests for Hybrid storages
dundich Jul 1, 2026
e40491d
Virtual Folders (Baskets) Concept
dundich Jul 1, 2026
f8060ac
docs: fix README inaccuracies and add full Sa API documentation
dundich Jul 2, 2026
ebbbb2a
refactor: Retry API overhaul, remove IArrayPool, add ConfigureAwait(f…
dundich Jul 2, 2026
e7e1a9d
chore: bump all library versions to 0.10.0
dundich Jul 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -801,4 +801,9 @@ src/.vscode/
/src/Sa.Media.FFmpeg/build/artifacts/
/src/Sa.Media.FFmpeg/build/build.*/

*.lscache
*.lscache

# ai
.qwen/
.agents/
/.github/skills
140 changes: 140 additions & 0 deletions QWEN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# Sa — .NET 10 Experimental AOT Library Suite

## Project Overview

**Sa** is a collection of reusable .NET 10 libraries focused on infrastructure patterns for distributed systems. It targets **.NET 10.0**, uses **Native AOT**, and follows the **Central Package Management (CPM)** pattern via `Directory.Packages.props`.

### Libraries

| Library | Purpose |
|---|---|
| **Sa** | Shared utility classes (LockRenewer, MurmurHash3, Retry, extensions) consumed by other libs via `<Compile Include="..." Link="..."/>` |
| **Sa.Configuration** | Command-line argument parsing (`Arguments`) and secure secrets management from files/env vars/host key files |
| **Sa.Configuration.PostgreSql** | PostgreSQL-backed dynamic configuration source — changes in DB reflect in-app without redeploy |
| **Sa.Data.PostgreSql** | Lightweight Npgsql client wrapper |
| **Sa.Data.S3** | S3 data client (Minio-compatible) |
| **Sa.HybridFileStorage** | Hybrid file storage abstraction with automatic provider failover (FileSystem ↔ S3 ↔ Postgres) |
| **Sa.HybridFileStorage.FileSystem** | FileSystem provider implementation |
| **Sa.HybridFileStorage.S3** | S3 provider implementation |
| **Sa.HybridFileStorage.Postgres** | PostgreSQL provider implementation |
| **Sa.Media** | Async, memory-efficient WAV file reader (`AsyncWavReader`) |
| **Sa.Media.FFmpeg** | FFmpeg .NET wrapper with built-in binaries (Win x64 / Linux), audio conversion, metadata extraction, channel split/join, DI support |
| **Sa.Outbox** | Base Outbox pattern infrastructure for reliable message publishing |
| **Sa.Outbox.PostgreSql** | PostgreSQL Outbox implementation — parallel processing, tenant support, scheduled data cleanup |
| **Sa.Partitional.PostgreSql** | Declarative PostgreSQL table partitioning (time: day/month/year; list; range) with migration/deletion schedules |
| **Sa.Schedule** | Scheduled task executor with failure strategies (close app, stop job, stop all jobs, ignore) |
| **Sa.Utils.WorkQueue** | Async queue with concurrency limiting, built on `System.Threading.Channels` |

### Samples

Located in `src/Samples/`: Configuration.Web, FFMpeg.Console, HybridFileStorage.Console, Partitional.ConsoleApp, PgOutbox.ConsoleApp, Schedule.Console, Storage.Tests.

### Tests

Located in `src/Tests/`: 15 test projects using **xunit v3**, **Testcontainers** (PostgreSQL + Minio) for integration tests. Test fixtures in `src/Tests/Fixtures/`.

---

## Building and Running

### Prerequisites

- .NET 10 SDK
- PowerShell (for local build scripts)

### Build Commands

```powershell
# Full build (clean + restore + build)
.\build\do_build.ps1

# Run all tests
.\build\do_test.ps1

# Package NuGet packages (produces .nupkg + .snupkg in dist/)
.\build\do_package.ps1

# Push to local registry
.\build\do_push_local.ps1

# Push to prod (nuget.org)
.\build\do_push_prod.ps1
```

### Direct dotnet commands

```powershell
# Restore
dotnet restore src/Sa.slnx -c Release

# Build
dotnet build src/Sa.slnx -c Release -v n

# Test (all)
dotnet test src/Sa.slnx -v n

# Test CI (skip tests requiring local Docker infrastructure)
dotnet test src/Sa.slnx --filter "Category!=Local"
```

### GitHub Actions

Workflow in `.github/workflows/` — builds on `main` branch push/PR. Uses `dotnet 9.x` runtime in CI (despite targeting net10.0). Note: tests are commented out in CI.

---

## Architecture Notes

### Shared Code Pattern

Common utilities live in `src/Sa/` and are linked into consuming projects via MSBuild `<Compile Include="..." Link="AsLink\..." />`. This avoids duplication while keeping projects independently buildable. Linked classes include:

- `Classes/`: LockRenewer, MurmurHash3, Retry, ResetLazy, Section, MimeTypeMap, IArrayPool, LockRenewer
- `Extensions/`: DateTimeExtensions, EnumerableExtensions, ExceptionExtensions, SpanExtensions, StringExtensions, NumericExtensions, StrToExtensions, GuidExtensions

### Project Dependencies

```
Sa.Utils.WorkQueue → (none)
Sa.Schedule → Sa.Utils.WorkQueue
Sa.Outbox → Sa.Schedule
Sa.Partitional.PostgreSql → Sa.Schedule + Sa.Data.PostgreSql
Sa.Outbox.PostgreSql → Sa.Outbox + Sa.Partitional.PostgreSql (+ object pool, recycler mem stream)
Sa.Data.S3 → (none, just Npgsql indirectly)
Sa.HybridFileStorage → (base abstraction)
Sa.HybridFileStorage.S3 → Sa.Data.S3 + Sa.HybridFileStorage
Sa.Configuration → Microsoft.Extensions.Hosting
Sa.Configuration.PostgreSql → (standalone)
```

### Common Properties (inherited by all packages)

From `Common.Properties.xml`:
- Target: `net10.0`
- AOT: `PublishAot=true`, `IsAotCompatible=true`
- Nullable: enabled
- Analyzers: enabled
- TrimmerSingleWarn: false
- Symbols: included
- License: MIT

From `Common.NuGet.Properties.xml`: additional shared package references (logging, DI, SourceLink).

### Testing Conventions

- Framework: **xunit v3** (not classic xunit)
- Integration tests use **Testcontainers** (PostgreSQL + Minio)
- Test projects import `Host.Test.Properties.xml` for common test config
- Local-dependent tests are tagged `Category!=Local` for CI

---

## Development Conventions

- **ImplicitUsings** and **Nullable** enabled across all projects
- **Central Package Management** — all versions in `Directory.Packages.props`
- **SourceLink** enabled for debug symbol linking to GitHub
- **InternalsVisibleTo** used for test project access to internal members
- No `_editorconfig` rules beyond standard .NET conventions
- All projects use SDK-style csproj format
- Solution managed via `.slnx` (new solution format)
Loading
Loading