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
b074338
feat(abstractions): add shared ValiFlowDiagnostics observability helper
UBF21 Oct 4, 2026
8a5b4ac
feat(vali-flow): add GenericRepository, extract QuerySpecificationBui…
UBF21 Oct 4, 2026
29ce856
refactor(inmemory): split evaluator into partial files, fix Update le…
UBF21 Oct 4, 2026
9d38d2b
fix(sql): prevent SQL injection via identifier guard, fix builder bug…
UBF21 Oct 4, 2026
4187c9f
fix(nosql): translate closure-captured null values to NullNode like l…
UBF21 Oct 4, 2026
2ae8b47
fix(nosql): escape RediSearch query injection, cap Mongo/Elasticsearc…
UBF21 Oct 4, 2026
d328fde
feat(nosql): add diagnostics tracing to DynamoDB translator
UBF21 Oct 4, 2026
62d1074
feat(nosql): add Couchbase, CosmosDb, and Firestore providers
UBF21 Oct 4, 2026
0d4cdee
feat(benchmarks): add EF Core benchmark using EFCore.InMemory provider
UBF21 Oct 4, 2026
a562c97
docs: update README and architecture/benchmarks docs for new providers
UBF21 Oct 4, 2026
63af978
fix(vali-flow): preserve tracked entity's PK in UpsertRangeAsync.Part…
UBF21 Oct 5, 2026
8673246
test(vali-flow): raise EF Core evaluator coverage from 74.37% to 97.42%
UBF21 Oct 5, 2026
36d7c59
fix(vali-flow): serialize concurrent BulkInsertOrUpdateAsync calls pe…
UBF21 Oct 5, 2026
4750f1a
fix(vali-flow): generic transient retry for bulk upsert concurrency a…
UBF21 Oct 6, 2026
8383ed1
fix(vali-flow): raise BulkUpsertRetryPolicy default budget from 4 to …
UBF21 Oct 6, 2026
d946be1
fix(vali-flow): raise BulkUpsertRetryPolicy budget from 7 to 12 attempts
UBF21 Oct 6, 2026
06c7483
fix(vali-flow): gate bulk upsert contention per table, not per Update…
UBF21 Oct 6, 2026
2202ca7
fix(tests): eliminate flaky Activity-capture tests across Sql/EF-Core…
UBF21 Oct 6, 2026
14b0705
fix(nosql-couchbase): bind decimal values as native N1QL numbers, not…
UBF21 Oct 6, 2026
193756b
docs: add release pipeline design spec
UBF21 Oct 6, 2026
c38d0f2
chore: gitignore .superpowers/ (subagent-driven-development scratch w…
UBF21 Oct 6, 2026
f16c2bb
chore(abstractions): bump version to 1.2.0 for release
UBF21 Oct 6, 2026
409e671
chore(wave-2): bump versions and re-point Vali-Flow.Abstractions to P…
UBF21 Oct 6, 2026
7c771bb
docs: add release pipeline implementation plan
UBF21 Oct 6, 2026
82a3480
chore(wave-3): bump versions and re-point Vali-Flow.NoSql to PackageR…
UBF21 Oct 6, 2026
66b0f3c
fix(packaging): add missing VF_logo.png to Couchbase/CosmosDb/Firestore
UBF21 Oct 6, 2026
0736c8d
docs: catch up CHANGELOG.md for Oct 2-6 work (3 new NoSQL providers, …
UBF21 Oct 6, 2026
6cf6f5a
docs: state .NET 10 forward compatibility wherever .NET 8/9 is mentioned
UBF21 Oct 6, 2026
87e90f7
ci: add reusable CI workflow (build, test matrix, 95% coverage gate, …
UBF21 Oct 6, 2026
1b94921
ci: add manual release workflow (3-wave dependency-ordered NuGet publ…
UBF21 Oct 6, 2026
91d7b71
ci: prime a local NuGet feed with Abstractions/NoSql before restore
UBF21 Oct 6, 2026
fc138b6
fix(ci): multi-target the 11 test projects and fix 2 CI bugs found on…
UBF21 Oct 6, 2026
dd25e63
fix(ci): switch coverage gate from blanket 95% to per-library baselines
UBF21 Oct 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
407 changes: 407 additions & 0 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

133 changes: 133 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: Release

# Manual only. By default it runs the full CI (net8.0/net9.0 on Linux and Windows) and uploads the
# packed NuGet packages as a workflow artifact; it publishes NOTHING. Publishing needs BOTH
# `publish: true` and an approval of the `nuget` environment (Settings > Environments > nuget >
# Required reviewers), and uses the NUGET_API_KEY secret of that environment.
#
# Publication order — 3 waves, because this repo has a 2-level dependency chain on top of the core:
# Wave 1: Vali-Flow.Abstractions alone.
# Wave 2: Vali-Flow, Vali-Flow.InMemory, Vali-Flow.Sql, Vali-Flow.NoSql (all depend on Abstractions).
# Wave 3: the 7 NoSQL provider packages (all depend on Vali-Flow.NoSql from wave 2).
# Each wave waits for NuGet.org to index the package the next wave needs before proceeding.
on:
workflow_dispatch:
inputs:
version-suffix:
description: Prerelease label appended to every package version, for example rc.1 (empty = versions from the csproj files)
type: string
required: false
default: ''
publish:
description: Publish the packages to NuGet.org after the approval of the nuget environment
type: boolean
default: false

permissions:
contents: read

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false

jobs:
ci:
name: CI (build, test on net8.0/net9.0, coverage gate, pack)
uses: ./.github/workflows/ci.yml
with:
version-suffix: ${{ inputs.version-suffix }}

publish:
name: Publish to NuGet (needs approval)
needs: ci
if: ${{ inputs.publish }}
runs-on: ubuntu-latest
environment: nuget
env:
NUGET_SOURCE: https://api.nuget.org/v3/index.json
steps:
- uses: actions/download-artifact@v4
with:
name: nuget-packages
path: artifacts

- name: Every package must contain net8.0 and net9.0
run: |
for package in artifacts/*.nupkg; do
for tfm in net8.0 net9.0; do
unzip -l "$package" | grep -q "lib/$tfm/" || { echo "::error::$package has no lib/$tfm"; exit 1; }
done
done

- name: Check NUGET_API_KEY is configured
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
if [ -z "$NUGET_API_KEY" ]; then
echo "::error::NUGET_API_KEY is not set in the nuget environment"
exit 1
fi

# ---- Wave 1: Vali-Flow.Abstractions alone ----
- name: 'Wave 1: push Vali-Flow.Abstractions'
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
# Vali-Flow.Abstractions is the only package whose id is followed by a version digit
# among files matching "Vali-Flow.Abstractions.*" (there is no other package with that
# prefix), so a plain glob is unambiguous here.
dotnet nuget push artifacts/Vali-Flow.Abstractions.[0-9]*.nupkg --source "$NUGET_SOURCE" --api-key "$NUGET_API_KEY" --skip-duplicate

- name: 'Wave 1: wait until NuGet.org lists Vali-Flow.Abstractions'
run: |
pkg=$(basename artifacts/Vali-Flow.Abstractions.[0-9]*.nupkg .nupkg)
version=$(echo "${pkg#Vali-Flow.Abstractions.}" | tr '[:upper:]' '[:lower:]')
for attempt in $(seq 1 40); do
if curl -fsS "https://api.nuget.org/v3-flatcontainer/vali-flow.abstractions/index.json" | grep -q "\"$version\""; then
echo "Vali-Flow.Abstractions $version is indexed"
exit 0
fi
echo "attempt $attempt/40: Vali-Flow.Abstractions $version not indexed yet"
sleep 30
done
echo "::error::Vali-Flow.Abstractions $version was not indexed in time; re-run this job (--skip-duplicate makes it safe)"
exit 1

# ---- Wave 2: Vali-Flow, Vali-Flow.InMemory, Vali-Flow.Sql, Vali-Flow.NoSql ----
- name: 'Wave 2: push Vali-Flow, Vali-Flow.InMemory, Vali-Flow.Sql, Vali-Flow.NoSql'
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
# Vali-Flow.[0-9]* matches only the main package (not Vali-Flow.InMemory.*, Vali-Flow.Sql.*,
# or Vali-Flow.NoSql.* — those have a literal "." before a letter, not a digit).
for pattern in 'Vali-Flow.[0-9]*' 'Vali-Flow.InMemory.[0-9]*' 'Vali-Flow.Sql.[0-9]*' 'Vali-Flow.NoSql.[0-9]*'; do
dotnet nuget push "artifacts/$pattern.nupkg" --source "$NUGET_SOURCE" --api-key "$NUGET_API_KEY" --skip-duplicate
done

- name: 'Wave 2: wait until NuGet.org lists Vali-Flow.NoSql'
run: |
# Only Vali-Flow.NoSql gates wave 3 — the 7 providers depend on it, not on Vali-Flow/InMemory/Sql.
pkg=$(basename artifacts/Vali-Flow.NoSql.[0-9]*.nupkg .nupkg)
version=$(echo "${pkg#Vali-Flow.NoSql.}" | tr '[:upper:]' '[:lower:]')
for attempt in $(seq 1 40); do
if curl -fsS "https://api.nuget.org/v3-flatcontainer/vali-flow.nosql/index.json" | grep -q "\"$version\""; then
echo "Vali-Flow.NoSql $version is indexed"
exit 0
fi
echo "attempt $attempt/40: Vali-Flow.NoSql $version not indexed yet"
sleep 30
done
echo "::error::Vali-Flow.NoSql $version was not indexed in time; re-run this job (--skip-duplicate makes it safe)"
exit 1

# ---- Wave 3: the 7 NoSQL provider packages ----
- name: 'Wave 3: push the 7 NoSQL provider packages'
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
for package in artifacts/Vali-Flow.NoSql.*.nupkg; do
case "$(basename "$package")" in
Vali-Flow.NoSql.[0-9]*) continue ;; # already pushed in wave 2
esac
dotnet nuget push "$package" --source "$NUGET_SOURCE" --api-key "$NUGET_API_KEY" --skip-duplicate
done
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -404,3 +404,8 @@ FodyWeavers.xsd
.claude/
claude-*.md
CLAUDE.md
.claudeignore
.guardian.json
.codegraph/

.superpowers/
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,35 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and

## [Unreleased]

### Added

- **`Vali-Flow.NoSql.Couchbase`, `Vali-Flow.NoSql.CosmosDb`, `Vali-Flow.NoSql.Firestore`** — three new NoSQL translator packages, same pattern as the existing MongoDB/DynamoDB/Elasticsearch/Redis adapters (pure `ValiFlow<T>` expression tree → native query/filter translators, no connection or execution concerns).
- **`GenericRepository<T, TKey>`** (`Vali-Flow`) — a thin repository wrapping `ValiFlowEvaluator<T>` with `GetById`/`GetAll`/`GetPaged`/`Add`/`Update`/`Delete`/`SaveChanges`, for consumers who want a conventional repository surface instead of calling the evaluator directly.
- **`ValiFlowDiagnostics`** (`Vali-Flow.Abstractions`) — shared `ActivitySource`-based `StartActivity`/`RecordException` helper for OpenTelemetry-compatible tracing, now wired through the EF Core evaluator, `Vali-Flow.InMemory`, `Vali-Flow.Sql`'s six builders, and the Mongo/DynamoDB/Elasticsearch/Redis translators.
- EF Core benchmark using the `EFCore.InMemory` provider (`Vali-Flow.Benchmarks`).
- `SqlInsertBuilder`/`SqlUpdateBuilder.SetAllFrom(entity, exclude...)` — reflection-based bulk column mapper.

### Fixed

- **Security — SQL identifier injection**: `Vali-Flow.Sql`'s builders interpolated table/schema/type names directly; added `SqlIdentifierGuard` (regex whitelist) validating all identifiers before interpolation.
- **Security — RediSearch query injection**: `Vali-Flow.NoSql.Redis` didn't escape RediSearch query-syntax special characters (e.g. `)`/`|`) in `LIKE` patterns before wrapping them in wildcards, allowing query-structure injection. Now escaped before wildcarding.
- **`Vali-Flow.NoSql` (Mongo/Elasticsearch)**: closure-captured `null` values in a `ValiFlow<T>` condition weren't translated to the same `NullNode` as a literal `null`, producing inconsistent filters between `.EqualTo(x => x.Prop, someNullVariable)` and `.EqualTo(x => x.Prop, null)`.
- **`Vali-Flow.NoSql.Redis`**: `customConverter` wasn't applied in `VisitComparison`/numeric `VisitIn`, silently ignoring custom type mappings for comparison and `IN` conditions.
- **`Vali-Flow.NoSql.Elasticsearch`**: swallowed inner exception in `ToDouble` conversion — failures surfaced as a generic error with no root cause.
- **`Vali-Flow.NoSql` (Mongo/Elasticsearch)**: unbounded `IN` value lists could exceed the engine's own limits; added `MaxInValues` caps (Mongo 10,000; Elasticsearch 65,536, matching `index.max_terms_count`).
- **`Vali-Flow.NoSql.Couchbase`**: `decimal` values were bound as N1QL string literals instead of native numbers.
- **`Vali-Flow.Sql`**: `OrIgnore`/`OrReplace` dialect guard bug, `Set()`-after-`SelectFrom()` silent data loss, `Where()` double-call silently overwriting the first condition instead of combining — all fixed. Added `AllowDeleteUnmatched()` guard required before `WhenNotMatchedBySourceDelete` in `SqlMergeBuilder` (prevents accidental unguarded deletes in a MERGE).
- **`Vali-Flow` (EF Core evaluator)**: `UpsertRangeAsync` dropped entries on duplicate keys (list accumulator instead of dictionary) — fixed to a dictionary accumulator. `UpsertRangeAsync.PartitionUpsertRange` could discard a tracked entity's primary key — now preserved. `BulkInsertOrUpdateAsync` could race under concurrent calls for the same entity type + key columns — calls are now serialized per that combination.
- **`Vali-Flow` (EF Core evaluator) — bulk upsert contention under concurrency**: replaced the ad-hoc retry with a generic transient-retry policy (`BulkUpsertRetryPolicy`) covering SQL Server, PostgreSQL, MySQL, and SQLite, gated per table (not per `UpdateByProperties` key set) to avoid serializing unrelated upserts against each other. Retry budget raised in two steps (4 → 7 → 12 attempts) based on observed contention under load.
- **`Vali-Flow.InMemory`**: `Update(entity, externalList)` could leak the updated entity into the internal store on a later bare `SaveChanges()` call.

### Changed

- **`Vali-Flow.InMemory`**: `ValiFlowEvaluator<T, TProperty>` (904 lines) split into `Bridge`/`Read`/`Write`/`Grouped` partial files; no public API change.
- **`Vali-Flow` (EF Core evaluator)**: query-construction logic extracted from `ValiFlowEvaluator` into a dedicated `QuerySpecificationBuilder` (single-responsibility split, no public API change).
- EF Core evaluator test coverage raised from 74.37% to 97.42%.
- Eliminated flaky `Activity`-capture tests across the `Sql`/EF-Core/`InMemory` test assemblies (timing-dependent assertions replaced with deterministic capture).

---

## Vali-Flow — 1.3.3
Expand Down
124 changes: 0 additions & 124 deletions CLAUDE.md

This file was deleted.

Loading
Loading