Skip to content

fix: extractors no longer mutate user-provided Schem - #2556

Merged
norberttech merged 2 commits into
1.xfrom
schema-modification-regression
Jul 27, 2026
Merged

fix: extractors no longer mutate user-provided Schem#2556
norberttech merged 2 commits into
1.xfrom
schema-modification-regression

Conversation

@norberttech

@norberttech norberttech commented Jul 27, 2026

Copy link
Copy Markdown
Member

Change Log


Added

  • flow-php/etl - Schema Immutability ADR

Fixed

  • flow-php/etl - extractors no longer pollute a user-provided schema
  • flow-php/etl - partition columns no longer leak between streams
  • flow-php/etl - Rows::schema() no longer corrupts the first row's schema
  • flow-php/flow-php-ext - native hydrator no longer drops per-value metadata
  • flow-php/cli - --db-column filtering in flow:db:schema

Changed

  • flow-php/etl - Schema and Schema\Definition are immutable, mutators return a new instance
  • flow-php/etl-adapter-csv, -excel, -json, -xml - explicit schema no longer projects partition columns away

Removed

Deprecated

Security

- clone Schema at withSchema() reception in all 16 schema-receiving
extractors
- clone per extract() run and per stream before extending with
_input_file_uri/partition columns
- fixes caller schema pollution, extractor-lifetime pollution and
cross-stream partition leaks (#2536 regression)
- regression tests with mixed partitioned/non-partitioned fixtures per
adapter
@norberttech norberttech added this to the 0.42.0 milestone Jul 27, 2026
@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.21429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.41%. Comparing base (b54e092) to head (fd44cd2).
⚠️ Report is 1 commits behind head on 1.x.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##                1.x    #2556      +/-   ##
============================================
- Coverage     86.41%   86.41%   -0.01%     
  Complexity    23487    23487              
============================================
  Files          1800     1800              
  Lines         71314    71260      -54     
============================================
- Hits          61628    61581      -47     
+ Misses         9686     9679       -7     
Components Coverage Δ
etl 90.39% <98.18%> (-0.05%) ⬇️
cli 89.40% <100.00%> (ø)
lib-array-dot 81.44% <ø> (ø)
lib-azure-sdk 64.44% <ø> (ø)
lib-doctrine-dbal-bulk 93.61% <ø> (ø)
lib-filesystem 86.64% <ø> (ø)
lib-types 91.58% <ø> (ø)
lib-parquet 70.23% <ø> (ø)
lib-parquet-viewer 82.26% <ø> (ø)
lib-snappy 89.82% <ø> (ø)
lib-dremel 0.00% <ø> (ø)
lib-postgresql 88.62% <ø> (ø)
lib-telemetry 86.58% <ø> (ø)
bridge-filesystem-async-aws 92.74% <ø> (ø)
bridge-filesystem-azure 90.45% <ø> (ø)
bridge-monolog-http 96.82% <ø> (ø)
bridge-monolog-telemetry 94.79% <ø> (ø)
bridge-openapi-specification 92.07% <ø> (ø)
symfony-http-foundation 78.57% <ø> (ø)
bridge-psr18-telemetry 100.00% <ø> (ø)
bridge-psr3-telemetry 98.95% <ø> (ø)
bridge-psr7-telemetry 100.00% <ø> (ø)
bridge-telemetry-otlp 90.41% <ø> (ø)
bridge-symfony-http-foundation-telemetry 92.85% <ø> (ø)
bridge-symfony-filesystem-bundle 91.85% <ø> (ø)
bridge-symfony-filesystem-cache 98.18% <ø> (ø)
bridge-symfony-postgresql-bundle 93.70% <ø> (ø)
bridge-symfony-postgresql-cache 94.41% <ø> (ø)
bridge-symfony-postgresql-messenger 98.80% <ø> (ø)
bridge-symfony-postgresql-session 93.65% <ø> (ø)
bridge-symfony-telemetry-bundle 90.10% <ø> (ø)
adapter-chartjs 84.05% <ø> (ø)
adapter-csv 89.46% <ø> (ø)
adapter-doctrine 90.75% <ø> (ø)
adapter-google-sheet 91.56% <ø> (ø)
adapter-http 75.79% <ø> (ø)
adapter-json 87.66% <ø> (+0.35%) ⬆️
adapter-logger 50.00% <ø> (ø)
adapter-parquet 88.69% <ø> (ø)
adapter-text 92.59% <ø> (ø)
adapter-xml 84.27% <ø> (+0.70%) ⬆️
adapter-avro 0.00% <ø> (ø)
adapter-excel 87.20% <ø> (+0.47%) ⬆️
adapter-postgresql 90.84% <ø> (ø)
adapter-seal 83.26% <ø> (ø)
bridge-phpunit-postgresql 75.30% <ø> (ø)
bridge-phpunit-telemetry 87.32% <ø> (ø)
bridge-phpstan-types 0.00% <ø> (ø)
bridge-postgresql-valinor 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- all Schema/Definition mutators return a new instance; both are final
readonly
- revert extractor Schema clones, redundant under immutability
- native hydrator: use setMetadata() return value instead of mutating a
clone
- assign mutator results in DatabaseTableSchemaCommand and
PhpRowHydrator
- replace clone ADR with schema-immutability, add upgrading entry
@github-actions github-actions Bot added size: L and removed size: M labels Jul 27, 2026
@norberttech
norberttech merged commit afe7b7f into 1.x Jul 27, 2026
49 checks passed
@norberttech
norberttech deleted the schema-modification-regression branch July 27, 2026 12:31
@github-project-automation github-project-automation Bot moved this from Todo to Done in Roadmap Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant