[PROD-008] .NET idempotency rerun E2E and Docker PostgreSQL validation#629
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be10349bf8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| await Assert.ThrowsAnyAsync<PostgresException>( | ||
| () => session.PersistSourceFamilyYearAsync(invalidBatch)); | ||
|
|
||
| Assert.Equal(0, await CountYearStateRowsAsync(dataSource, SourceFamily.DefraDesnz, 2024)); |
There was a problem hiding this comment.
Make rollback assertion independent of prior year-state rows
When CARBONOPS_DOTNET_POSTGRESQL_TEST_SCHEMA is set (the documented fallback when schema creation isn’t allowed), all integration tests in this class share one schema. DefraSourceCycleInsertRerunAndYearStateAreIdempotentWhenEnabled inserts defra_desnz/2024 into source_family_year_states, so this assertion can fail based solely on test execution order rather than rollback behavior. Capture the row count before the invalid persist and assert it is unchanged afterward to avoid order-dependent failures in the supported explicit-schema mode.
Useful? React with 👍 / 👎.
Summary
Adds the .NET opt-in Docker PostgreSQL E2E/idempotency validation baseline.
This validates .NET schema bootstrap, source-cycle parsing, source-specific master/detail insert, idempotent rerun duplicate skips, year-state progression, no-available-source-year behavior, and failed persistence rollback behavior against an externally supplied PostgreSQL target.
This does not make .NET or the whole project production-ready. Full all-source .NET E2E execution and Python/.NET persisted parity validation remain incomplete.
Files changed
Docker PostgreSQL opt-in behavior
Adds opt-in .NET PostgreSQL integration tests guarded by:
The tests accept externally supplied PostgreSQL settings via either:
or split
CARBONOPS_PARSER_POSTGRES_*settings through the existing .NET production config boundary.Default tests do not open PostgreSQL.
E2E behavior validated
The opt-in E2E path validates:
no_available_source_yearno-op behaviorIdempotency/rerun behavior
The E2E test verifies:
Year-state behavior
The E2E test verifies:
Redaction/safety behavior
The tests assert diagnostics redact PostgreSQL password and connection-string values.
The test path uses externally supplied credentials only. No DSN, password, token, or local secret is committed.
No uncontrolled live network access is introduced.
Production parity status
This satisfies only the
.NET idempotency/rerun E2E and Docker PostgreSQL validationbaseline item from the production parity contract.Current verdict remains:
Validation performed
git diff --check: passeddotnet restore src/dotnet/CarbonOps.Parser.sln: passeddotnet build src/dotnet/CarbonOps.Parser.sln --configuration Release --no-restore --disable-build-servers -m:1: passed, 0 warnings/errorspython -m pytest tests/test_production_parity_contract.py: 3 passedpython -m pytest tests/test_release_validation_gate.py: 7 passedKnown unrelated baseline
The full .NET contract test project has previously shown deterministic fixture/hash failures outside the PROD-008 E2E surface. This PR does not broaden into those failures.
Remaining blockers
The following .NET parity items remain:
Verdict
Project-level production-ready: no.
Python runtime production path: yes.
.NET runtime production path: no; Docker PostgreSQL E2E/idempotency validation baseline added.
Task-ID: PROD-008
Task-Issue: #628